Skip to content

chore: asa validation base class#26

Merged
cusma merged 16 commits intomainfrom
chore/asa-validation
Dec 27, 2025
Merged

chore: asa validation base class#26
cusma merged 16 commits intomainfrom
chore/asa-validation

Conversation

@cusma
Copy link
Copy Markdown
Collaborator

@cusma cusma commented Dec 27, 2025

This PR:

  • Refactor constants in different files (common + ARC89 specific);
  • Introduces ARC90 netauth in the ARC89 partial URI for non-MainNet networks;
  • Adds startswith and endswith utilities to AVM commons;
  • Isolates ASA validation utilities in the ASA Validation base class.

@cusma cusma requested a review from Copilot December 27, 2025 17:12
@cusma cusma self-assigned this Dec 27, 2025
@cusma cusma added the enhancement New feature or request label Dec 27, 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 refactors the codebase to improve modularity and introduce network-specific ARC90 URI support. The changes include:

  • Extracting common AVM constants to a shared constants.py file
  • Creating an AsaValidation base class to isolate ASA validation logic
  • Adding ARC90_NETAUTH template variable for network-specific URI construction

Reviewed changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
smart_contracts/constants.py New file containing common AVM and ARC constants extracted from module-specific files
smart_contracts/asa_validation.py New base class providing ASA validation methods (existence, manager, ARC3/ARC89 compliance)
smart_contracts/template_vars.py Added ARC90_NETAUTH template variable for network authority in ARC90 URIs
smart_contracts/avm_common.py Added arc90_box_query helper function for constructing ARC90 URIs with network auth
smart_contracts/asa_metadata_registry/constants.py Refactored to import common constants and keep only ARC89-specific ones
smart_contracts/asa_metadata_registry/contract.py Updated to inherit from AsaValidation and use refactored validation methods
smart_contracts/asa_metadata_registry/errors.py Updated error message for ARC89 compliance to reference "partial URI"
smart_contracts/asa_metadata_registry/deploy_config.py Added ARC90_NETAUTH to deployment parameters
tests/conftest.py Enabled environment fixture and updated to inject ARC90_NETAUTH from environment
tests/test_arc89_create_metadata.py Updated constant references from ARC_3_* to ARC3_* naming convention
.env.localnet.template Added localnet environment configuration with ARC90_NETAUTH=net:localnet/
.env.testnet.template Added testnet environment configuration with ARC90_NETAUTH=net:testnet/
smart_contracts/artifacts/... Generated TEAL code reflecting the refactored implementation

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

Comment thread smart_contracts/asa_metadata_registry/constants.py
Comment thread smart_contracts/asa_validation.py Outdated
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 12 out of 16 changed files in this pull request and generated 3 comments.


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

Comment thread smart_contracts/asa_metadata_registry/deploy_config.py
Comment thread tests/conftest.py
Comment thread tests/conftest.py
@cusma cusma merged commit a2ef339 into main Dec 27, 2025
1 check passed
@cusma cusma deleted the chore/asa-validation branch December 27, 2025 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants