Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: high
Invalid

Adding Market Parameters Will Lead To Lost Funds

Summary

In the current implementation, the SwanManager::setMarketParameters changes the parameters of the protocol. From now on only the latest added market parameters are used. But this comes with some problems, because for all buyers in the protocol all of the purchase requests that are not fulfilled yet, will be lost forever. Because adding new market parameters, moves all buyer into the next round.

Vulnerability Details

Scenario:

  1. We have two buyers in Buy Phase. Buyer A is in round 6 and Buyer B is in round 10. And both of them are waiting the oracle responders and validators to complete their purchase request. Both of them already paid fees to the oracle.

  2. The owner calls setMarketParameters and both of the buyers are moved to the next round, respectively 7 and 11.

  3. Both of the purchase requests can't be completed, because they are a part of an older round. All of the fees are lost forever.

Impact

The BuyerAgent-s who already paid fees for purchase requests, will lose the fees forever without the opportunity to buy assets.

Tools Used

Manual Review

Recommendations

To mitigate this, consider implementing a time-based mechanism, providing a buffer period between the request for adding market parameters and parameter changes. This would allow for any pending purchase requests to be completed before advancing all buyers to the next round, preserving buyer fees and ensuring fulfilment of outstanding requests.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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