Collection Contract Structure
Among the many ways to deploy and trade NFTs on Sui, the best for creator control and usability is the kiosk standard. In short, kiosks are on chain objects that can hold other objects. Kiosks give creators the ability to define requirements when transferring an asset in the NFT type's TransferPolicy. This creates a safer, more reliable trading process and allows creators to enforce royalties on the NFT level.
NOTE: In this doc, kiosk refers to native Sui kiosks, not to be confused with Origin Byte kiosks. The Origin Byte standard has been deprecated in favor of native kiosks. For reliable trading, creators must use kiosks as described here.
For items to be tradable on TradePort, the following is required:
- All items MUST be placed into a kiosk.
- Each kiosk MUST be a shared object. Shared kiosks will have a "shared" flag on an explorer like Suiscan or SuiVision.
- Each NFT type MUST have a defined transfer policy.
Within a transfer policy, creators can define rule by which the policy is used.
-
To ensure permanent tradability, creators MUST define a
kiosk_lock_rule. This rule prevents users or marketplaces from removing items from the kiosk which could break trading across a collection.- The kiosk_lock_rule can be added to a collection via the following cli command
sui client call \ --package 0xdfb4f1d4e43e0c3ad834dcd369f0d39005c872e118c9dc1c5da9765bb93ee5f3 \ --module kiosk_lock_rule \ --function add \ --args \ <TRANSFER_POLICY_ID> \ <TRANSFER_POLICY_CAP_ID> \ --type-args \ <NFT_TYPE> -
If the creator wishes to enforce royalties, a
royalty_rulemust be implemented.- The
royalty_rulecan be added to a collection via the following cli command
sui client call \ --package 0xdfb4f1d4e43e0c3ad834dcd369f0d39005c872e118c9dc1c5da9765bb93ee5f3 \ --module royalty_rule \ --function add \ --args \ <TRANSFER_POLICY_ID> \ <TRANSFER_POLICY_CAP_ID> \ <ROYALTY_BPS> \ <MIN_ROYALTY_AMOUNT> \ --type-args \ <NFT_TYPE> - The
To learn more about Sui kiosks, transfer policies, and their implementation, please consult Mysten Lab's documentation here (opens in a new tab).