One SG Honeypot
What happened
One SG (1SG) is a BNB Smart Chain token whose transfer and transferFrom refuse any transfer to a stored address called newun. The first transferFrom call made while newun is empty stores that call's recipient as newun, which is the pattern a liquidity add through a router produces, and after that no token can be sent to it. If that address is the trading pair, sells fail with "please wait" while buys, which move tokens out of the pair, are not checked.
De.Fi's REKT database lists the token as an Exit Scam/Honeypot dated 2021-03-28 and states that the contract owner could disable the transfer function, which restricted users in selling their tokens.
How it happened
- The constructor sets
symbol = "1SG",name = "One SG"and mints the full_totalSupplyof 20,000,000 tokens (18 decimals) toowner, the deployer. transferFrombegins withif(from != address(0) && newun == address(0)) newun = to;. Whilenewunis still empty, the firsttransferFromwhosefromis non-zero stores its recipient innewunand skips any check. A router-based liquidity add callstransferFromwith the pair asto, so the pair would be stored. The code does not name the pair, so this is how the code behaves, not proof of which address was stored.- Every later
transferFromtakes theelsebranch,else require(to != newun, "please wait");, andtransferhasrequire(to != newun, "please wait");. Any transfer whose recipient isnewunreverts. - A holder selling through the router makes the router call
transferFrom(holder, pair, tokens). Ifnewunis the pair,to == newunand the sell reverts. A buy sends tokens from the pair to the buyer withtoset to the buyer, which passes. - The owner can call
transfernewun(address _newun)at any time to changenewun. Setting it to the zero address lets the nexttransferFromcapture a new recipient; pointing it at an address that never receives tokens lifts the block.clearCNDAO()also lets the owner send the contract's own BNB balance to themselves; it does not touch token balances.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.