InterchainTokenInterface

Trait InterchainTokenInterface 

Source
pub trait InterchainTokenInterface:
    Interface
    + StellarAssetInterface
    + OwnableInterface
    + UpgradableInterface {
    // Required methods
    fn token_id(env: &Env) -> BytesN<32>;
    fn is_minter(env: &Env, minter: Address) -> bool;
    fn mint_from(
        env: &Env,
        minter: Address,
        to: Address,
        amount: i128,
    ) -> Result<(), ContractError>;
    fn add_minter(env: &Env, minter: Address);
    fn remove_minter(env: &Env, minter: Address);
}

Required Methods§

Source

fn token_id(env: &Env) -> BytesN<32>

Returns the Interchain Token ID

Source

fn is_minter(env: &Env, minter: Address) -> bool

Returns if the specified address is a minter.

Source

fn mint_from( env: &Env, minter: Address, to: Address, amount: i128, ) -> Result<(), ContractError>

Mints new tokens from a specified minter to a specified address.

§Arguments
  • minter - The address of the minter.
  • to - The address to which the tokens will be minted.
  • amount - The amount of tokens to be minted.
§Errors
§Authorization
  • The minter must authorize.
Source

fn add_minter(env: &Env, minter: Address)

Adds a new minter to the Interchain Token contract.

§Arguments
  • minter - The address to be added as a minter.
§Authorization
Source

fn remove_minter(env: &Env, minter: Address)

Removes a new minter from the Interchain Token contract.

§Arguments
  • minter - The address to be added as a minter.
§Authorization

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§