Skip to main content

Module sui::sui

Coin is the token used to pay for gas in Sui.
It has 9 decimals, and the smallest unit (10^-9) is called "mist".

Struct SUI

Name of the coin

public struct SUI has drop

Constants

const EAlreadyMinted: u64 = 0;

Sender is not @0x0 the system address.

const ENotSystemAddress: u64 = 1;

The amount of Mist per Sui token based on the fact that mist is 10^-9 of a Sui token

const MIST_PER_SUI: u64 = 1000000000;

The total supply of Sui denominated in whole Sui tokens (10 Billion)

const TOTAL_SUPPLY_SUI: u64 = 10000000000;

The total supply of Sui denominated in Mist (10 Billion * 10^9)

const TOTAL_SUPPLY_MIST: u64 = 10000000000000000000;

Function new

Register the SUI Coin to acquire its Supply.
This should be called only once during genesis creation.

Function transfer

public entry fun transfer(c: sui::coin::Coin<sui::sui::SUI>, recipient: address)