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 ​
| Name | Type | Description |
|---|---|---|
owner | address | Share owner address. |
spender | address | Approved operator address. |
Returns ​
| Type | Description |
|---|---|
uint256 | Remaining 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)
