Interface Erc20Interface

interface Erc20Interface {
    #private: any;
    deploy: ConstructorFragment;
    fallback: null | FallbackFragment;
    fragments: readonly Fragment[];
    receive: boolean;
    _decodeParams(params, data): Result;
    _encodeParams(params, values): string;
    decodeErrorResult(fragment, data): Result;
    decodeEventLog(fragment, data, topics?): Result;
    decodeFunctionData(fragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    decodeFunctionResult(functionFragment, data): Result;
    encodeDeploy(values?): string;
    encodeErrorResult(fragment, values?): string;
    encodeEventLog(fragment, values): {
        data: string;
        topics: string[];
    };
    encodeFilterTopics(fragment, values): (null | string | string[])[];
    encodeFunctionData(functionFragment, values): string;
    encodeFunctionData(functionFragment, values): string;
    encodeFunctionData(functionFragment, values): string;
    encodeFunctionData(functionFragment, values): string;
    encodeFunctionData(functionFragment, values?): string;
    encodeFunctionData(functionFragment, values): string;
    encodeFunctionData(functionFragment, values): string;
    encodeFunctionData(functionFragment, values?): string;
    encodeFunctionData(functionFragment, values?): string;
    encodeFunctionData(functionFragment, values?): string;
    encodeFunctionData(functionFragment, values): string;
    encodeFunctionData(functionFragment, values): string;
    encodeFunctionResult(fragment, values?): string;
    forEachError(callback): void;
    forEachEvent(callback): void;
    forEachFunction(callback): void;
    format(minimal?): string[];
    formatJson(): string;
    getAbiCoder(): AbiCoder;
    getError(key, values?): null | ErrorFragment;
    getEvent(nameOrSignatureOrTopic): EventFragment;
    getEventName(key): string;
    getFunction(nameOrSignature): FunctionFragment;
    getFunctionName(key): string;
    hasEvent(key): boolean;
    hasFunction(key): boolean;
    makeError(_data, tx): CallExceptionError;
    parseCallResult(data): Result;
    parseError(data): null | ErrorDescription;
    parseLog(log): null | LogDescription;
    parseTransaction(tx): null | TransactionDescription;
}

Hierarchy

  • Interface
    • Erc20Interface

Properties

#private: any
deploy: ConstructorFragment

The Contract constructor.

fallback: null | FallbackFragment

The Fallback method, if any.

fragments: readonly Fragment[]

All the Contract ABI members (i.e. methods, events, errors, etc).

receive: boolean

If receiving ether is supported.

Methods

  • Parameters

    • params: readonly ParamType[]
    • data: BytesLike

    Returns Result

  • Parameters

    • params: readonly ParamType[]
    • values: readonly any[]

    Returns string

  • Decodes the result %%data%% (e.g. from an eth_call) for the specified error (see [[getError]] for valid values for %%key%%).

    Most developers should prefer the [[parseCallResult]] method instead, which will automatically detect a CALL_EXCEPTION and throw the corresponding error.

    Parameters

    • fragment: string | ErrorFragment
    • data: BytesLike

    Returns Result

  • Parameters

    • fragment: string | EventFragment
    • data: BytesLike
    • Optional topics: readonly string[]

    Returns Result

  • Decodes the %%data%% from a transaction tx.data for the function specified (see [[getFunction]] for valid values for %%fragment%%).

    Most developers should prefer the [[parseTransaction]] method instead, which will automatically detect the fragment.

    Parameters

    • fragment: string | FunctionFragment
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "allowance"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "approve"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "balanceOf"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "burn"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "decimals"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "decreaseAllowance"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "increaseAllowance"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "name"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "symbol"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "totalSupply"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "transfer"
    • data: BytesLike

    Returns Result

  • Parameters

    • functionFragment: "transferFrom"
    • data: BytesLike

    Returns Result

  • Encodes a tx.data object for deploying the Contract with the %%values%% as the constructor arguments.

    Parameters

    • Optional values: readonly any[]

    Returns string

  • Encodes the transaction revert data for a call result that reverted from the the Contract with the sepcified %%error%% (see [[getError]] for valid values for %%fragment%%) with the %%values%%.

    This is generally not used by most developers, unless trying to mock a result from a Contract.

    Parameters

    • fragment: string | ErrorFragment
    • Optional values: readonly any[]

    Returns string

  • Parameters

    • fragment: string | EventFragment
    • values: readonly any[]

    Returns {
        data: string;
        topics: string[];
    }

    • data: string
    • topics: string[]
  • Parameters

    • fragment: string | EventFragment
    • values: readonly any[]

    Returns (null | string | string[])[]

  • Parameters

    • functionFragment: "allowance"
    • values: [AddressLike, AddressLike]

    Returns string

  • Parameters

    • functionFragment: "approve"
    • values: [AddressLike, BigNumberish]

    Returns string

  • Parameters

    • functionFragment: "balanceOf"
    • values: [AddressLike]

    Returns string

