Anyone can frontrun ERC20 approve mechanism preventing gang members from withdrawing money.
This attack scenario is a MEV bot attack, and here's how it can happen:
-step 1: A gang member approves the MoneyShelf for x amount of usdc
-step 2: attacker calls depositTheCrimeMoneyInATM(gangMember, msg.sender, x)
-final state: - gang member has x amount of usdc transfered from his address to the moneyShelf
- attacker gets x amount of CrimeMoney and his balance is updated
- gang member doesn't get CrimeMoney, hence noway for him to withdraw x usdc, his bank mapping was not updated, he cannot burn, withdrawUSDC
will fail
gang member cannot withdraw money and attacker gets crimeMoney for free
Manual review
Fix the bug, you might want to use approve in the contract, or maybe opt for ERC777 instead of ERC20
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.