Twerk Finance Rug Pull
What happened
TWERK is a 6-decimal ERC-20 on Ethereum at 0xf0b47eE3…E2E3eD. Its deployer, 0xaacC9134…0E23D9, is also the contract owner, and the code gives that address an uncapped _mint, a freezeAccount switch over any holder, and 1% of every transfer. Etherscan shows the deployer adding liquidity on 2020-11-20 (tx 0x94137e3f…3ab50f) and then swapping tokens for ETH through Uniswap V2 Router 2 on 2020-12-03; one of those swaps (tx 0xe384bc46…d59038) returned about 15.8 ETH.
De.Fi's REKT database lists six sales by the deployer: txs 0xe384bc46…d59038, 0xe63ec6c7…59d6ea, 0x55cdd544…8e0eaf, 0x769ca39b…096ed1, 0x8e1583aa…01bed5 and 0x25e09747…a851d3. On 2020-12-18 the deployer called _mint (tx 0x4e1fd1df…dfdf54) to credit tokens to its own address, and a router swap by the deployer followed about three minutes later (tx 0x25e09747…a851d3, about 2.1 ETH received).
How it happened
- The constructor mints the initial supply to the deployer, and
Ownedsets the deployer asowner:_mint( msg.sender, 60000 * 1000000);andowner = msg.sender;. - The owner can create more tokens without any cap or limit:
function _mint(address account, uint256 amount) onlyOwner public returns (bool){followed by_totalSupply = _totalSupply.add(amount);. Nothing in the code stops the owner from minting to itself and selling into the pool. - Every
transferandtransferFromalso pays the owner:uint256 devTokens = findOnePercent(value);and_balances[owner] = _balances[owner].add(devTokens);, while about 3% is burned from_totalSupplyand the sender is debited the fullvalue. - The owner can freeze any address with
freezeAccount, and bothtransferandtransferFromcheck it withrequire(_freezed[to] != true);and a matching check on the sender, so a frozen address cannot send or receive tokens.setInflationContractAddressis also owner-only, and every transfer callsInflationToken._mint(...)on that address, so a transfer reverts if that external call reverts. - What happened, per Etherscan: the deployer added liquidity on 2020-11-20, sold tokens through Uniswap V2 Router 2 on 2020-12-03 (for example about 15.8 ETH in tx 0xe384bc46…d59038), called
_mintto its own address on 2020-12-18 (tx 0x4e1fd1df…dfdf54) and swapped again minutes later (tx 0x25e09747…a851d3).
Protocol details
Evidence
- report @WARONRUGS incident report twitter.com
- transaction Etherscan transaction 0x4e1fd1dfe2df21cdd89150973972bc1d5a1499a9482ce0c67dc19f1f40dfdf54 (_mint by deployer) etherscan.io
- transaction Etherscan transaction 0xe384bc466c1b3322e045d45cb8923d2aebb4d4925e170c50804ebd9c1bd59038 (swap by deployer) etherscan.io
- transaction Etherscan transaction 0x25e09747f9118d0f0afeb9dbd7581dfd31a0a160c9010d4a928a23928ea851d3 (swap by deployer) etherscan.io
- transaction Etherscan transaction 0x94137e3f359590f20e58e6db81b219e3a84213440569b00bfbe471a7393ab50f (addLiquidityETH by deployer) etherscan.io
- transaction Etherscan transaction 0x8e1583aa90d14256da9c44eb0bdb474ede4b996aa21833d7ea8f28934f01bed5 (swap by deployer) etherscan.io
- transaction etherscan.io transaction 0x55cd…0eaf etherscan.io
- transaction etherscan.io transaction 0x769c…6ed1 etherscan.io
- transaction etherscan.io transaction 0xe63e…d6ea etherscan.io
- address Etherscan verified source for 0xf0b47eE3D3BDBEf94999b2B8F4b81a52fbE2E3eD (DeflationToken.sol) etherscan.io
- analysis Sourcify match for chain 1 contract 0xf0b47eE3D3BDBEf94999b2B8F4b81a52fbE2E3eD repo.sourcify.dev
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.