Open code423n4 opened 3 years ago
pants
The function : function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) { uint256 halfB = b / 2;
return (halfB + a * WAD) / b; }
could be:
function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) { return (b+ 2*a * WAD) / (2*b); }
That is more numeric precise and gas efficient.
Agreed as you always wanna run division last to avoid integer rounding
Handle
pants
Vulnerability details
The function : function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) { uint256 halfB = b / 2;
could be:
That is more numeric precise and gas efficient.