Skip to main content

StandardErc20 class

Standard ERC20 Token functions

Example

const contract = await sdk.getContract("{{contract_address}}");
await contract.token.transfer(walletAddress, amount);

Constructors

ConstructorModifiersDescription
(constructor)(contractWrapper, storage)Constructs a new instance of the StandardErc20 class

Properties

PropertyModifiersTypeDescription
contractWrapperprotectedContractWrapper<T>
erc20Erc20<T>
storageprotectedThirdwebStorage

Methods

MethodModifiersDescription
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.