Fast Khaki Raccoon
Medium
When interest is calculated FraxlendPairCore
calls IRateCalculatorV2::getNewRate
, which can be 2 possible contracts - LinearInterestRate
or VariableInterestRate
(_results.newRate, _results.newFullUtilizationRate) = IRateCalculatorV2(rateContract).getNewRate(
_deltaTime, _utilizationRate, _currentRateInfo.fullUtilizationRate
);
However due to LinearInterestRate
implementing the old interface and thus the old getNewRate
function FraxlendPairCore
will not be able to be used with it, as it's function uses bytes calldata _data, bytes calldata _initData
as inputs instead of _deltaTime, _utilizationRate, _currentRateInfo.fullUtilizationRate
:
function getNewRate(bytes calldata _data, bytes calldata _initData) external pure returns (uint64 _newRatePerSec) {
function getNewRate(bytes calldata _data, bytes calldata _initData) external pure returns (uint64 _newRatePerSec) {
getNewRate
accepting 2 params that are never imputed into this function interface, the only time it is called:
(_results.newRate, _results.newFullUtilizationRate) = IRateCalculatorV2(rateContract).getNewRate(
_deltaTime, _utilizationRate, _currentRateInfo.fullUtilizationRate
);
No response
No response
The contract will be just unusable, and thus no linear rate would be possible.
One of the 2 interest rate contracts will be unusable. Contracts in scope will not be able to be used because it's input params don't match the one place where it's interface function is called.
No response
Update the function to accept the same parameters as VariableInterestRate
, in order for the contract to be usable again.