diff --git a/contracts/DODOStablePool/lib/DODOMath.sol b/contracts/DODOStablePool/lib/DODOMath.sol index e7d098b..8d1cd47 100644 --- a/contracts/DODOStablePool/lib/DODOMath.sol +++ b/contracts/DODOStablePool/lib/DODOMath.sol @@ -161,7 +161,7 @@ library DODOMath { // bAbs = abs(part1-part2) // if part1>part2 => b is negative => bSig is false // if part2>part1 => b is positive => bSig is true - uint256 part2 = k.mul(V0).div(V1).mul(V0).add(i.mul(delta)); // kQ0^2/Q1-i*deltaB + uint256 part2 = k.mul(V0).mul(V0).div(V1).add(i.mul(delta)); // kQ0^2/Q1-i*deltaB uint256 bAbs = DecimalMath.ONE.sub(k).mul(V1); // (1-k)Q1 bool bSig; diff --git a/contracts/lib/DODOMath.sol b/contracts/lib/DODOMath.sol index ba228ad..1eeafe9 100644 --- a/contracts/lib/DODOMath.sol +++ b/contracts/lib/DODOMath.sol @@ -156,7 +156,7 @@ library DODOMath { // bAbs = abs(part1-part2) // if part1>part2 => b is negative => bSig is false // if part2>part1 => b is positive => bSig is true - uint256 part2 = k * (V0) / (V1) * (V0) + (i * (delta)); // kQ0^2/Q1-i*deltaB + uint256 part2 = k * (V0) * (V0) / (V1) + (i * (delta)); // kQ0^2/Q1-i*deltaB uint256 bAbs = (DecimalMath.ONE - k) * (V1); // (1-k)Q1 bool bSig; diff --git a/test/TestGasSavingPool.t.sol b/test/TestGasSavingPool.t.sol index 9244a4d..5269e1c 100644 --- a/test/TestGasSavingPool.t.sol +++ b/test/TestGasSavingPool.t.sol @@ -211,14 +211,14 @@ contract TestGasSavingPool is Test { gsp.getPMMState(); dsp.getPMMState(); assertEq(receiveBaseAmount1, receiveBaseAmount2, "gsp receiveBaseAmount != dsp receiveBaseAmount"); - uint256 tmp = i == 0 ? 1999730072785929125 : 1998897790924520164 ; + uint256 tmp = i == 0 ? 1999730072785929125 : 1998897790924520174 ; assertEq(receiveBaseAmount1, tmp); // check baseReserve, quoteReserve (baseReserve1, quoteReserve1) = gsp.getVaultReserve(); (baseReserve2, quoteReserve2) = dsp.getVaultReserve(); assertEq(baseReserve1, baseReserve2, "gsp baseReserve != dsp baseReserve"); - tmp = i == 0 ? 8000249929713368009 : 6001332149611046822; + tmp = i == 0 ? 8000249929713368009 : 6001332149611046812; assertEq(baseReserve1, tmp); assertEq(quoteReserve1, quoteReserve2, "gsp quoteReserve != dsp quoteReserve"); tmp = i == 0 ? 12000000 : 14000000;