Trait Fungible

Source
pub trait Fungible {
    // Required methods
    fn transfer(
        env: &mut Env<'_>,
        from: &Address,
        to: &Address,
        amount: &Balance,
    ) -> Result<(), ContractError>
       where Self: Sized;
    fn balance(
        env: &Env<'_>,
        address: &Address,
    ) -> Result<Balance, ContractError>
       where Self: Sized;
}
Expand description

Fungible token trait prototype

Required Methods§

Source

fn transfer( env: &mut Env<'_>, from: &Address, to: &Address, amount: &Balance, ) -> Result<(), ContractError>
where Self: Sized,

Transfer some amount of tokens from one contract to another

Source

fn balance(env: &Env<'_>, address: &Address) -> Result<Balance, ContractError>
where Self: Sized,

Get balance of specified address

Trait Implementations§

Source§

impl ContractTraitDefinition for dyn Fungible

Source§

const METADATA: &[u8]

Trait metadata, see ContractMetadataKind for encoding details

Implementors§