When calculating r0 and r1 in the _getUtility function precision loss may occur due to the use of the standard devision operator / instead of the devision functions of ABDKMath64x64. As the other values in the equation make use of the library's methods if the absolute value of the divisor is larger than the divident than the utility may be equal to zero.
Lines of code
https://github.com/code-423n4/2023-08-shell/blob/c61cf0e01bada04c3d6055acb81f61955ed600aa/src/proteus/EvolvingProteus.sol#L712-L718
Vulnerability details
Impact
When calculating
r0
andr1
in the _getUtility function precision loss may occur due to the use of the standard devision operator/
instead of the devision functions of ABDKMath64x64. As the other values in the equation make use of the library's methods if the absolute value of the divisor is larger than the divident than the utility may be equal to zero.Proof of Concept
Tools Used
Manual review
Recommended Mitigation Steps
Use ABDKMath64x64's division functions to prevent precision loss.
Assessed type
Math