From 10a496dd3b21bc6e0e054ce5dab4ba965d9ad459 Mon Sep 17 00:00:00 2001 From: Skye Date: Sun, 14 Jan 2024 23:59:15 +0800 Subject: [PATCH] fix-dodomath-precision --- contracts/lib/DODOMath.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contracts/lib/DODOMath.sol b/contracts/lib/DODOMath.sol index 18e560d..8e4e6a1 100644 --- a/contracts/lib/DODOMath.sol +++ b/contracts/lib/DODOMath.sol @@ -187,6 +187,9 @@ library DODOMath { uint256 numerator; if (bSig) { numerator = squareRoot.sub(bAbs); + if (numerator == 0) { + revert("DODOMath: should not be zero"); + } } else { numerator = bAbs.add(squareRoot); }