Decrementing loop overflow causing DoS in `onAfterRemoveLiquidity()`
In the `onAfterRemoveLiquidity()` :
When `i` decrements to 0 and the `--i` operation is executed, it triggers an overflow check, causing a revert and preventing the correct processing of the user's exit fee after withdrawing liquidity.
Add the following test in `UpliftOnlyExampleTest`:
[PASS] testOnAfterRemoveLiquidityDoS() (gas: 514284)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 44.03ms (2.28ms CPU time)
Modify it as follows:
That’s definitely not the best way to handle that but there is indeed no impact. If someone tries to get more than their deposits, it must revert, and thanks to that "fancy mistake"(or genius code ?), it does.
That’s definitely not the best way to handle that but there is indeed no impact. If someone tries to get more than their deposits, it must revert, and thanks to that "fancy mistake"(or genius code ?), it does.
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.