NyanCat Honeypot
What happened
NyanCat (NyanCat) is a BEP-20 token on BNB Smart Chain at 0xe684bb37…09fb62. 0x912e16d7…49701b deployed it on 3 May 2021 and received the whole 1,000,000,000,000 NyanCat supply. The first transferFrom from a non-zero address records its recipient in a variable named newun.
When the owner adds PancakeSwap liquidity, that recipient is normally the liquidity pool. After that, every transfer or transferFrom whose recipient is newun reverts with "please wait". Buys, where the pool sends tokens out, still work, but holders cannot sell into the pool.
The owner can repoint newun at any address with transfernewun. This is the stealthy liquidity-pool block that the blogger cryptot3ddybear described on 11 April 2021 for other BSC tokens using the same code.
How it happened
- The constructor credits the whole supply to the deployer:
balances[owner] = _totalSupply;. transferFrombegins withif(from != address(0) && newun == address(0)) newun = to;. Whilenewunis unset, the firsttransferFromfrom a real address stores its recipient. When the owner adds liquidity through the PancakeSwap router, the router pulls tokens withtransferFrominto the pair, so the pair becomesnewun.- Every later
transferFromrunselse require(to != newun, "please wait");, andtransferrunsrequire(to != newun, "please wait");. Router sells move tokens to the pair withtransferFrom, and direct sends to the pair usetransfer, so both revert. - Transfers out of the pair are not checked, so buyers can keep buying while the pool fills with BNB they cannot get back by selling.
transfernewun(address _newun) public onlyOwnerlets the owner change the blocked address at any time. Removing liquidity does not send tokens to the pair, so whoever holds the LP tokens can still withdraw the pool's BNB.
Protocol details
Evidence
- report Token Sniffer tweet 1381346761566916614 twitter.com
- transaction NyanCat contract creation transaction bscscan.com
- address NyanCat verified source code bscscan.com
- analysis BSC-SCAM: Stealthy Liquidity Pool Block on PancakeSwap cryptot3ddybear.gitlab.io
- analysis Sourcify match for 0xe684bb37dd4f4ab28e3cef31be7d0a135e09fb62 on BNB Smart Chain repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.