The UpliftOnlyExample
contract implements a fee mechanism where users pay uplift fees based on the value appreciation of their liquidity position. The contract tracks positions using NFTs, where each NFT represents a deposit and its associated fee data in the poolsFeeData
mapping. When users withdraw, they pay fees based on the value increase from their deposit price.
The contract includes an afterUpdate()
function that handles NFT transfers between users. However, this function contains an issue in how it updates fee data during transfers:
UpliftOnlyExample.sol#L606-L614
The issue is that during transfers, the contract completely resets the fee basis by updating the deposit value to the current value, effectively erasing any accumulated uplift. This allows users to bypass uplift fees entirely by transferring their NFT before withdrawal, as the new owner's position will be based on the transfer-time price rather than the original deposit price.
High economic issue that allows complete bypass of the protocol's uplift fee mechanism through NFT transfers, resulting in up to 96% reduction in fee collection and undermining the entire economic model of the protocol.
Alice can exploit this vulnerability through the following steps:
Alice deposits 1000 tokens when price is $100
lpTokenDepositValue
set to $100,000
Stored in poolsFeeData[pool][alice]
Price increases to $150 (+50%)
Alice would normally pay uplift fee on 50% gain
With upliftFeeBps = 500
, fee would be 25 tokens
Instead of withdrawing, Alice transfers NFT to Bob
Bob receives position with:
New deposit value of $150
No accumulated uplift
Can withdraw immediately paying only minWithdrawalFeeBps
(0.1%)
Actual fee: 1 token instead of 25 tokens
Optional: Bob transfers back to Alice who can now withdraw with minimum fee
Manual Review
Implement one or both of these solutions:
Preserve original deposit data during transfers:
Add a transfer fee based on accumulated uplift:
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.