Home What is Rug Pull? Scan History Pricing Blog API
Back to Blog Honeypot Logic on Solana: The Danger of Custom Transfer Hooks Guide

Honeypot Logic on Solana: The Danger of Custom Transfer Hooks

October 23, 2026  ·  RugPullShield
You can buy the token, but every sell transaction fails with an on-chain error. Learn how scammers weaponize Token-2022 Transfer Hooks to create honeypots on Solana.

The EVM Nightmare Comes to Solana

For years, Solana traders enjoyed a significant safety advantage over Ethereum and BNB Chain: the SPL token standard was rigid and unalterable. Because standard SPL contracts lacked custom execution logic, malicious developers could not easily code EVM-style "honeypots" where users can buy tokens but are permanently blocked from selling them.

That paradigm shifted dramatically with the rollout of the Token-2022 program. While extensions unlock revolutionary DeFi features, they also introduced the Transfer Hook Extension, opening the door for genuine honeypot logic on Solana.

How Transfer Hook Honeypots Function

A Transfer Hook is an on-chain instruction that forces the Solana runtime to call an external custom program whenever tokens move between accounts. When weaponized by bad actors, the hook acts as an arbitrary gatekeeper:

  1. The External Program: The developer writes a custom Anchor smart contract and links it to the token mint via the Transfer Hook extension.
  2. Conditional Execution: Inside the external program, the developer codes a simple conditional check. If the destination address is a known Raydium liquidity pool (indicating a sell swap), the program verifies whether the seller's wallet is on a private whitelist stored in a Program Derived Address (PDA).
  3. The Trapped Trader: Anyone can buy the token because incoming transfers pass without restriction. The chart prints endless green candles as buy volume rolls in. However, when a retail buyer attempts to swap tokens back into SOL, the external program reverts the transaction with a custom error code.
  4. The Creator Exit: Only the developer's whitelisted wallets retain permission to sell, allowing them to extract 100% of the pool's SOL at the peak of the artificial pump.

Why Static Code Scanners Fail

Basic token audit tools inspect only the core mint account. If the Mint Authority is revoked and Freeze Authority is disabled, basic scanners assign a perfect safety score. They completely fail to audit the external program invoked by the transfer hook.

Traders see a green checkmark, unaware that an external program holds the absolute power to veto their sell orders.

Dynamic Simulation with RugPullShield

Catching transfer hook honeypots requires active transaction simulation rather than passive flag inspection. RugPullShield runs state-of-the-art behavioral testing.

When our engine encounters a token utilizing transfer hooks, it simulates both buy and sell transactions on a private Solana test fork using unprivileged dummy wallets. If the sell simulation reverts or detects custom blacklist logic, RugPullShield flags the token with an immediate critical honeypot alert, ensuring you never invest in a one-way trap.