Skip to main content

Erc20 class

Standard ERC20 Token functions

Example

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

Constructors

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

Properties

PropertyModifiersTypeDescription
burnErc20Burnable | undefined
contractWrapperContractWrapper<T>
dropErc20Droppable | undefined
featureName"ERC20"
mintErc20Mintable | undefinedMint tokens
optionsSDKOptions
signatureErc20SignatureMintable | undefined
storageIStorage

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