Skip to main content

Erc20 class

Standard ERC20 Token functions

Example

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

Constructors

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

Properties

PropertyModifiersTypeDescription
chainIdreadonlynumber
claimConditionsreadonlyimport("./drop-claim-conditions").DropClaimConditions<BaseDropERC20>Configure claim conditions
contractWrapperprotectedContractWrapper<T>
featureName"ERC20"
signaturereadonlyErc20SignatureMintableSignature Minting
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
burn(amount)Burn Tokens
burnFrom(holder, amount)Burn Tokens
claim(amount, options)Claim a certain amount of tokens to the connected Wallet
claimTo(destinationAddress, amount, options)Claim a certain amount of tokens to a specific Wallet
get()Get the token Metadata (name, symbol, etc...)
getMintTransaction(receiver, amount)Construct a mint transaction without executing it. This is useful for estimating the gas cost of a mint transaction, overriding transaction options and having fine grained control over the transaction execution.
mint(amount)Mint Tokens
mintBatchTo(args)Mint Tokens To Many Wallets
mintTo(receiver, amount)Mint Tokens
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 Erc20<T extends TokenERC20 | DropERC20 | BaseERC20 = BaseERC20 | BaseSignatureMintERC20> implements UpdateableNetwork, DetectableFeature

Implements: UpdateableNetwork, DetectableFeature

Remarks

Basic functionality for a ERC20 contract that handles all unit transformation for you.