SINAI STANDARD

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

ModeBehavior
AllowlistOnly wallets on the list can send or receive
DenylistAll wallets can transfer except those on the list

Accounts

AllowlistRegistry PDA

Seeds: ["allowlist", mint]

FieldTypeDescription
authorityPubkeyAdmin who can manage the registry
mintPubkeyThe token mint
is_activeboolKill switch
modeenumAllowlist or Denylist
wallet_countu32Number of wallets in the registry
walletsVec<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

InstructionDescription
initializeCreate the registry PDA
initialize_extra_account_metasCreate the ExtraAccountMetas PDA
add_walletsAdd up to 20 wallets per call
remove_walletsRemove wallets (O(1) swap-remove)
update_authorityTransfer admin rights
toggle_activeEmergency kill switch
executeTransferHook entry point (called by Token-2022)

On this page