Safe Gravity Honeypot
What happened
Safe Gravity (SAFEGRAVITY) is a BNB Chain token deployed on 8 April 2021 at 0x563a9303…ca5873. Its internal _approve function stores the requested allowance only when the token owner is the hard-coded deployer address 0xBbE84f65…eed195; for every other holder it writes an allowance of zero. A PancakeSwap sale needs the router to move the holder's tokens with transferFrom, which subtracts the amount from that zero allowance and reverts, so ordinary holders cannot sell through the router while buys from the pair still work.
The owner can also mint any amount of new tokens to itself. The analyst cryptot3ddybear listed this contract among tokens using the same rigged-approval pattern, and De.Fi's REKT database lists SAFEGRAVITY as an exit scam/honeypot, stating that holders were restricted from selling.
How it happened
- The constructor mints the full supply of just under 100,000,000 SAFEGRAVITY (
99999999999999999with 9 decimals) to the deployer, who also becomes theOwnableowner. - When any holder calls
approveorincreaseAllowance,_approvechecksowner == address(0xBbE84f65D89A1d083470f771869F4e67f0eed195); for everyone else it sets the allowance to0and emitsApproval(owner, spender, 0). A comment above the check reads "Gravity can be too strong and keep you on earth". - A router sale calls
transferFrom(holder, pair, amount). The function moves the tokens, then computes_allowances[sender][_msgSender()].sub(amount, ...)on a zero allowance, which reverts the whole transaction. - Buys use the pair's plain
transferto the buyer, which has no allowance step, so purchases go through and the hard-coded deployer address can still approve the router and sell. mint(uint256 amount)isonlyOwnerand adds any amount to the caller's balance and to total supply.
Protocol details
Evidence
- report @Token_Sniffer incident report twitter.com
- report De.Fi REKT database listing for SAFEGRAVITY (proof link: Token Sniffer X post 1380219360631906307) twitter.com
- transaction Safe Gravity contract creation transaction bscscan.com
- address Safe Gravity verified contract code on BscScan bscscan.com
- analysis Sourcify match for 0x563a930333dd3934ecc4ab0006ddd8d05eca5873 on BNB Chain repo.sourcify.dev
- analysis BSC-SCAM: PancakeSwap NoApproval (Blockchain Security Stories, cryptot3ddybear, 2021-04-08) cryptot3ddybear.gitlab.io
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.