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§
Sourcefn mint_from(
env: &Env,
minter: Address,
to: Address,
amount: i128,
) -> Result<(), ContractError>
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
ContractError::NotMinter: If the specified minter is not authorized to mint tokens.ContractError::InvalidAmount: If the specified amount is invalid (e.g. negative).
§Authorization
- The
mintermust authorize.
Sourcefn add_minter(env: &Env, minter: Address)
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
OwnableInterface::ownermust authorize.
Sourcefn remove_minter(env: &Env, minter: Address)
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
OwnableInterface::ownermust authorize.
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.