pub trait NativeTokenExt {
// Required methods
fn native_token_initialize(
&mut self,
method_context: MethodContext,
contract: Address,
own_balance: &Address,
max_issuance: &Balance,
) -> Result<NativeToken, ContractError>;
fn native_token_balance(
&self,
contract: Address,
target: &Address,
) -> Result<Balance, ContractError>;
fn native_token_transfer(
&mut self,
method_context: MethodContext,
contract: Address,
from: &Address,
to: &Address,
amount: &Balance,
) -> Result<(), ContractError>;
}Expand description
Extension trait that provides helper methods for calling NativeToken’s methods on Env for convenience purposes
Required Methods§
Sourcefn native_token_initialize(
&mut self,
method_context: MethodContext,
contract: Address,
own_balance: &Address,
max_issuance: &Balance,
) -> Result<NativeToken, ContractError>
fn native_token_initialize( &mut self, method_context: MethodContext, contract: Address, own_balance: &Address, max_issuance: &Balance, ) -> Result<NativeToken, ContractError>
Initialize native token on a shard with max issuance allowed by this shard.
Block rewards will be implemented using transfers from native token’s balance.
fn native_token_balance( &self, contract: Address, target: &Address, ) -> Result<Balance, ContractError>
fn native_token_transfer( &mut self, method_context: MethodContext, contract: Address, from: &Address, to: &Address, amount: &Balance, ) -> Result<(), ContractError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".