pub trait Mint:
RuntimeProvider
+ StorageProvider
+ SystemProvider {
// Required method
fn purse_exists(&mut self, uref: URef) -> Result<bool, Error>;
// Provided methods
fn mint(&mut self, initial_balance: U512) -> Result<URef, Error> { ... }
fn burn(&mut self, purse: URef, amount: U512) -> Result<(), Error> { ... }
fn reduce_total_supply(&mut self, amount: U512) -> Result<(), Error> { ... }
fn balance(&mut self, purse: URef) -> Result<Option<U512>, Error> { ... }
fn transfer(
&mut self,
maybe_to: Option<AccountHash>,
source: URef,
target: URef,
amount: U512,
id: Option<u64>,
) -> Result<(), Error> { ... }
fn read_base_round_reward(&mut self) -> Result<U512, Error> { ... }
fn mint_into_existing_purse(
&mut self,
existing_purse: URef,
amount: U512,
) -> Result<(), Error> { ... }
}Expand description
Mint trait.
Required Methods§
Provided Methods§
Sourcefn mint(&mut self, initial_balance: U512) -> Result<URef, Error>
fn mint(&mut self, initial_balance: U512) -> Result<URef, Error>
Mint new token with given initial_balance balance. Returns new purse on success, otherwise
an error.
Sourcefn reduce_total_supply(&mut self, amount: U512) -> Result<(), Error>
fn reduce_total_supply(&mut self, amount: U512) -> Result<(), Error>
Reduce total supply by amount. Returns unit on success, otherwise
an error.
Sourcefn transfer(
&mut self,
maybe_to: Option<AccountHash>,
source: URef,
target: URef,
amount: U512,
id: Option<u64>,
) -> Result<(), Error>
fn transfer( &mut self, maybe_to: Option<AccountHash>, source: URef, target: URef, amount: U512, id: Option<u64>, ) -> Result<(), Error>
Transfers amount of tokens from source purse to a target purse.
Sourcefn read_base_round_reward(&mut self) -> Result<U512, Error>
fn read_base_round_reward(&mut self) -> Result<U512, Error>
Retrieves the base round reward.
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.