Division before multiplication will cause issues in the poollens interest calculation in getCurrentTotalDebt function _totalDebt * _borrowRate / 1e18 * _timeDelta / 365 days;
Impact
will cause issues in the poollens interest calculation in getCurrentTotalDebt function _totalDebt * _borrowRate / 1e18 * _timeDelta / 365 days;
Avci
medium
Division before multiplication will cause issues
Summary
Division before multiplication will cause issues
Vulnerability Detail
Division before multiplication will cause issues in the poollens interest calculation in getCurrentTotalDebt function
_totalDebt * _borrowRate / 1e18 * _timeDelta / 365 days;
Impact
will cause issues in the poollens interest calculation in getCurrentTotalDebt function
_totalDebt * _borrowRate / 1e18 * _timeDelta / 365 days;
https://github.com/sherlock-audit/2023-02-surge/blob/main/surge-protocol-v1/src/PoolLens.sol#LL41
Code Snippet
https://github.com/sherlock-audit/2023-02-surge/blob/main/surge-protocol-v1/src/PoolLens.sol#LL41
Tool used
Manual Review
Recommendation
consider modifying the interest value logic to the way Division before multiplication not happens.