Skip to main content

Create Native Tokens

The stardust update allows you to create your own native tokens Native tokens are minted by a so-called Foundry. The Foundry allows you to specify a max supply once and change the circulating supply.

You can also specify some custom metadata in the foundry output or follow a standard like IRC30. To create a Foundry you need an Alias Output which owns it. This Alias Output only needs to be generated once and can own multiple foundries.

Online Faucet

You can request test funds from the Shimmer Testnet Faucet.

Example Code

  1. Instantiate a Wallet, get Alice's Account which was created in the first guide and sync it.
  2. Check the account's balance for an Alias Output it can use to create the native tokens. If the account doesn't have any, it will create one.
sdk/examples/how_tos/native_tokens/create.rs
loading...
  1. Define the CreateNativeTokenParams.
sdk/examples/how_tos/native_tokens/create.rs
loading...
  1. Create the native token using the Account.create_native_token() function.
sdk/examples/how_tos/native_tokens/create.rs
loading...

Full Example Code

sdk/examples/how_tos/native_tokens/create.rs
loading...

Expected Output

Transaction sent: 0x3e7fe86a2b01a7006fe037249be51852d298d32df69507140d3b41c1a6d7fb90
Block included: https://explorer.shimmer.network/testnet/block/0xca4f8150014bc548214be6b02bed3b7d43041adef8838965815a367f73c7272d
Account synced
Preparing transaction to create native token...
Transaction sent: 0xcfc5ffae0c7be8cfb7c334d6f6bb39a2ddff612c9a9048c88e3d9158f7cc4832
Block included: https://explorer.shimmer.network/testnet/block/0x558c0dcede60609bbb641e9f1d9a7802b48a3c3d5827328a054385140d447436
Created token: 0x089dc1b964591b15819ef1912fab48c001fed4558b37766dfa5daa512495d5b25a0100000000
Account synced