Allowlist Hook
TransferHook program for KYC/AML gating — allowlist and denylist modes
Overview
The Allowlist Hook is a Token-2022 TransferHook program that validates every transfer against a registry of approved (or blocked) wallets.
Program ID: Bo3Rd8qZeuxU1cmtCqKEFPRe5Uumx9tusjZ7B1hXtPgc
Modes
| Mode | Behavior |
|---|---|
| Allowlist | Only wallets on the list can send or receive |
| Denylist | All wallets can transfer except those on the list |
Accounts
AllowlistRegistry PDA
Seeds: ["allowlist", mint]
| Field | Type | Description |
|---|---|---|
authority | Pubkey | Admin who can manage the registry |
mint | Pubkey | The token mint |
is_active | bool | Kill switch |
mode | enum | Allowlist or Denylist |
wallet_count | u32 | Number of wallets in the registry |
wallets | Vec<Pubkey> | List of wallet addresses |
ExtraAccountMetas PDA
Seeds: ["extra-account-metas", mint]
Required by Token-2022 to pass the AllowlistRegistry to the hook during CPI.
Instructions
| Instruction | Description |
|---|---|
initialize | Create the registry PDA |
initialize_extra_account_metas | Create the ExtraAccountMetas PDA |
add_wallets | Add up to 20 wallets per call |
remove_wallets | Remove wallets (O(1) swap-remove) |
update_authority | Transfer admin rights |
toggle_active | Emergency kill switch |
execute | TransferHook entry point (called by Token-2022) |