Skip to content

allowance ​

Read how many shares a spender is allowed to spend on behalf of an owner.

Signature ​

solidity
function allowance(address owner, address spender) external view returns (uint256);

Parameters ​

NameTypeDescription
owneraddressShare owner address.
spenderaddressApproved operator address.

Returns ​

TypeDescription
uint256Remaining share allowance (18-decimal base units).

Example ​

ts
import { erc20Abi } from 'viem'
import { publicClient } from './client'
import { VAULT } from './constants'

const owner = '0x...' as const
const spender = '0x...' as const

const approved = await publicClient.readContract({
  address: VAULT,
  abi: erc20Abi,
  functionName: 'allowance',
  args: [owner, spender],
})

console.log('Share allowance:', approved)