Skip to main content
The SDK’s client.core.authorization.detect(...) returns 'permit' | 'approval' | 'already_approved'. The ERC20.allowance(owner, spender) check shown below only differentiates between 'already_approved' (allowance ≥ amount) and 'approval' (allowance < amount). The 'permit' branch is returned by the SDK only after additional on-chain permit metadata reads succeed (nonces, DOMAIN_SEPARATOR, name, version). Direct-contract callers who only need the approval path can use allowance alone.

Contract Method

allowance(owner, spender)

Returns the amount of tokens the spender is approved to transfer on behalf of the owner.
ParameterTypeDescription
owneraddressThe token holder’s address
spenderaddressThe contract authorized to spend
Returns: uint256 — approved amount in the token’s smallest unit

ABI

[
  {
    "inputs": [
      { "name": "owner", "type": "address" },
      { "name": "spender", "type": "address" }
    ],
    "name": "allowance",
    "outputs": [{ "name": "", "type": "uint256" }],
    "stateMutability": "view",
    "type": "function"
  }
]

Usage

CheckToken contractOwnerSpender
Deposit token approvalDeposit token (e.g., USDC)User’s addressvault.communityCodeDepositorModuleId (DistributorCodeDepositor)
Account share approvalBoringVaultUser’s addressvault.withdrawQueueModuleId (WithdrawQueue)
If the returned allowance is less than the amount you intend to deposit or withdraw, you need to call approve() first. See the Deposits or Withdrawals guides for the full flow. Contract addresses are obtained via Account Discovery.