pub trait Nep141Controller {
Show 13 methods fn root() -> Slot<()> { ... } fn slot_account(account_id: &AccountId) -> Slot<u128> { ... } fn slot_total_supply() -> Slot<u128> { ... } fn balance_of(account_id: &AccountId) -> u128 { ... } fn total_supply() -> u128 { ... } fn withdraw_unchecked(&mut self, account_id: &AccountId, amount: u128) { ... } fn deposit_unchecked(&mut self, account_id: &AccountId, amount: u128) { ... } fn transfer_unchecked(
        &mut self,
        sender_account_id: &AccountId,
        receiver_account_id: &AccountId,
        amount: u128
    ) { ... } fn transfer(
        &mut self,
        sender_account_id: AccountId,
        receiver_account_id: AccountId,
        amount: u128,
        memo: Option<String>
    ) { ... } fn mint(&mut self, account_id: AccountId, amount: u128, memo: Option<String>) { ... } fn burn(&mut self, account_id: AccountId, amount: u128, memo: Option<String>) { ... } fn transfer_call(
        &mut self,
        sender_account_id: AccountId,
        receiver_account_id: AccountId,
        amount: u128,
        memo: Option<String>,
        msg: String,
        gas_allowance: Gas
    ) -> Promise { ... } fn resolve_transfer(
        &mut self,
        sender_id: AccountId,
        receiver_id: AccountId,
        amount: u128
    ) -> u128 { ... }
}
Expand description

Non-public implementations of functions for managing a fungible token.

Provided Methods§

Root storage slot

Slot for account data

Slot for storing total supply

Get the balance of an account. Returns 0 if the account does not exist.

Get the total circulating supply of the token.

Removes tokens from an account and decreases total supply. No event emission.

Panics

Panics if the current balance of account_id is less than amount or if total_supply is less than amount.

Increases the token balance of an account. Updates total supply. No event emission,

Panics

Panics if the balance of account_id plus amount >= u128::MAX, or if the total supply plus amount >= u128::MAX.

Decreases the balance of sender_account_id by amount and increases the balance of receiver_account_id by the same. No change to total supply. No event emission.

Panics

Panics if the balance of sender_account_id < amount or if the balance of receiver_account_id plus amount >= u128::MAX.

Performs an NEP-141 token transfer, with event emission.

Panics

See: Nep141Controller::transfer_unchecked

Performs an NEP-141 token mint, with event emission.

Panics

See: Nep141Controller::deposit_unchecked

Performs an NEP-141 token burn, with event emission.

Panics

See: Nep141Controller::withdraw_unchecked

Performs an NEP-141 token transfer call, with event emission.

Panics

Panics if gas_allowance < GAS_FOR_FT_TRANSFER_CALL.

See also: Nep141Controller::transfer

Resolves an NEP-141 ft_transfer_call promise chain.

Implementors§