QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: medium
Valid

user can bypass paying fees

Summary

in UpliftOnlyExample user can bypass paying fees by waiting for the upliftFeeBps to be law then swap to his other account and withdraw with the few fee

this report assumes implementation of the function specified by the sponsor here has been done and solved

scenario

upliftFeeBps is vthe alue of the fee charged while withdrawing the value can be changed but not for already added BptAmount

File: UpliftOnlyExample.sol
606: if (_to != address(0)) {
607: // Update the deposit value to the current value of the pool in base currency (e.g. USD) and the block index to the current block number
608: //vault.transferLPTokens(_from, _to, feeDataArray[i].amount);
609: feeDataArray[tokenIdIndex].lpTokenDepositValue = lpTokenDepositValueNow;
610: feeDataArray[tokenIdIndex].blockTimestampDeposit = uint32(block.number);
611:@> feeDataArray[tokenIdIndex].upliftFeeBps = upliftFeeBps;
  1. Assume Bob added liquidity at upliftFeeBps = 5000

  2. then he wanted to the withdraw creator to change the fee to 100 (this value is for future deposits)

  3. bob call update the position to his other account which will store the new fee value of 100

  4. after that, he can withdraw from that account with a few fee

Impact

  • loss of (funds / fees)

Tools Used

manual review

Recommendations

in case of swap
when liquidity is added the fee should stay as is and not changed to the new fee

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_afterUpdate_update_upliftFeeBps

Likelihood: High, any transfer will trigger the bug. Impact: Low, will update upliftFeeBps to the new current value which will increase or decrease the fees, but at the moment there is no setter for upliftFeeBps ! So it won't change anything (but this setter should exists according the sponsor)

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!