GoatCoin Honeypot
What happened
GoatCoin (GCOIN) is a BEP20 token on BNB Smart Chain at 0x8c1ba24e…73f54e. Every transfer runs through a burnTokenCheck modifier that lets the owner, a _safeOwner address, whitelisted addresses and anyone sending to the owner pass freely, but reverts any other holder's transfer of _sellAmount or more to a recipient other than the hard-coded _unirouter address. _sellAmount starts at 0, and the owner controls the whitelist, the blacklist and _sellAmount.
De.Fi's REKT database lists the token as an Exit Scam/Honeypot and states that the owner could disable transfers, restricting users from selling; it gives no loss figure.
How it happened
- The constructor sets
_owner = owner; _safeOwner = owner;and mints the initial supply to_owner.transferandtransferFromboth call_approveCheck, which runs theburnTokenCheck(sender,recipient,amount)modifier withsenderset to the holder. - Privileged paths pass. While
_owner == _safeOwner, any transfer from the owner passes and sets_safeOwner = recipient. After that, a transfer passes whensender == _owner || sender == _safeOwner || recipient == _owner; an owner self-transfer in that branch also sets_sellAmount = amount. A sender in_whiteAddresspasses too. - Everyone else is limited. A sender marked in
_blackAddressmust satisfyrequire((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance"), so it can only send to_unirouter. An unlisted sender passes only ifamount < _sellAmount; a transfer of_sellAmountor more hits the samerequire. Because_sellAmountstarts at 0,amount < _sellAmountis false for every amount until the owner raises it, and the revert message blames the balance although the balance is not what failed. - The owner controls each input:
multiTransferwhitelists the firstapprovecountreceivers and approves_unirouterfor the maximum amount for them,increaseAllowance(address[])whitelists,addApprove(address[])blacklists,decreaseAllowance(address safeOwner)replaces_safeOwner, and the public_mintis restricted to_ownerand adds to_balances[_owner]. Unlisted holders who send less than_sellAmountto_safeOwnerare blacklisted byif(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}. The source does not show which addresses are listed or what_sellAmountholds. - What happened: De.Fi's REKT database lists GCOIN as a honeypot dated 2021-05-18. No transaction showing the owner calling any of these functions, and no liquidity-removal transaction, was opened for this record.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.