Evilswap Rug Pull
What happened
De.Fi's REKT database lists Evilswap on BNB Smart Chain as an exit scam / rug pull dated 2021-08-27, with no loss amount. The verified farm source embeds an EvilToken whose _transfer contains owner-configurable restrictions: any transfer sent by an owner-listed LP address must be smaller than 100 raw units, and transfers to an owner-set address above a threshold the owner also sets revert. The owner can also mint without a cap, and the MasterChef accepts a deposit fee of up to 100%.
The source shows these controls, not that they were used.
How it happened
- The owner of the token can register an address with
function updateLPAddress(address lpAddress) public onlyOwner{ _tlpAddress.push(lpAddress); }. There is no function to remove an entry from_tlpAddress. - In
_transfer, a transfer whose sender is on that list must be tiny:if (checkLPAddress(sender) == true ) { require(amount < 100, "Transfer amount exceeds the maxTxAmount."); }. An LP pair that was listed is the sender when it pays tokens out to a buyer or to a liquidity remover, so those transfers revert unless they are below 100 raw units (100 / 10**18 of a token). Holders sending to the pair are not blocked by this line, because the sender is the holder. - The owner can also set a second restricted recipient with
function updateOwner(address newOwnerAddress) public onlyOwner { _tOwnerAddress = newOwnerAddress; }. This_tOwnerAddressis a separate variable, not theOwnableowner. The check isif (sender != _tWhiteList && recipient == _tOwnerAddress) { require(amount < _burnFee, "Transfer amount exceeds the maxTxAmount."); }, so if the pair were set as that recipient, a sale by any sender other than the single whitelisted address would needamount < _burnFee. _burnFeestarts at500 * 10**18and the owner can change it withfunction setBurnFee(uint256 burnFeePercent) public onlyOwner { _burnFee = burnFeePercent * 10**18; }. Setting it to 0 makesamount < _burnFeeimpossible, so every transfer to_tOwnerAddressfrom a non-whitelisted sender reverts.setWhiteListlets the owner exempt one sender address.- The owner can mint without limit:
function mint(uint256 amount) public onlyOwner returns (bool) { _mint(_msgSender(), amount); return true; }.Ownablealso hasrenounceOwnership, so these powers could be given up; the source does not show whether that happened. - In the MasterChef,
setaccepts a deposit fee of up to 10000 basis points (require(_depositFeeBP <= 10000, "set: invalid deposit fee basis points");), and fees go tofeeAddress;updateEmissionRate(uint256 _evilPerBlock)has no cap. - What happened: De.Fi's REKT database lists the project as an exit scam on 2021-08-27. No transaction was opened showing
updateLPAddress,updateOwner,setBurnFee,mintor any blocked trade.
Protocol details
Build your security review skills
Work through hands-on labs covering real exploit mechanics, review techniques, and defensive patterns.