docs/content/guides/developer/coin/currency.mdx
The Coin Registry system provides a centralized approach to currency management through the sui::coin_registry module. The registry is a shared object located at address 0xc that stores metadata, supply information, and regulatory status for all registered coin types.
The sui::token module handles token creation on the network. Refer to the Closed-Loop Token and Currency Standards documentation for more information on these features.
The registry system supports two currency creation methods:
new_currency<T>() when creating the coin outside of the init function of your package.new_currency_with_otw<T>() with a One-Time Witness for uniqueness proof.:::caution Proper creation and RPC support requires a second transaction to promote the currency to the registry. :::
Both methods return a CurrencyInitializer<T> that allows configuration before finalization:
The initialization process allows for:
:::caution Proper creation and RPC support requires a second transaction to promote the currency to the registry.
After initialization of a currency using the OTW method, you must call coin_registry::finalize_registration to create the shared Currency object that the Coin Registry can track.
:::
DenyListThe Sui framework provides a DenyList singleton, shared object that the bearer of a DenyCapV2 can access to specify a list of addresses that are unable to use a Sui core type. The initial use case for DenyList, however, focuses on limiting access to coins of a specified type. This is useful, for example, when creating a regulated coin on Sui that requires the ability to block certain addresses from using it as inputs to transactions. Regulated coins on Sui satisfy any regulations that require the ability to prevent known bad actors from having access to those coins.
:::info
The DenyList object is a system object that has the address 0x403. You cannot create it yourself.
:::
Use the make_regulated() function during the initialization phase before calling finalize(). This adds deny list capabilities to the Currency<T> and tracks the regulatory status within the registry system.
Tokens reuse the TreasuryCap defined in the sui::coin module and therefore have the same initialization process. The coin::create_currency function guarantees the uniqueness of the TreasuryCap and forces the creation of a CoinMetadata object.
Coin-like functions perform the minting and burning of tokens. Both require the TreasuryCap:
token::mint: Mint a tokentoken::burn: Burn a tokenSee Closed-Loop Token standard for complete details of working with tokens.