The UpliftOnlyExample contract's withdrawal fee calculation applies fees on the total withdrawal amount rather than just the uplift value, contradicting the whitepaper specification and potentially causing users to receive less than their initial deposit value.
In onAfterRemoveLiquidity(), the fee calculation is performed as:
The issue arises because this fee is then applied to the total withdrawal amount rather than just the uplift portion:
Example scenario:
User deposits 1e18 tokens
Value increases to 2e18 (100% uplift)
With 60% uplift fee, fee is calculated on entire 2e18
User receives 8e17 tokens (less than initial 1e18 deposit)
This contradicts the whitepaper which states fees should only apply to "increase in value LPs have received over the value they would have if they had HODLed".
Loss of user funds below HODL value
Contradict the white paper
Manual review
1- Modify fee calculation to only apply to the uplift portion:
2- Add explicit checks to ensure withdrawal amount after fees cannot fall below initial deposit value
Likelihood: High, every withdraw with benefits. Impact: High, more fees taken and can even transform a benefit in loss.
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.