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
_debtorConstraints: No constraints.
Impact: The
_debtorfor which the interest rate will be updated.
_rateConstraints:
_ratecannot be more thanMAX_INTEREST_RATE.Impact: The rate at which interest will be accrued to the debtor.
Branches and code coverage
Intended branches
Validate that
interestCheckpointwas updated using an old rate.The rate was set properly.
Negative behavior
Non-whitelisted caller
The
rateis invalid