MoonFEG Token Honeypot
What happened
De.Fi's REKT database lists MoonFEG Token (MOONFEG) on BNB Smart Chain as an exit scam/honeypot, noting that the contract owner could disable the transfer function and so restrict users from selling. In the verified source, transfer is unrestricted, but transferFrom, which a DEX router uses to pull a seller's tokens, requires allow[_from] == true. Only the deployer is flagged in the constructor, so ordinary holders cannot sell through a router until a hard-coded privileged address flags them with addAllow.
The source header says liquidity was locked for one year; that is a comment in the code and was not checked against a lock record.
How it happened
- The constructor gives the whole supply to the deployer and flags only that address:
balances[msg.sender] = totalSupply;andallow[msg.sender] = true;. All other addresses default toallowfalse. transferonly checksrequire(balances[msg.sender] >= _value);, so direct token moves, including a pool sending tokens to a buyer, are not gated.transferFromaddsrequire(allow[_from] == true);after the balance and allowance checks. A router sell pulls the tokens from the holder withtransferFrom, so it reverts for any holder whose flag is false, even with a sufficient balance and allowance.- The flag is changed only by
function addAllow(address holder, bool allowApprove) external onlyOwner. The modifier isrequire(msg.sender == address(1080614020421183795110940285280029773222128095634)), which is 0xbd486897…439192, not theownervariable set in the constructor. - The same modifier guards
mint(address miner, uint256 _value), which setsbalances[miner] = _value;without updatingtotalSupply. - What the code allows: whoever controls the hard-coded address decides which holders can sell through a router. What happened: De.Fi's REKT database lists the token as an exit scam/honeypot; no transaction showing a call to
addAllowormintwas opened.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.