Interface that represents a smart contract, which implements EIP20

interface ERC20 {
    allowance(owner: string, spender: string): Promise<bigint>;
    approve(spender: string, amount: bigint): Promise<Transaction>;
    balanceOf(account: string): Promise<bigint>;
    decimals(): Promise<number>;
    decreaseAllowance(spender: string, amount: bigint): Promise<Transaction>;
    increaseAllowance(spender: string, amount: bigint): Promise<Transaction>;
    name(): Promise<string>;
    symbol(): Promise<string>;
    totalSupply(): Promise<bigint>;
    transfer(recipient: string, amount: bigint): Promise<Transaction>;
    transferFrom(sender: string, recipient: string, amount: bigint): Promise<Transaction>;
}

Hierarchy (view full)

Methods

  • Atomically decreases the allowance granted to spender by the caller.

    This is an alternative to approve that can be used as a mitigation for problems described in approve.

    Emits an Approval event indicating the updated allowance.

    Requirements:

    • spender cannot be the zero address.
    • spender must have allowance for the caller of at least amount.

    Parameters

    • spender: string
    • amount: bigint

    Returns Promise<Transaction>

  • Atomically increases the allowance granted to spender by the caller.

    This is an alternative to approve that can be used as a mitigation for problems described in approve.

    Emits an Approval event indicating the updated allowance.

    Requirements:

    • spender cannot be the zero address.

    Parameters

    • spender: string
    • amount: bigint

    Returns Promise<Transaction>