Function: _finalizeRebalance(BasketManagerStorage self, address[] baskets)
This function performs the finalization of the rebalance process.
Inputs
selfControl: Controlled by the calling function.
Constraints: None.
Impact: The storage reference.
basketsControl: Controlled by the calling function.
Constraints: None.
Impact: The basket addresses to finalize the rebalance for.
Branches and code coverage
Intended branches
Reset the
self.rebalanceStatus.baskethashto zero.Reset the
self.rebalanceStatus.basketMaskto zero.Increment the
self.rebalanceStatus.epochby one.Set the
self.rebalanceStatus.timestampto the current block timestamp.Set the
self.rebalanceStatus.statustoStatus.NOT_STARTED.Reset the
self.externalTradesHashto zero.Reset the
self.retryCountto zero.Update the
self.basketBalanceOffor each asset in the basket.Call
BasketToken.fulfillRedeemfor each asset in the basket if there are withdrawable funds. Otherwise, callBasketToken.fallbackRedeemTrigger.
Negative behavior
Should not be callable directly.