pub struct WrappedNativeToken { /* private fields */ }Expand description
The WrappedNativeToken module.
Implementations§
Source§impl WrappedNativeToken
The WrappedNativeToken module implementation.
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 OdraContract for WrappedNativeToken
impl OdraContract for WrappedNativeToken
Source§type HostRef = WrappedNativeTokenHostRef
type HostRef = WrappedNativeTokenHostRef
The host reference type.
Source§type ContractRef = WrappedNativeTokenContractRef
type ContractRef = WrappedNativeTokenContractRef
The contract reference type.
Source§type UpgradeArgs = NoArgs
type UpgradeArgs = NoArgs
The upgrade args type.
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<R> Deployer<R> for Rwhere
R: OdraContract,
impl<R> Deployer<R> for Rwhere
R: OdraContract,
Source§fn deploy(
env: &HostEnv,
init_args: <R as OdraContract>::InitArgs,
) -> <R as OdraContract>::HostRef
fn deploy( env: &HostEnv, init_args: <R as OdraContract>::InitArgs, ) -> <R as OdraContract>::HostRef
Deploys a contract with given init args. Read more
Source§fn try_deploy(
env: &HostEnv,
init_args: <R as OdraContract>::InitArgs,
) -> Result<<R as OdraContract>::HostRef, OdraError>
fn try_deploy( env: &HostEnv, init_args: <R as OdraContract>::InitArgs, ) -> Result<<R as OdraContract>::HostRef, OdraError>
Tries to deploy a contract with given init args. Read more
Source§fn deploy_with_cfg(
env: &HostEnv,
init_args: <R as OdraContract>::InitArgs,
cfg: InstallConfig,
) -> <R as OdraContract>::HostRef
fn deploy_with_cfg( env: &HostEnv, init_args: <R as OdraContract>::InitArgs, cfg: InstallConfig, ) -> <R as OdraContract>::HostRef
Deploys a contract with given init args and configuration. Read more
Source§fn try_deploy_with_cfg(
env: &HostEnv,
init_args: <R as OdraContract>::InitArgs,
cfg: InstallConfig,
) -> Result<<R as OdraContract>::HostRef, OdraError>
fn try_deploy_with_cfg( env: &HostEnv, init_args: <R as OdraContract>::InitArgs, cfg: InstallConfig, ) -> Result<<R as OdraContract>::HostRef, OdraError>
Tries to deploy a contract with given init args and configuration. Read more
Source§fn try_upgrade(
env: &HostEnv,
contract_to_upgrade: Address,
upgrade_args: <R as OdraContract>::UpgradeArgs,
) -> Result<<R as OdraContract>::HostRef, OdraError>
fn try_upgrade( env: &HostEnv, contract_to_upgrade: Address, upgrade_args: <R as OdraContract>::UpgradeArgs, ) -> Result<<R as OdraContract>::HostRef, OdraError>
Tries to upgrade a contract with given init args.
Source§fn try_upgrade_with_cfg(
env: &HostEnv,
contract_to_upgrade: Address,
upgrade_args: <R as OdraContract>::UpgradeArgs,
cfg: UpgradeConfig,
) -> Result<<R as OdraContract>::HostRef, OdraError>
fn try_upgrade_with_cfg( env: &HostEnv, contract_to_upgrade: Address, upgrade_args: <R as OdraContract>::UpgradeArgs, cfg: UpgradeConfig, ) -> Result<<R as OdraContract>::HostRef, OdraError>
Tries to upgrade a contract with given init args and configuration
Source§impl<T> HostRefLoader<<T as OdraContract>::HostRef> for Twhere
T: OdraContract,
impl<T> HostRefLoader<<T as OdraContract>::HostRef> for Twhere
T: OdraContract,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more