Add rrevert to safeDiv in LibSafeMath

This commit is contained in:
Amir Bandeali
2019-08-11 14:41:30 -07:00
parent 45f229c531
commit 3afce213c0

View File

@@ -30,6 +30,13 @@ library LibSafeMath {
pure
returns (uint256)
{
if (b == 0) {
LibRichErrors._rrevert(LibSafeMathRichErrors.SafeMathError(
LibSafeMathRichErrors.SafeMathErrorCodes.UINT256_DIVISION_BY_ZERO,
a,
b
));
}
uint256 c = a / b;
return c;
}