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".

use std::address;
use std::ascii;
use std::bcs;
use std::internal;
use std::option;
use std::string;
use std::type_name;
use std::u128;
use std::vector;
use sui::accumulator;
use sui::accumulator_settlement;
use sui::address;
use sui::bag;
use sui::balance;
use sui::bcs;
use sui::coin;
use sui::config;
use sui::deny_list;
use sui::dynamic_field;
use sui::dynamic_object_field;
use sui::event;
use sui::funds_accumulator;
use sui::hash;
use sui::hex;
use sui::object;
use sui::party;
use sui::protocol_config;
use sui::table;
use sui::transfer;
use sui::tx_context;
use sui::types;
use sui::url;
use sui::vec_map;
use sui::vec_set;

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.

fun new(ctx: &mut sui::tx_context::TxContext): sui::balance::Balance<sui::sui::SUI>

Function transfer

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