SherLOCK Rug Pull
What happened
SherLOCK (LOCK) was a BNB Chain token whose transfer logic lets the owner stop holders from selling while the owner's own wallets trade freely. Every sale to the PancakeSwap pair or router must pass _canTransfer, which checks each seller's cumulative sold amount against what they bought, their cumulative BNB proceeds against the owner-set _theNumber, and their BNB balance against the owner-set _theRemainder; if a check fails, transfer returns true without moving any tokens, so the swap cannot complete. Addresses in _marketersAndDevs skip these checks, and the owner can also credit itself unlimited tokens through rewardHolders.
CertiK reported on 2022-09-21 that the contract deployer removed liquidity and sent 510 BNB to Tornado Cash at the time of its alert. The existing record lists 938 BNB removed from the pool, about 520 BNB sent to Tornado Cash and the rest sent to another address.
How it happened
- The constructor gives the whole 100,000,000
LOCKsupply to the deployer, creates the PancakeSwap pair, setsmaster = owner()and marks the deployer in_marketersAndDevs, which bypasses all sell checks. - For any other seller,
_canTransferonly allows a transfer to the pair or router whenbought >= sold + amount && _theNumber >= soldETH + amountETH && sender.balance >= _theRemainder. setNumberandsetRemainderareonlyOwnerwith no limits, so the owner can set_theNumberto zero or_theRemainderabove any holder's BNB balance and every holder sale fails.- When the check fails,
transferandtransferFromskip_transferbut stillreturn true, so a PancakeSwap sale sends no tokens to the pair and the swap cannot complete. - The owner can mint to itself through
rewardHolders, and the constructor grantsmasteran unlimited allowance over the pair's ownLOCKbalance, whichmastercan pull out withtransferFromand then callsyncPair. - On 2022-09-21 CertiK reported that the deployer had removed liquidity from the pool and sent 510 BNB to Tornado Cash.
Protocol details
Security review history
- Sherlock View report
Evidence
- report CertiK Alert on X: price slippage on sherLOCK (LOCK) twitter.com
- transaction bscscan.com transaction 0x4b3c…4f54 bscscan.com
- transaction bscscan.com transaction 0x96aa…45da bscscan.com
- transaction bscscan.com transaction 0xd388…33d4 bscscan.com
- address SherLOCK (LOCK) verified contract source, BscScan bscscan.com
- address bscscan.com address 0x1ce2…39bd bscscan.com
- address bscscan.com address 0xd989…db1d bscscan.com
- analysis Sourcify match, chain 56, 0x817b5054392199FED877e1dfdf4bdA7234691e8E repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.