ConvexityProtocol icon indicating copy to clipboard operation
ConvexityProtocol copied to clipboard

OptionsContract.isSafe(uint256,uint256) (OptionsContract.sol#847-885) performs a multiplication on the result of a division

Open ghost opened this issue 4 years ago • 0 comments

OptionsContract.isSafe(uint256,uint256) performs a multiplication on the result of a division: -rightSideVal = (collateralAmt.mul(collateralToEthPrice)).div(strikeToEthPrice) -stillSafe = leftSideVal <= rightSideVal.mul(10 ** exp)

Consider ordering multiplication prior division.

ghost avatar Aug 11 '20 04:08 ghost