StandardErc20 class
Standard ERC20 Token functions
Example
const contract = await sdk.getContract("{{contract_address}}");
await contract.token.transfer(walletAddress, amount);
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(contractWrapper, storage, chainId) | Constructs a new instance of the StandardErc20 class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| chainId | readonly | number | |
| contractWrapper | protected | ContractWrapper<T> | |
| erc20 | Erc20<T> | ||
| storage | protected | ThirdwebStorage |
Methods
| Method | Modifiers | Description |
|---|---|---|
| allowance(spender) | Get Token Allowance | |
| allowanceOf(owner, spender) | Get Token Allowance | |
| balance() | Get Token Balance for the currently connected wallet | |
| balanceOf(address) | Get Token Balance | |
| get() | Get the token Metadata (name, symbol, etc...) | |
| setAllowance(spender, amount) | Allows the specified spender wallet to transfer the given amount of tokens to another wallet | |
| totalSupply() | The total supply for this Token | |
| transfer(to, amount) | Transfer Tokens | |
| transferBatch(args) | Transfer Tokens To Many Wallets | |
| transferFrom(from, to, amount) | Transfer Tokens From Address |
Signature:
export declare class StandardErc20<T extends TokenERC20 | DropERC20 | BaseERC20 = BaseERC20 | BaseSignatureMintERC20> implements UpdateableNetwork
Implements: UpdateableNetwork
Remarks
Basic functionality for a ERC20 contract that handles all unit transformation for you.