diff --git a/foundry.toml b/foundry.toml index 41b1a41a..e3c735ed 100644 --- a/foundry.toml +++ b/foundry.toml @@ -2,7 +2,7 @@ solc = "0.8.28" evm_version = "cancun" via_ir = true -bytecode_hash = "none" +bytecode_hash = "ipfs" optimizer_runs = 1_000_000 gas_limit = "18446744073709551615" libs = ['lib'] diff --git a/script/optimized-deployer-meta b/script/optimized-deployer-meta index f5f188ac..7ea8a53d 100644 --- a/script/optimized-deployer-meta +++ b/script/optimized-deployer-meta @@ -1,5 +1,5 @@ { - "constant_product_hash": "0xddd075b1901512190892da217db5c4d266a6831226e14669e690aeb663dd9cf3", - "factory_hash": "0x87b0f73fafcf4bb41e013c8423dc679f6885527007d6c3f1e1834a670cbaadc5", - "stable_hash": "0xa52a6e20c3811c44bda8bc9f7988dd62da3c611711900f85d465b64bf97066af" + "constant_product_hash": "0x174b1bf04c1051e9d50d64a3c3b35666a4473b5994955635039d64ef9da69e97", + "factory_hash": "0x03107ee57e3054504c8ec584092f9d955bec0cbd1225fa1a8fb090a2084335aa", + "stable_hash": "0xf4d1335e5817123c66d1e76ef6f1fb5a767ef362f9005e0be256d01176994096" } \ No newline at end of file diff --git a/script/unoptimized-deployer-meta b/script/unoptimized-deployer-meta index a04d4dbf..a261f6c5 100644 --- a/script/unoptimized-deployer-meta +++ b/script/unoptimized-deployer-meta @@ -1,5 +1,5 @@ { - "constant_product_hash": "0x903212fc8445706a81c9527fb7fdbb940f030132904209befdddbc617d8bbc47", - "factory_hash": "0x09a9ce1ed77c95be4842dddd771939e048b8bfe2837863be3a2766b1c13ea5a2", - "stable_hash": "0x54471d136002bf755956dcaefd3f0450ba1596532ca57cc84f6c9d774002f4d3" + "constant_product_hash": "0x4cca74e4aab53779dc7f4f91ab12a3460cc34bae518a286b4ecd7fd16c0f193c", + "factory_hash": "0xc5e6cd61c86f3ff115d416548099141eb8fa9ede05aebf8f748e14f0b2cecfb4", + "stable_hash": "0x9fefafb4b596813d280a5fdeee37fc998c79303f69e4a638c7244e29bd1e1ad7" } \ No newline at end of file diff --git a/src/ReservoirDeployer.sol b/src/ReservoirDeployer.sol index c92b211a..bb7325cd 100644 --- a/src/ReservoirDeployer.sol +++ b/src/ReservoirDeployer.sol @@ -25,10 +25,10 @@ contract ReservoirDeployer { uint256 public step = 0; // Bytecode hashes. - bytes32 public constant FACTORY_HASH = bytes32(0x87b0f73fafcf4bb41e013c8423dc679f6885527007d6c3f1e1834a670cbaadc5); + bytes32 public constant FACTORY_HASH = bytes32(0x03107ee57e3054504c8ec584092f9d955bec0cbd1225fa1a8fb090a2084335aa); bytes32 public constant CONSTANT_PRODUCT_HASH = - bytes32(0xddd075b1901512190892da217db5c4d266a6831226e14669e690aeb663dd9cf3); - bytes32 public constant STABLE_HASH = bytes32(0xa52a6e20c3811c44bda8bc9f7988dd62da3c611711900f85d465b64bf97066af); + bytes32(0x174b1bf04c1051e9d50d64a3c3b35666a4473b5994955635039d64ef9da69e97); + bytes32 public constant STABLE_HASH = bytes32(0xf4d1335e5817123c66d1e76ef6f1fb5a767ef362f9005e0be256d01176994096); // Deployment addresses. GenericFactory public factory; diff --git a/src/curve/stable/StablePair.sol b/src/curve/stable/StablePair.sol index 5477dfeb..bf12cdeb 100644 --- a/src/curve/stable/StablePair.sol +++ b/src/curve/stable/StablePair.sol @@ -53,7 +53,10 @@ contract StablePair is ReservoirPair { function rampA(uint64 aFutureARaw, uint64 aFutureATime) external onlyFactory { require(aFutureARaw >= StableMath.MIN_A && aFutureARaw <= StableMath.MAX_A, InvalidA()); - uint64 lFutureAPrecise = aFutureARaw * uint64(StableMath.A_PRECISION); + uint64 lFutureAPrecise; + unchecked { + lFutureAPrecise = aFutureARaw * uint64(StableMath.A_PRECISION); + } uint256 duration = aFutureATime - block.timestamp; require(duration >= StableMath.MIN_RAMP_TIME, InvalidDuration()); @@ -368,7 +371,9 @@ contract StablePair is ReservoirPair { /// @dev number of coins in the pool multiplied by A precise function _getNA() internal view returns (uint256) { - return 2 * _getCurrentAPrecise(); + unchecked { + return 2 * _getCurrentAPrecise(); + } } function getCurrentA() external view returns (uint64) {