Best Practices & Examples
Check Deny Lists Before Transfers: Always verify whether the recipient is allowed to receive the NFT. This ensures compliance and curated distribution.
Use Batch Operations: For large collections, batch minting and metadata updates significantly reduce costs and complexity.
Immutable Collections for Stability: If you want NFTs that never change, set is_mutable = false
. This provides collectors with the confidence that their assets will remain stable over time.
Deny List for Compliance: If your project requires restricting certain addresses (e.g., regulatory reasons), use the deny list and maintain appropriate authority.
Leverage Value Sources: Integrate with off-chain APIs or oracles for NFTs that need to update prices, attributes, or rankings dynamically.
Thorough Testing: Use sui move test
to ensure all functions (minting, burning, transferring, metadata updates) behave as expected. Testing helps maintain code quality and security.
Example: Creating and Minting a Collection
Create a collection with
mint_art20(...)
, specifying initial and max supply.Initialize deny list if needed.
Mint additional NFTs when the initial supply runs out, as long as the max supply is not reached.
Transfer NFTs to users and track their balances with
UserBalance
.Update metadata if the collection is mutable.
By following these guidelines and leveraging the ART20 module’s robust feature set, you can create versatile NFT collections that form the foundation for trading, marketplace operations, and integration with external data—enabling the full Artinals experience.
Last updated