Skip to content

fix: bug fixes and optimizations#18

Merged
cusma merged 25 commits intomainfrom
fix/first-review
Dec 22, 2025
Merged

fix: bug fixes and optimizations#18
cusma merged 25 commits intomainfrom
fix/first-review

Conversation

@cusma
Copy link
Copy Markdown
Collaborator

@cusma cusma commented Dec 21, 2025

This PR fixes the following bugs:

  • Too early ASA params validation on create metadata;
  • Missing ASA ID key in extra payload checks;
  • Missing MBR payment receiver in replace metadata larger;
  • Missing Zero Address ASA Manager in immutable getter;

And enhances the following aspects:

  • More strict validation of page index in get page hash;
  • Optimize idempotent calls to avoid extra opcodes;
  • Correctly handle empty metadata (both get and page hash).

@cusma cusma requested a review from Copilot December 21, 2025 22:39
@cusma cusma self-assigned this Dec 21, 2025
@cusma cusma added enhancement New feature or request test labels Dec 21, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes several bugs and optimizes the ASA metadata registry contract to reduce opcode costs and improve validation:

  • Adds stricter validation for extra payload transactions and page indices
  • Optimizes idempotent operations to skip unnecessary work
  • Fixes validation timing issues in metadata creation
  • Enhances immutability detection to include zero-address managers

Reviewed changes

Copilot reviewed 3 out of 7 changed files in this pull request and generated 3 comments.

File Description
tests/test_arc89_is_metadata_immutable.py Adds test for zero-address manager immutability check (currently skipped pending algokit-utils fix)
smart_contracts/asa_metadata_registry/contract.py Main contract changes: refactors flag checking, adds idempotency optimizations, fixes validation order, adds zero-address manager check, and improves page index validation
smart_contracts/asa_metadata_registry/constants.py Adds constants for ARC-4 argument indexes to improve code clarity
smart_contracts/artifacts/asa_metadata_registry/AsaMetadataRegistry.approval.teal Generated TEAL reflecting all Python contract changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread smart_contracts/asa_metadata_registry/contract.py
Comment thread smart_contracts/asa_metadata_registry/contract.py Outdated
Comment thread smart_contracts/asa_metadata_registry/contract.py
@cusma cusma requested a review from Copilot December 22, 2025 02:13
@cusma cusma changed the title fix: first review fix: bug fixes and optimizations Dec 22, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 9 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread smart_contracts/asa_metadata_registry/contract.py
Comment thread smart_contracts/asa_metadata_registry/contract.py Outdated
Comment thread smart_contracts/asa_metadata_registry/contract.py Outdated
Comment thread tests/test_arc89_is_metadata_immutable.py
@cusma cusma merged commit 3dbd9a8 into main Dec 22, 2025
1 check passed
@cusma cusma deleted the fix/first-review branch December 22, 2025 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants