Assessment reports>Origami Finance>Threat Model>checkpointDebtAndMintRewards

Function: checkpointDebtAndMintRewards(address[] debtors)

Checkpoints the debt and distributes rewards.

Inputs

  • debtors

    • Control: Full.

    • Constraints: None.

    • Impact: Debtors to be checkpointed.

Branches and code coverage

Intended branches

  • Correctly mint according to the checkpoints and the accumulated interest.

  • Split the interest into fees.

Function call analysis

  • this.debtToken.checkpointDebtorsInterest(debtors)

    • What is controllable? Everything.

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

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

  • this._mintRewards() -> this.debtToken.estimatedCumulativeInterest()

    • What is controllable? Nothing.

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

    • What happens if it reverts, reenters or does other unusual control flow? Estimated cumulative interest (borrow rates should be up to date).

  • this._mintRewards() -> this.ovToken.performanceFee()

    • What is controllable? Nothing.

    • If the return value is controllable, how is it used and how can it go wrong? Performance fee in BP.

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

  • this._mintRewards() -> this.oToken.mint(this.feeCollector, feeAmount)

    • What is controllable? Nothing.

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

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

  • this._mintRewards() -> this.oToken.mint(address(this), newReservesAmount)

    • What is controllable? Nothing.

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

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

  • this._mintRewards() -> SafeERC20.safeIncreaseAllowance(this.oToken, address(this.ovToken), newReservesAmount)

    • What is controllable? Nothing.

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

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

  • this._mintRewards() -> this.ovToken.addPendingReserves(newReservesAmount)

    • What is controllable? Nothing.

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

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

Zellic © 2025Back to top ↑