Class ERC20

Basic representation of an ERC20 compatible contract. If additional functionality is required, this contract can be extended via inheritance

Hierarchy

Constructors

Accessors

  • get address(): string
  • Returns the contract address

    Returns string

  • get contract(): Contract
  • Returns the underlying contract interface

    Returns Contract

Methods

  • Returns the amount which spender is still allowed to withdraw from owner.

    Parameters

    • owner: string
    • spender: string

    Returns Promise<BigNumber>

  • Allows spender to withdraw from your account multiple times, up to the value amount

    Parameters

    • spender: string
    • value: BigNumberish = MaxApproval
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Returns the account balance of another account with address owner.

    Parameters

    • owner: string

    Returns Promise<BigNumber>

  • Returns the balances for each of the provided accounts

    Parameters

    • owners: string[]

    Returns Promise<{
        balance: BigNumber;
        owner: string;
    }[]>

  • Returns an interface allowing for us with the multicall method of a provider

    Parameters

    • name: string
    • Rest ...params: any[]

    Returns ContractCall

  • Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation.

    Returns Promise<number>

  • Returns the name of the token - e.g. "MyToken".

    Returns Promise<string>

  • Protected

    Automatically keeps trying the call unless we get a revert exception

    Type Parameters

    • T

    Parameters

    • func: ((...args) => Promise<T>)
        • (...args): Promise<T>
        • Parameters

          • Rest ...args: any[]

          Returns Promise<T>

    • Rest ...params: any[]

    Returns Promise<T>

  • Returns whether the specified interface is supported by the contract

    Parameters

    • interfaceId: string

    Returns Promise<boolean>

  • Returns the symbol of the token. E.g. “HIX”.

    Returns Promise<string>

  • Return the metadata of the token

    Returns Promise<{
        address: string;
        decimals: number;
        name: string;
        symbol: string;
        totalSupply: BigNumber;
    }>

  • Returns the total token supply

    Returns Promise<BigNumber>

  • Transfers value amount of tokens to address to

    Parameters

    • to: string
    • value: BigNumberish
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Transfers value amount of tokens from address from to address to

    Parameters

    • from: string
    • to: string
    • value: BigNumberish
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>