ELONFLY Honeypot
What happened
ELONFLY is a BNB Smart Chain token whose transferFrom only works for senders on an allow list that contains the deployer alone. A holder who sells through a router has the router pull tokens with transferFrom(holder, ...), which reverts because the holder is not on the list, while plain transfer calls and buys from the pair are unrestricted. The functions that can add holders to the list are guarded by a hard-coded address that is different from the deployer address.
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 mints
totalSupplyto the deployer and whitelists only the deployer:balances[msg.sender] = totalSupply;andallow[msg.sender] = true;. Theallowmapping is false for every other address. transferFromends its checks withrequire(allow[_from] == true);, so any pull of tokens out of a holder's balance reverts unless that holder is on the list.transferhas no such check.- A sell through a DEX router approves the router and then has it call
transferFrom(holder, pair, amount). For an unlisted holder this reverts. A buy moves tokens from the pair to the buyer through the pair's owntransfer, which passes. The deployer is listed, so the deployer'stransferFromcalls, such as the router pulling tokens for a liquidity add, are not blocked. addAllow(address holder, bool allowApprove)can list or unlist any address, andmint(address miner, uint256 _value)overwrites any address's balance withbalances[miner] = _value;without touchingtotalSupply. Both use the modifieronlyOwner, which isrequire(msg.sender == address(1080614020421183795110940285280029773222128095634)), that is address 0xbd486897…439192.- The stored
ownervariable, set to the deployer, is not used byonlyOwner, so the deployer address 0x4fF423D9…aE51d7 cannot calladdAllowormintfrom that address. The code does not show who controls the hard-coded address.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.