Trait soroban_sdk::token::StellarAssetInterface
source · pub trait StellarAssetInterface {
// Required methods
fn set_admin(env: Env, new_admin: Address);
fn admin(env: Env) -> Address;
fn set_authorized(env: Env, id: Address, authorize: bool);
fn authorized(env: Env, id: Address) -> bool;
fn mint(env: Env, to: Address, amount: i128);
fn clawback(env: Env, from: Address, amount: i128);
}Expand description
Interface for admin capabilities for Token contracts, such as the Stellar Asset Contract.
Required Methods§
Sets whether the account is authorized to use its balance. If
authorized is true, id should be able to use its balance.
§Arguments
id- The address being (de-)authorized.authorize- Whether or notidcan use its balance.
§Events
Emits an event with topics ["set_authorized", id: Address], data = [authorize: bool]
Returns true if id is authorized to use its balance.
§Arguments
id- The address for which token authorization is being checked.
sourcefn clawback(env: Env, from: Address, amount: i128)
fn clawback(env: Env, from: Address, amount: i128)
Clawback amount from from account. amount is burned in the
clawback process.
§Arguments
from- The address holding the balance from which the clawback will take tokens.amount- The amount of tokens to be clawed back.
§Events
Emits an event with topics ["clawback", admin: Address, to: Address], data = [amount: i128]
Object Safety§
This trait is not object safe.