ElonHODL Token Honeypot
What happened
De.Fi's REKT database lists ElonHODL Token as an Exit Scam/Honeypot on Binance, noting that the contract owner could disable the transfer function, which restricted users in selling their tokens. In the verified source, transfer has no restriction but transferFrom, the call a DEX router uses to pull a holder's tokens, requires allow[_from] == true, and only the deployer is set to true in the constructor. The only function that can set it for others, addAllow, is limited to a hard-coded address that is different from the deployer.
The code shows what the owner can do; it does not show which holders were or were not allowed.
How it happened
- The constructor sets
owner = msg.sender;, gives the deployer the whole supply (balances[msg.sender] = totalSupply;) and setsallow[msg.sender] = true;. No other address is allowed at deployment. - A plain
transferonly checks the balance, so any holder can still send tokens directly to another address:require(balances[msg.sender] >= _value);. transferFromadditionally requiresrequire(allow[_from] == true);. When a holder approves a router and the router pulls their tokens withtransferFrom(holder, pair, amount), the call reverts unlessallow[holder]is true. A holder who was never added keeps the full balance but cannot sell through that path.- Only
addAllow(address holder, bool allowApprove) external onlyOwnerchangesallow. The modifier isonlyOwner() {require(msg.sender == address(1080614020421183795110940285280029773222128095634));_;}: a hard-coded address, not theownervariable. The decimal literal converts to 0xbd486897…439192, which differs from the deployer 0x0DA5E771…56a7E3. ThetransferOwnershipfunction only rewrites the unusedownervariable and does not change who passesonlyOwner. - That same address can also call
mint(address miner, uint256 _value), which executesbalances[miner] = _value;. This overwrites the target's balance with any value, up or down, without changingtotalSupply. - The contract has no function showing who is allowed or blocked at any moment, and no transaction was opened that shows
addAllowormintbeing called. De.Fi's REKT database lists the token as a honeypot where selling was restricted.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.