Transfer Hook

Token-2022 extension that runs custom program logic on every transfer of a mint, enabling compliance and composability but introducing reentrancy-like and context-validation risks.

A Transfer Hook is a Token-2022 extension that executes custom logic (via a program specified by the mint) on every transfer of that mint. It enables use cases such as transfer allowlists, fees, and compliance checks. Hooks receive additional accounts through an ExtraAccountMetaList; failure to strictly validate PDA derivation and seeds can allow attackers to inject malicious accounts (e.g., a spoofed whitelist) and bypass transfer logic.

If a Transfer Hook triggers a CPI that initiates another transfer of the same mint, it can create a recursion loop—potentially leading to griefing or asset freeze. Auditors must verify hook acyclicity, enforce read-only access on external state where possible, and respect Solana's CPI depth limit (4) for DeFi composability.

Need expert guidance on Transfer Hook?

Our team at Zealynx has deep expertise in blockchain security and DeFi protocols. Whether you need an audit or consultation, we're here to help.

Get a Quote

oog
zealynx

Subscribe to Our Newsletter

Stay updated with our latest security insights and blog posts

© 2024 Zealynx