Function: settle(uint256 unSettleProfit)

This function settles a portion of the accumulated profits, distributing them between the protocol's treasury and reinvesting the remainder.

Inputs

  • unSettleProfit

    • Control: Controlled by the caller with ADMIN_ROLE.

    • Constraints: None.

    • Impact: The amount of profit to be settled and distributed.

Branches and code coverage

Intended branches

  • Distributes profit between the protocol's treasury and the strategy vault according to the carry rate.

  • Redeposits the underlying tokens.

Negative behavior

  • Reverts if the caller does not have the ADMIN_ROLE role.

  • Reverts if unSettleProfit is bigger than the current profit of the vault.

Function call analysis

  • getProfit()

    • What is controllable? N/A.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

  • IERC4626(market).convertToShares(unSettleProfit)

    • What is controllable? unSettleProfit.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

  • IERC4626(market).redeem(protocolProfitShare, infiniTreasure, address(this))

    • What is controllable? unSettleProfit.

    • If the return value is controllable, how is it used and how can it go wrong? Not used.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

  • IERC4626(market).redeem(settleProfitShare, address(this), address(this))

    • What is controllable? settleProfitShare.

    • If the return value is controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

  • _deposit(underlyingTokenAmount)

    • What is controllable? N/A.

    • If the return value is controllable, how is it used and how can it go wrong? Not used.

    • What happens if it reverts, reenters or does other unusual control flow? N/A.

Zellic © 2025Back to top ↑