  • Parameters

    • functionFragment: "burn"
    • values: [BigNumberish]

    Returns string

  • Parameters

    • functionFragment: "decimals"
    • Optional values: undefined

    Returns string

  • Parameters

    • functionFragment: "decreaseAllowance"
    • values: [AddressLike, BigNumberish]

    Returns string

  • Parameters

    • functionFragment: "increaseAllowance"
    • values: [AddressLike, BigNumberish]

    Returns string

  • Parameters

    • functionFragment: "name"
    • Optional values: undefined

    Returns string

  • Parameters

    • functionFragment: "symbol"
    • Optional values: undefined

    Returns string

  • Parameters

    • functionFragment: "totalSupply"
    • Optional values: undefined

    Returns string

  • Parameters

    • functionFragment: "transfer"
    • values: [AddressLike, BigNumberish]

    Returns string

  • Parameters

    • functionFragment: "transferFrom"
    • values: [AddressLike, AddressLike, BigNumberish]

    Returns string

  • Encodes the result data (e.g. from an eth_call) for the specified function (see [[getFunction]] for valid values for %%fragment%%) with %%values%%.

    This is generally not used by most developers, unless trying to mock a result from a Contract.

    Parameters

    • fragment: string | FunctionFragment
    • Optional values: readonly any[]

    Returns string

  • Iterate over all errors, calling %%callback%%, sorted by their name.

    Parameters

    • callback: ((func, index) => void)
        • (func, index): void
        • Parameters

          • func: ErrorFragment
          • index: number

          Returns void

    Returns void

  • Iterate over all events, calling %%callback%%, sorted by their name.

    Parameters

    • callback: ((func, index) => void)
        • (func, index): void
        • Parameters

          • func: EventFragment
          • index: number

          Returns void

    Returns void

  • Iterate over all functions, calling %%callback%%, sorted by their name.

    Parameters

    • callback: ((func, index) => void)
        • (func, index): void
        • Parameters

          • func: FunctionFragment
          • index: number

          Returns void

    Returns void

  • Returns the entire Human-Readable ABI, as an array of signatures, optionally as %%minimal%% strings, which removes parameter names and unneceesary spaces.

    Parameters

    • Optional minimal: boolean

    Returns string[]

  • Return the JSON-encoded ABI. This is the format Solidiy returns.

    Returns string

  • The ABI coder that will be used to encode and decode binary data.

    Returns AbiCoder

  • Get the [[ErrorFragment]] for %%key%%, which may be an error selector, error name or error signature that belongs to the ABI.

    If %%values%% is provided, it will use the Typed API to handle ambiguous cases where multiple errors match by name.

    If the %%key%% and %%values%% do not refine to a single error in the ABI, this will throw.

    Parameters

    • key: string
    • Optional values: any[]

    Returns null | ErrorFragment

  • Parameters

    • nameOrSignatureOrTopic: "Approval" | "Transfer"

    Returns EventFragment

  • Get the event name for %%key%%, which may be a topic hash, event name or event signature that belongs to the ABI.

    Parameters

    • key: string

    Returns string

  • Parameters

    • nameOrSignature: "symbol" | "allowance" | "approve" | "balanceOf" | "decimals" | "name" | "totalSupply" | "transfer" | "transferFrom" | "burn" | "decreaseAllowance" | "increaseAllowance"

    Returns FunctionFragment

  • Get the function name for %%key%%, which may be a function selector, function name or function signature that belongs to the ABI.

    Parameters

    • key: string

    Returns string

  • Returns true if %%key%% (an event topic hash, event name or event signature) is present in the ABI.

    In the case of an event name, the name may be ambiguous, so accessing the [[EventFragment]] may require refinement.

    Parameters

    • key: string

    Returns boolean

  • Returns true if %%key%% (a function selector, function name or function signature) is present in the ABI.

    In the case of a function name, the name may be ambiguous, so accessing the [[FunctionFragment]] may require refinement.

    Parameters

    • key: string

    Returns boolean

  • Parameters

    • _data: BytesLike
    • tx: CallExceptionTransaction

    Returns CallExceptionError

  • Parameters

    • data: BytesLike

    Returns Result

  • Parses a revert data, finding the matching error and extracts the parameter values along with other useful error details.

    If the matching error cannot be found, returns null.

    Parameters

    • data: BytesLike

    Returns null | ErrorDescription

  • Parses a receipt log, finding the matching event and extracts the parameter values along with other useful event details.

    If the matching event cannot be found, returns null.

    Parameters

    • log: {
          data: string;
          topics: readonly string[];
      }
      • data: string
      • topics: readonly string[]

    Returns null | LogDescription

  • Parses a transaction, finding the matching function and extracts the parameter values along with other useful function details.

    If the matching function cannot be found, return null.

    Parameters

    • tx: {
          data: string;
          value?: BigNumberish;
      }
      • data: string
      • Optional value?: BigNumberish

    Returns null | TransactionDescription