Submitted by ether_sky, also found by RadiantLabs and stuart_the_minion
https://github.com/code-423n4/2024-07-reserve/blob/3f133997e186465f4904553b0f8e86ecb7bbacbf/contracts/p1/BackingManager.sol#L114
https://github.com/code-423n4/2024-07-reserve/blob/3f133997e186465f4904553b0f8e86ecb7bbacbf/contracts/p1/BackingManager.sol#L166
In the BackingManager, we use the tradeEnd value for each type of trade to prevent next auction from occurring within the same block. We can find a comment in the code explaining this in line 114.
This approach works correctly for Batch auctions. However, with Dutch auctions, the tradeEnd value can inadvertently block the next auction from starting for a certain period.
The maximum auction length can be up to 1 week.
And the minimum warm-up period in the BasketHandler is 1 minute.
Suppose a Dutch auction is created in the BackingManager with a length of 1 week (7 days), starting at timestamp T. The tradeEnd for this auction type is set to T + 7 days in line 166.
Now, lets consider a scenario where one of the assets in the basket temporarily falls into an IFFY status. At this point, the current status of the basket is also IFFY (line 323~325).
The auction is settled one day later, triggering the rebalance function (line 92).
The check at line 116 passes because the caller is the BackingManager itself. However, the BasketHandler status is still IFFY, meaning it isnt ready for a new auction. As a result, the check at line 121 prevents the next auction from being created.
The tradeEnd is still set to T + 7 days and the current time is now T + 1 day.
After another day, the assets status recovers to SOUND, and the BasketHandler status updates to SOUND as well.
After the warm-up period (1 minute in our scenario), the BasketHandler is ready, and the time is now T + 2 days + 1 minute.
At this point, we want to create a new Dutch auction for rebalancing.
However, we cant create the next Dutch auction until T + 7 days due to the existing tradeEnd.
This delay clearly poses an issue.
akshatmittal (Reserve) confirmed, but disagreed with severity and commented:
cccz (judge) commented:
tbrent (Reserve) commented:
ether_sky (warden) commented:
cccz (judge) commented:
akshatmittal (Reserve) commented:
ether_sky (warden) commented:
Reserve mitigated
Status: Mitigation confirmed. Full details in reports from RadiantLabs, ether_sky and Bauchibred.
For this audit, 12 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by RadiantLabs received the top score from the judge.
The following wardens also submitted reports: Bauchibred, Shield, ether_sky, 0x52, SUPERMAN_I4G, Agontuk, PolarizedLight, Rhaydden, DanielArmstrong, krikolkk, and Aamir.
