Struct odra_modules::wrapped_native::WrappedNativeToken
source · pub struct WrappedNativeToken { /* private fields */ }Expand description
The WrappedNativeToken module.
Implementations§
source§impl WrappedNativeToken
impl WrappedNativeToken
The WrappedNativeToken module implementation.
sourcepub fn allowance(&self, owner: &Address, spender: &Address) -> U256
pub fn allowance(&self, owner: &Address, spender: &Address) -> U256
Sets the allowance for spender to spend amount of the caller’s tokens.
sourcepub fn balance_of(&self, address: &Address) -> U256
pub fn balance_of(&self, address: &Address) -> U256
Returns the balance of address.
sourcepub fn total_supply(&self) -> U256
pub fn total_supply(&self) -> U256
Returns the total supply of the token.
sourcepub fn approve(&mut self, spender: &Address, amount: &U256)
pub fn approve(&mut self, spender: &Address, amount: &U256)
Approves spender to spend amount of the caller’s tokens.
sourcepub fn transfer_from(
&mut self,
owner: &Address,
recipient: &Address,
amount: &U256,
)
pub fn transfer_from( &mut self, owner: &Address, recipient: &Address, amount: &U256, )
Transfers amount of the owners tokens to recipient using allowance.
Trait Implementations§
source§impl HasEntrypoints for WrappedNativeToken
impl HasEntrypoints for WrappedNativeToken
source§fn entrypoints() -> Vec<Entrypoint>
fn entrypoints() -> Vec<Entrypoint>
Returns the list of contract’s entrypoints.
source§impl HasEvents for WrappedNativeToken
impl HasEvents for WrappedNativeToken
source§impl Module for WrappedNativeToken
impl Module for WrappedNativeToken
source§fn new(env: Rc<ContractEnv>) -> Self
fn new(env: Rc<ContractEnv>) -> Self
Creates a new instance of the module with the given contract environment.
source§fn env(&self) -> Rc<ContractEnv>
fn env(&self) -> Rc<ContractEnv>
Returns the contract environment associated with the module.
source§impl SchemaCustomTypes for WrappedNativeToken
impl SchemaCustomTypes for WrappedNativeToken
source§fn schema_types() -> Vec<Option<CustomType>>
fn schema_types() -> Vec<Option<CustomType>>
Returns a vector of optional CustomTypes.
source§impl SchemaEntrypoints for WrappedNativeToken
impl SchemaEntrypoints for WrappedNativeToken
source§fn schema_entrypoints() -> Vec<Entrypoint>
fn schema_entrypoints() -> Vec<Entrypoint>
Returns a vector of Entrypoints.
source§impl SchemaErrors for WrappedNativeToken
impl SchemaErrors for WrappedNativeToken
source§impl SchemaEvents for WrappedNativeToken
impl SchemaEvents for WrappedNativeToken
source§fn custom_types() -> Vec<Option<CustomType>>
fn custom_types() -> Vec<Option<CustomType>>
Returns a vector of CustomTypes. Read more
Auto Trait Implementations§
impl !Freeze for WrappedNativeToken
impl !RefUnwindSafe for WrappedNativeToken
impl !Send for WrappedNativeToken
impl !Sync for WrappedNativeToken
impl Unpin for WrappedNativeToken
impl !UnwindSafe for WrappedNativeToken
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more