Quantum Tunneling Honeypot
What happened
De.Fi's REKT database lists Quantum Tunneling (QTUN) as an Exit Scam/Honeypot on BNB Smart Chain and says the owner could disable the transfer function, restricting users from selling. The verified code is a standard BEP-20 token with one change in _approve: only the deployer's address keeps the allowance it sets, and every other account's allowance is written as zero. A sell through a router needs an allowance, so any non-deployer holder's transferFrom for a non-zero amount reverts while plain transfers still work.
How it happened
- The constructor mints the full supply to the deployer:
_balances[msg.sender] = _totalSupply;, andOwnablemakes the deployer the owner. approvecalls_approve(_msgSender(), spender, amount). Inside_approve, the allowance is stored only when the caller is a hard-coded address:if (owner == address(0x2695D4F968fFf6b6e12731066A2A255Ca29C2467)) {. That address is the deployer and the owner reported on chain.- For every other account the else branch runs:
_allowances[owner][spender] = 0;followed byemit Approval(owner, spender, 4);. The event reports an amount of 4 while the stored allowance is zero. transferFrommoves the tokens first and then reduces the allowance:_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "BEP20: transfer amount exceeds allowance"));. For a non-deployer holder the stored allowance is 0, sosubreverts for any amount above zero and the whole call fails. A router-based sell therefore cannot succeed for ordinary holders.transfercalls_transferdirectly with no allowance check, so tokens can still be sent out by plain transfer, for example from a pool to a buyer.- The owner can also call
mint(uint256 amount), which isonlyOwnerand adds to the owner's balance and the total supply.renounceOwnershipexists but the hard-coded address in_approvedoes not depend on it.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.