T-Rex Honeypot
What happened
T-Rex (T-Rex) is a BNB Chain token deployed on 16 May 2021 at 0x61ed1a35…7a7210. Its transferFrom override only succeeds when a flag called trans is true, when the deployer is the sender or recipient, or when the PancakeSwap pair is the sender. trans starts as false, so a holder's sale through the PancakeSwap router, which moves tokens from the holder to the pair with transferFrom, reverts, while purchases from the pair still go through.
The deployer also holds roles that can pause every transfer and mint unlimited tokens, and the contract's renounceOwnership and lockLiquidity functions only emit events without changing any permission or locking any liquidity. De.Fi's REKT database lists T-Rex as an exit scam/honeypot, stating that the contract owner could disable transfers and so stop holders from selling.
How it happened
- The constructor records the deployer as the immutable address
moi, setstrans = false, grants the deployerDEFAULT_ADMIN_ROLE,PAUSER_ROLEandMINTER_ROLE, mints 1,000,000,000,000 T-Rex to the deployer, and creates the PancakeSwap pair. transferFromrequirestrans || moi == sender || moi == recipient || sender == UNI, whereUNIis the pair. A router sale callstransferFrom(holder, pair, amount), so it fails for every holder except the deployer whiletransis false.- Purchases use the pair's plain
transferto the buyer, which this check does not cover, so buying keeps working. - Only a
MINTER_ROLEholder can callsetTransto open sales, and the same role can callpiocher(to, amount)to mint any amount to any address. - A
PAUSER_ROLEholder can callpause(), and thewhenNotPausedhook then blocks every transfer, mint and burn. renounceOwnership()andlockLiquidity()are public functions that only emitOwnershipRenouncedandliquidityLockedevents; calling them changes no role and locks no LP tokens.
Protocol details
Evidence
- report De.Fi REKT database listing for T-Rex (proof link: Token Sniffer 'Reported by user(s)') tokensniffer.com
- transaction T-Rex contract creation transaction bscscan.com
- address T-Rex (T-Rex) verified contract code on BscScan bscscan.com
- analysis Sourcify match for 0x61ed1a35f56dd24a3e7aabd9ecaf4104237a7210 on BNB Chain repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.