Omniscia Euler Finance Audit
IRMLinearKink Code Style Findings
IRMLinearKink Code Style Findings
IRL-01C: Ineffectual Usage of Safe Arithmetics
| Type | Severity | Location |
|---|---|---|
| Language Specific | ![]() | IRMLinearKink.sol:L53 |
Description:
The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either require checks or if-else constructs.
Example:
src/InterestRateModels/IRMLinearKink.sol
49if (utilisation <= kink) {50 ir += utilisation * slope1;51} else {52 ir += kink * slope1;53 ir += slope2 * (utilisation - kink);54}Recommendation:
Given that safe arithmetics are toggled on by default in pragma versions of 0.8.X, we advise the linked statement to be wrapped in an unchecked code block thereby optimizing its execution cost.
Alleviation (fb2dd77a6ff9b7f710edb48e7eb5437e0db4fc1a):
The referenced subtraction was optimized securely, performing it within an unchecked code block without wrapping the multiplication that it is utilized in.
