diff --git a/script/optimized-deployer-meta b/script/optimized-deployer-meta index 758d2410..6ce7441d 100644 --- a/script/optimized-deployer-meta +++ b/script/optimized-deployer-meta @@ -1,5 +1,5 @@ { "constant_product_hash": "0xe174de1f7ab5f7c871f23787d956a8d1b4ebbb3b195eb2d6af27fb3a8c9e812e", "factory_hash": "0x23864280088f6f71abfba47086784b3c758d1df19a55957e25f1f4bd9336792e", - "stable_hash": "0x3ae886aee24fa2cc0144d24306033a7ed47e91bc0f962e4bffcef5922ae175f5" + "stable_hash": "0x6f62531ebc702a07ab48405ba9437786af3664b83b0da26ec295402590ed738f" } \ No newline at end of file diff --git a/src/ReservoirDeployer.sol b/src/ReservoirDeployer.sol index 22a991c9..9d78de37 100644 --- a/src/ReservoirDeployer.sol +++ b/src/ReservoirDeployer.sol @@ -19,7 +19,7 @@ contract ReservoirDeployer { bytes32 public constant FACTORY_HASH = bytes32(0x23864280088f6f71abfba47086784b3c758d1df19a55957e25f1f4bd9336792e); bytes32 public constant CONSTANT_PRODUCT_HASH = bytes32(0xe174de1f7ab5f7c871f23787d956a8d1b4ebbb3b195eb2d6af27fb3a8c9e812e); - bytes32 public constant STABLE_HASH = bytes32(0x3ae886aee24fa2cc0144d24306033a7ed47e91bc0f962e4bffcef5922ae175f5); + bytes32 public constant STABLE_HASH = bytes32(0x6f62531ebc702a07ab48405ba9437786af3664b83b0da26ec295402590ed738f); // Deployment addresses. GenericFactory public factory; diff --git a/test/unit/libraries/StableOracleMath.t.sol b/test/unit/libraries/StableOracleMath.t.sol index 5810da40..85436fa8 100644 --- a/test/unit/libraries/StableOracleMath.t.sol +++ b/test/unit/libraries/StableOracleMath.t.sol @@ -2,11 +2,14 @@ pragma solidity ^0.8.10; import "forge-std/Test.sol"; +import { FixedPointMathLib } from "solady/utils/FixedPointMathLib.sol"; import { StableOracleMath, StableMath } from "src/libraries/StableOracleMath.sol"; import { Constants } from "src/Constants.sol"; import { StableOracleMathCanonical } from "test/__mocks/StableOracleMathCanonical.sol"; contract StableOracleMathTest is Test { + using FixedPointMathLib for uint256; + uint256 internal _defaultAmp = Constants.DEFAULT_AMP_COEFF * StableMath.A_PRECISION; // estimates the spot price by giving a very small input to simulate dx (an infinitesimally small x) @@ -18,7 +21,7 @@ contract StableOracleMathTest is Test { uint256 N_A ) internal pure returns (uint256 rPrice) { uint256 lInputAmt = 1e8; // anything smaller than 1e7 the error becomes larger, as experimented - uint256 lOut = _getAmountOut(lInputAmt, reserve0, reserve1, token0Multiplier, token1Multiplier, true, 0, N_A); + uint256 lOut = StableMath._getAmountOut(lInputAmt, reserve0, reserve1, token0Multiplier, token1Multiplier, true, 0, N_A); rPrice = lOut.divWadUp(lInputAmt); }