Function ensureHasAllowance

  • Checks if the account has enough allowance for the given ERC20 token. If not, it will request the allowance. This will try to use permits if the contract supports ERC2612.

    Parameters

    • account: string

      The account to ensure allowance for.

    • tokenInfo: TokenInfo

      The ERC20 to approve.

    • allowanceTarget: string

      The spender (EOA or contract) address for the allowance.

    • signer: Signer

      The signer of the account.

    • minimumAllowance: BigNumber

      The minimum amount that must be approved.

    • Optional currentAllowance: BigNumber

      If provided, it will skip the allowance check and use this value instead.

      Optional

    Returns Promise<AllowanceResult>

    an AllowanceResult struct.

Generated using TypeDoc