Open code423n4 opened 1 year ago
This is similar to an (unmitigated) issue from an earlier contest: https://github.com/code-423n4/2023-02-reserve-mitigation-contest-findings/issues/22
However in this case it has to do with RevenueTraderP1.manageToken()
, as opposed to BackingManagerP1.manageTokens()
.
I think that difference matters, because the loss of the rewards for this auction does not have serious long-term consequences. This is not like the BackingManager where it's important that all capital always be available else an unnecessarily large haircut could occur. Instead, the worst that can happen is for the revenue auction to complete at high slippage, and for a second reward token revenue auction to complete afterwards at high slippage yet again, when it could have been a single revenue auction with less slippage.
The recommended mitigation would not succeed, because recall, we may be selling token X but any number of additional assets could have token X as a reward token. We would need to call claimRewards()
, which is simply too gas-costly to do everytime for revenue auctions.
tbrent marked the issue as sponsor disputed
Instead, the worst that can happen is for the revenue auction to complete at high slippage, and for a second reward token revenue auction to complete afterwards at high slippage yet again, when it could have been a single revenue auction with less slippage.
The impact sounds like a "leak of value" and therefore I think M is the correct severity per the c4 docs. (cc @tbrent - open to additional comment here)
0xean marked the issue as satisfactory
Lines of code
https://github.com/reserve-protocol/protocol/blob/c4ec2473bbcb4831d62af55d275368e73e16b984/contracts/p1/RevenueTrader.sol#L83-L104
Vulnerability details
There is a dev comment in the Assert.sol:
The claimRewards is moved to the
TradingP1.claimRewards/claimRewardsSingle
.But when the
RevenueTraderP1
trade and distribute revenues bymanageToken
, it only calls the refresh function of the asserts:The claimRewards is left out.
Impact
Loss a part of rewards.
Tools Used
Manual review
Recommended Mitigation Steps
Add claimRewardsSingle when refresh assert in the
manageToken
.Assessed type
Context