pub struct Cep18ContractRef { /* private fields */ }Expand description
Cep18 Contract Ref.
Implementations§
Source§impl Cep18ContractRef
impl Cep18ContractRef
Sourcepub fn init(
&mut self,
symbol: String,
name: String,
decimals: u8,
initial_supply: U256,
)
pub fn init( &mut self, symbol: String, name: String, decimals: u8, initial_supply: U256, )
Initializes the contract with the given metadata, initial supply.
Sourcepub fn total_supply(&self) -> U256
pub fn total_supply(&self) -> U256
Returns the total supply of the token.
Sourcepub fn balance_of(&self, address: &Address) -> U256
pub fn balance_of(&self, address: &Address) -> U256
Returns the balance of the given address.
Sourcepub fn allowance(&self, owner: &Address, spender: &Address) -> U256
pub fn allowance(&self, owner: &Address, spender: &Address) -> U256
Returns the amount of tokens the owner has allowed the spender to spend.
Sourcepub fn approve(&mut self, spender: &Address, amount: &U256)
pub fn approve(&mut self, spender: &Address, amount: &U256)
Approves the spender to spend the given amount of tokens on behalf of the caller.
Sourcepub fn decrease_allowance(&mut self, spender: &Address, decr_by: &U256)
pub fn decrease_allowance(&mut self, spender: &Address, decr_by: &U256)
Decreases the allowance of the spender by the given amount.
Sourcepub fn increase_allowance(&mut self, spender: &Address, inc_by: &U256)
pub fn increase_allowance(&mut self, spender: &Address, inc_by: &U256)
Increases the allowance of the spender by the given amount.
Sourcepub fn transfer(&mut self, recipient: &Address, amount: &U256)
pub fn transfer(&mut self, recipient: &Address, amount: &U256)
Transfers tokens from the caller to the recipient.
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 tokens from the owner to the recipient using the spender’s allowance.
Trait Implementations§
Source§impl ContractRef for Cep18ContractRef
impl ContractRef for Cep18ContractRef
Source§impl SchemaErrors for Cep18ContractRef
impl SchemaErrors for Cep18ContractRef
Source§impl SchemaEvents for Cep18ContractRef
impl SchemaEvents for Cep18ContractRef
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 Cep18ContractRef
impl !RefUnwindSafe for Cep18ContractRef
impl !Send for Cep18ContractRef
impl !Sync for Cep18ContractRef
impl Unpin for Cep18ContractRef
impl !UnwindSafe for Cep18ContractRef
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> 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