In the UpliftOnlyExample
contract, users can exploit the afterUpdate
function to pay less fee on liquidity pool value increases. The issue arises because the lpTokenDepositValue
, used to calculate withdrawal fees, is updated to the current pool value during token transfers instead of retaining the original deposit value. This allows users to transfer LP tokens to a new account after value increases and withdraw liquidity without incurring the correct fees.
The afterUpdate
function handles LP token transfers between accounts and updates the lpTokenDepositValue
. Current implementation calculates new deposit value and updates lpTokenDepositValue
erasing the the first deposit value. This design flaw enables users to evade fees by transferring their LP tokens after the pool value has increased. The original deposit value is lost and user pay less fee with new calculated deposit.
Users can pay less fee on value increases by transferring LP tokens to a new account and remove liquidity
Modify the afterUpdate
function to preserve the original lpTokenDepositValue
during token transfers.
Likelihood: High, any transfer will trigger the bug. Impact: High, will update lpTokenDepositValue to the new current value without taking fees on profit.
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.