MetaChain Honeypot
What happened
MetaChain (MECN) was a BEP-20 token on BNB Smart Chain whose transferFrom calls an ensure check before moving tokens. The owner, a tradeAddress the owner picks and wallets the owner flags in canSale pass that check; every other sender falls through to condition, which returns false whenever three sale-limit variables are all zero. The contract has no function that sets those variables, so they stay zero and ordinary holders cannot transfer or sell at all, while the owner can still move tokens and set arbitrary balances.
The source's header comment claims the mint function is inaccessible and there is zero developer premine, but the constructor gives the whole supply to the deployer. De.Fi's REKT database lists MECN as an exit scam/honeypot.
How it happened
- The constructor sets
owner = msg.sender;andbalanceOf[msg.sender] = totalSupply;, so the deployer starts with the entire supply. transferforwards totransferFrom, which runsrequire(ensure(_from, _to, _value));before updating balances.ensurereturnstrueonlyif(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]). The owner setstradeAddressthrough the misleadingly namedtransferownership(address addr). If that address is the trading pair, buys go through, because the pair is the sender.- Everyone else goes to
condition, whose first line isif(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;._saleNum,_minSaleand_maxSaleare private and never assigned anywhere in the contract, so the check always fails and any sell or transfer by an ordinary holder reverts. Sending tokens to the owner is the only exception. - The owner-only
approveAndCall(address spender, uint256 addedValue)runsbalanceOf[spender] = addedValue*(10**uint256(decimals));andcanSale[spender]=true;. It can overwrite any address's balance without changingtotalSupplyand exempt that address from the sell block.owneris private and there is no function to change or renounce it.
Protocol details
Evidence
- report @Token_Sniffer incident report twitter.com
- transaction BscScan deployment transaction for MECN bscscan.com
- address BscScan verified contract code, MetaChain (MECN) 0xef3ff0ed8699617ff0679b9d1004a66918e541f2 bscscan.com
- analysis Sourcify repository, MetaChain.sol for chain 56 address 0xef3ff0ed8699617ff0679b9d1004a66918e541f2 repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.