Dragon.Swap Honeypot
What happened
Dragon.Swap is a BEP-20 token deployed on BNB Chain on 6 May 2021 at 0xeda01f23…7349d0. Its _approve function stores a real allowance only when the approving wallet is the hard-coded deployer address 0xB625ca69…26db70; for every other holder it silently writes an allowance of zero. A DEX sale pulls tokens with transferFrom, which needs an allowance, so buyers could acquire the token but not sell it through a router, while the deployer could.
The trap is written into the code, not switched on by the owner, so the owner being renounced (the on-chain owner is now the zero address) does not remove it. De.Fi's REKT database lists Dragon.Swap as an exit scam/honeypot dated 6 May 2021, with no loss figure.
How it happened
- The constructor mints the whole supply of 6,458,200 tokens (9 decimals) to the deployer, 0xB625ca69…26db70.
_approvechecksif (owner == address(0xB625ca690e3fC4645A36437249f92BD65526db70))and only then stores the requested amount. For anyone else it sets_allowances[owner][spender] = 0and still emits anApprovalevent, so an approval transaction succeeds but grants nothing.- Buying works, because the pool sends tokens with a plain
transfer, which has no allowance check. - Selling through a router calls
transferFrom, which moves the tokens and then subtracts the amount from the caller's allowance withsub(amount, "BEP20: transfer amount exceeds allowance"). With an allowance of zero this reverts, so the whole sale fails for every holder except the deployer. - The deployer's approvals are stored normally, so that address can sell into the pool. The owner also has an uncapped
mint(uint256), but the current total supply equals the constructor amount, and with the owner now the zero address it can no longer be called.
Protocol details
Evidence
- report @Token_Sniffer incident report twitter.com
- transaction Dragon.Swap contract creation transaction bscscan.com
- address Dragon.Swap (BEP20Token) verified source code bscscan.com
- analysis Scam explained: BSC no-approval tokens cryptot3ddybear.gitlab.io
- analysis Sourcify match for 0xeda01f23d3093479ed950c2ad89e9a23f47349d0 on BNB Chain repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.