Integrating with ART20
The SALE module does not operate in isolation—it is deeply integrated with the ART20 module’s NFTs and collections. By leveraging the standardized data structures and events from ART20, the SALE module seamlessly interacts with existing NFT collections and user balances. Understanding how these two modules interact will help you design more efficient and user-friendly marketplaces.
Relationship to ART20
NFT Source: All NFTs sold through the SALE module originate from ART20 collections. Creators use ART20’s minting functions to produce NFTs, which they then list for sale via the SALE module.
Collection Validation: The SALE module checks the
collection_id
and usesCollectionCap
to ensure that the seller is authorized to list the NFTs. This prevents unauthorized sales of NFTs and maintains the trust and security established by ART20’s access controls.Deny List Enforcement: If a collection enforces a deny list through ART20, the SALE module respects these restrictions. Buyers on a deny list cannot receive NFTs, ensuring compliance with any restrictions set at the collection level.
UserBalance Synchronization: When NFTs are purchased, the SALE module updates the buyer’s
UserBalance
to reflect the newly acquired tokens. Similarly, when NFTs are withdrawn from a user’s balance for listing, the SALE module checks that the user indeed possesses enough NFTs (as tracked by ART20’sUserBalance
).
By integrating ART20’s capabilities, the SALE module benefits from a consistent, secure foundation for NFT ownership, distribution, and metadata management.
Examples & Best Practices
Last updated