TrustPad Honeypot
What happened
This TrustPad (TPAD) token on Ethereum routes every transfer through a burnTokenCheck modifier that the owner can tune. Holders that the owner has not whitelisted can only send tokens to the Uniswap V2 router address stored in _unirouter or to _owner; any other recipient reverts with the misleading message "ERC20: transfer amount exceeds balance". The owner can whitelist or blacklist addresses through functions named increaseAllowance and addApprove, and can change _safeOwner through decreaseAllowance.
De.Fi's REKT database lists the token as an Exit Scam/Honeypot, saying the contract owner could disable the transfer function, which restricted users in selling their tokens.
How it happened
- The constructor sets
_owner = msg.sender;and_safeOwner = msg.sender;, and mints 100,000,000 tokens (18 decimals) to the owner._unirouteris hard-coded as 0x7a250d56…F2488D, and_sellAmountstarts at 0. - Both
transferandtransferFromcall_approveCheck, which runs theburnTokenCheck(sender,recipient,amount)modifier. The check is applied to the token's sender (thefromaddress), not tomsg.sender. - While
_owner == _safeOwner, any transfer whose sender is the owner runs_safeOwner = recipient;and then proceeds, so the first owner transfer hands the privileged_safeOwnerrole to its recipient. After that, a transfer passes ifsender == _owner || sender == _safeOwner || recipient == _owner; when the owner sends to itself,_sellAmount = amountis set. - For every other sender: a whitelisted address passes; a blacklisted address must have
recipient == _unirouter; any other address passes only ifamount < _sellAmount, otherwise it must also send to_unirouter. Because_sellAmountis 0 until the owner sets it,amount < _sellAmountis false, so an ordinary holder can only send to the router or to_owner. A sale routed through the router pulls tokens withtransferFrom(holder, pair, amount); its recipient is the pair, not_unirouter, so it reverts for a non-whitelisted holder unless the pair address is_owner, which the code does not show. - Once
_sellAmountis set, a non-whitelisted holder sending a smaller amount to_safeOwneris moved to the blacklist by_blackAddress[sender] = true; _whiteAddress[sender] = false;while that transfer still goes through. - The owner-only setters are named like ERC20 helpers:
increaseAllowance(address[])whitelists and un-blacklists,addApprove(address[])blacklists and un-whitelists,decreaseAllowance(address)sets_safeOwner, andmultiTransferwhitelists its firstapprovecountreceivers and gives them a maximum allowance for_unirouter._mintispublicand owner-only, so the owner can add to its own balance and the total supply. The source has no ownership transfer or renounce function. - Whether purchases from the pair pass depends on whether the pair is
_safeOwneror whitelisted, which the code alone does not show. De.Fi's REKT database lists the token as an Exit Scam/Honeypot.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.