earn.validateExitSafePolicy
Verifies that an Earn vault share token uses an expected exit-safe TIP-403 policy and that every required member can receive transfers and mints.
The action throws when the token policy, compound components, whitelist administrator, or member authorization does not match the expected configuration.
Usage
import { client } from './viem.config'
await client.earn.validateExitSafePolicy({
accessAdministrator: '0x0000000000000000000000000000000000000002',
policy: {
transferPolicyId: 3n,
senderPolicyId: 1n,
recipientPolicyId: 2n,
mintRecipientPolicyId: 2n,
},
requiredMembers: [
'0x0000000000000000000000000000000000000003',
'0x0000000000000000000000000000000000000004',
],
shareToken: '0x20c0000000000000000000000000000000000001',
})import { Account, createClient } from 'viem/tempo'
export const client = createClient({
account: Account.fromSecp256k1('0x...'),
})Return Value
void
Parameters
accessAdministrator
- Type:
Address
Expected whitelist administrator.
policy
- Type:
ExitSafePolicy
Expected compound and component policy IDs. The sender policy must be the always-allow policy, and the recipient and mint-recipient policy IDs must match.
requiredMembers
- Type:
readonly Address[]
Addresses that must be authorized as recipients and mint recipients.
shareToken
- Type:
Address
Earn vault share token expected to use the compound transfer policy.
blockNumber (optional)
- Type:
bigint
Block number to read the state from.
blockOverrides (optional)
- Type:
BlockOverrides
Block overrides to apply to the state.
blockTag (optional)
- Type:
BlockTag
Block tag to read the state from.
stateOverride (optional)
- Type:
StateOverride
State override to apply.