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
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.source§impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
source§impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
source§impl<T> PipeDeref for T
impl<T> PipeDeref for T
source§impl<T> PipeRef for T
impl<T> PipeRef for T
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_dbg<F, R>(self, func: F) -> Self
fn tap_dbg<F, R>(self, func: F) -> Self
Calls
tap in debug builds, and does nothing in release builds.source§fn tap_mut_dbg<F, R>(self, func: F) -> Self
fn tap_mut_dbg<F, R>(self, func: F) -> Self
Calls
tap_mut in debug builds, and does nothing in release builds.source§impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
source§fn tap_ref<F, R>(self, func: F) -> Self
fn tap_ref<F, R>(self, func: F) -> Self
Provides immutable access to the reference for inspection.
source§fn tap_ref_dbg<F, R>(self, func: F) -> Self
fn tap_ref_dbg<F, R>(self, func: F) -> Self
Calls
tap_ref in debug builds, and does nothing in release builds.source§fn tap_ref_mut<F, R>(self, func: F) -> Self
fn tap_ref_mut<F, R>(self, func: F) -> Self
Provides mutable access to the reference for modification.
source§impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
source§fn tap_borrow<F, R>(self, func: F) -> Self
fn tap_borrow<F, R>(self, func: F) -> Self
Provides immutable access to the borrow for inspection. Read more
source§fn tap_borrow_dbg<F, R>(self, func: F) -> Self
fn tap_borrow_dbg<F, R>(self, func: F) -> Self
Calls
tap_borrow in debug builds, and does nothing in release builds.source§fn tap_borrow_mut<F, R>(self, func: F) -> Self
fn tap_borrow_mut<F, R>(self, func: F) -> Self
Provides mutable access to the borrow for modification.
source§impl<T> TapDeref for T
impl<T> TapDeref for T
source§fn tap_deref_dbg<F, R>(self, func: F) -> Self
fn tap_deref_dbg<F, R>(self, func: F) -> Self
Calls
tap_deref in debug builds, and does nothing in release builds.source§fn tap_deref_mut<F, R>(self, func: F) -> Self
fn tap_deref_mut<F, R>(self, func: F) -> Self
Mutably dereferences
self for modification.