Assessment reports>Origami Finance>Threat Model>setInterestRate

Function: setInterestRate(address _debtor, uint96 _rate)

Available only for minters or callers with an access to this function. Allows to update the compounding interest rate for a debtor. Before the update of debtor.rate, the _debtor.interestCheckpoint will be updated by the current rate, and only after, the new one will be set.

Inputs

  • _debtor

    • Constraints: No constraints.

    • Impact: The _debtor for which the interest rate will be updated.

  • _rate

    • Constraints: _rate cannot be more than MAX_INTEREST_RATE.

    • Impact: The rate at which interest will be accrued to the debtor.

Branches and code coverage

Intended branches

  • Validate that interestCheckpoint was updated using an old rate.

  • The rate was set properly.

Negative behavior

  • Non-whitelisted caller

  • The rate is invalid

Zellic © 2025Back to top ↑