Trades that are stuck for any reason, primarily the sell or buy tokens being nonfunctional, can now be canceled via a governance action, which will put the BackingManager contract back in a state where another rebalance can be triggered.
After reviewing the changes, we have two improvements to suggest:
the BackingManager.forceSettleTrade function should also clear tradeEnd[kind], so this stored variable doesn't prevent new rebalancing actions in case a trade force settled before its term
an additional effect of this forceSettle action could be to force the DutchTrade and BatchTrade contracts into the SETTLED state to TradeStatus.CLOSED so the permissionless function transferToOriginAfterTradeComplete could be used to salvage any token that remains available, or even the broken token if it's fixed at a later point in time
Lines of code
Vulnerability details
This fix correctly addresses the issue Collaterals that become nonfunctional during an auction can DoS an RToken's rebalancing capabilities.
Trades that are stuck for any reason, primarily the
sell
orbuy
tokens being nonfunctional, can now be canceled via a governance action, which will put theBackingManager
contract back in a state where another rebalance can be triggered.After reviewing the changes, we have two improvements to suggest:
BackingManager.forceSettleTrade
function should also cleartradeEnd[kind]
, so this stored variable doesn't prevent new rebalancing actions in case a trade force settled before its termforceSettle
action could be to force theDutchTrade
andBatchTrade
contracts into theSETTLED
state toTradeStatus.CLOSED
so the permissionless functiontransferToOriginAfterTradeComplete
could be used to salvage any token that remains available, or even the broken token if it's fixed at a later point in time