Patrigio Honeypot
What happened
Patrigio (PTG) is a BEP-20 token on BNB Smart Chain whose Ownable base contract contains a transfer lock. While ownerLock is true, the first transferFrom records its recipient as _firstOwner, and from then on every transfer to that address reverts with "Order Is Pending.", whoever the sender is. Only the owner can switch the lock off.
De.Fi's REKT database lists PTG as an exit scam / honeypot dated 2021-05-14 and describes the owner as able to disable transfers so holders cannot sell; it gives no loss figure.
How it happened
- The
Ownableconstructor setsownerLock = true, and thePatrigioconstructor mints the whole supply to the deployer. transfercalls_transfer(_msgSender(), recipient, amount, true)andtransferFromcalls_transfer(sender, recipient, amount, false). Both run thetransferMiddlewaremodifier.- With the lock on, the first call that is a
transferFromwith a non-zero sender takes the branchif(from != address(0) && _firstOwner == address(0) && !handler) _firstOwner = to;and succeeds, storing its recipient as_firstOwner. The code does not say who that recipient is. - Every later call, from any sender including the owner, hits
else require(to != _firstOwner, "Order Is Pending.");. A transfer to_firstOwnerreverts before_balances[sender]is debited. Transfers to other addresses are unaffected. If_firstOwneris a liquidity pool, then selling into it reverts; the source does not show that it is. _firstOwnerhas no setter, so it cannot be changed once stored. The only release issetOwnerLock(bool _ownerLock) onlyOwner, which can turn the lock off (and back on).renounceOwnership()sets_ownerto the zero address with no way back, so if it were called whileownerLockis true,setOwnerLockcould never run again.lock(uint256 time)also zeroes_owner, but only for a while:unlock()lets_previousOwnerrestore ownership onceblock.timestamp > _lockTime. The code allows both; the source does not show that either was called.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.