Class ERC777

Basic representation of an ERC777 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>

  • Set a third party operator address as an operator of msg.sender to send and burn tokens on its behalf.

    Parameters

    • operator: string
    • 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;
    }[]>

  • Burn the amount of tokens from the address msg.sender.

    Parameters

    • amount: BigNumberish
    • data: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

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

  • Get the list of default operators as defined by the token contract.

    Returns Promise<string[]>

  • Get the smallest part of the token that’s not divisible.

    In other words, the granularity is the smallest amount of tokens (in the internal denomination) which MAY be minted, sent or burned at any time.

    Returns Promise<BigNumber>

  • Indicate whether the operator address is an operator of the holder address.

    Parameters

    • operator: string
    • holder: string

    Returns Promise<boolean>

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

    Returns Promise<string>

  • Burn the amount of tokens on behalf of the address from.

    Parameters

    • from: string
    • amount: BigNumberish
    • data: string
    • operatorData: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Send the amount of tokens on behalf of the address from to the address to.

    Reminder: If the operator address is not an authorized operator of the from address, then the send process MUST revert.

    Parameters

    • from: string
    • to: string
    • amount: BigNumberish
    • data: string
    • operatorData: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

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

  • Remove the right of the operator address to be an operator for msg.sender and to send and burn tokens on its behalf.

    Parameters

    • operator: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

  • Send the amount of tokens from the address msg.sender to the address to.

    Parameters

    • to: string
    • amount: BigNumberish
    • data: string
    • overrides: CallOverrides = {}

    Returns Promise<ContractTransaction>

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