Assessment reports>Cove>Threat Model>_finalizeRebalance

Function: _finalizeRebalance(BasketManagerStorage self, address[] baskets)

This function performs the finalization of the rebalance process.

Inputs

  • self

    • Control: Controlled by the calling function.

    • Constraints: None.

    • Impact: The storage reference.

  • baskets

    • Control: 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.baskethash to zero.

  • Reset the self.rebalanceStatus.basketMask to zero.

  • Increment the self.rebalanceStatus.epoch by one.

  • Set the self.rebalanceStatus.timestamp to the current block timestamp.

  • Set the self.rebalanceStatus.status to Status.NOT_STARTED.

  • Reset the self.externalTradesHash to zero.

  • Reset the self.retryCount to zero.

  • Update the self.basketBalanceOf for each asset in the basket.

  • Call BasketToken.fulfillRedeem for each asset in the basket if there are withdrawable funds. Otherwise, call BasketToken.fallbackRedeemTrigger.

Negative behavior

  • Should not be callable directly.

Zellic © 2025Back to top ↑