Trait ERC20
Source pub trait ERC20<Storage: ContractStorage>: ContractContext<Storage> {
Show 20 methods
// Provided methods
fn init(
&self,
contract_hash: ContractHash,
package_hash: ContractPackageHash,
) { ... }
fn set_balance(&self, owner: Address, amount: U256) { ... }
fn set_allowance(&self, owner: Address, spender: Address, amount: U256) { ... }
fn set_total_supply(&self, total_supply: U256) { ... }
fn name(&self) -> String { ... }
fn set_name(&self, name: String) { ... }
fn symbol(&self) -> String { ... }
fn set_symbol(&self, symbol: String) { ... }
fn decimals(&self) -> u8 { ... }
fn total_supply(&self) -> U256 { ... }
fn balance_of(&self, owner: Address) -> U256 { ... }
fn allowance(&self, owner: Address, spender: Address) -> U256 { ... }
fn increase_allowance(
&self,
spender: Address,
amount: U256,
) -> Result<(), Error> { ... }
fn decrease_allowance(
&self,
spender: Address,
amount: U256,
) -> Result<(), Error> { ... }
fn transfer(&self, recipient: Address, amount: U256) -> Result<(), Error> { ... }
fn approve(&self, spender: Address, amount: U256) -> Result<(), Error> { ... }
fn transfer_from(
&self,
owner: Address,
recipient: Address,
amount: U256,
) -> Result<(), Error> { ... }
fn mint(&self, recipient: Address, amount: U256) -> Result<(), Error> { ... }
fn burn(&self, recipient: Address, amount: U256) -> Result<(), Error> { ... }
fn named_keys(
&self,
name: String,
symbol: String,
decimals: u8,
initial_supply: U256,
) -> Result<BTreeMap<String, Key>, Error> { ... }
}