From 332252dd1f51ed62096e9bc19a201849d0ef29c9 Mon Sep 17 00:00:00 2001 From: Jem <0x0xjem@gmail.com> Date: Fri, 12 Jul 2024 19:13:23 +0400 Subject: [PATCH] Shift to uniswap-v2-core 1.0.1 package in soldeer (same version) --- .gitmodules | 3 - foundry.toml | 1 + install.sh | 4 -- lib/uniswap-v2-core | 1 - .../contracts/UniswapV2Router02.sol | 2 +- .../contracts/libraries/UniswapV2Library.sol | 2 +- remappings.txt | 2 +- script/salts/salts.json | 58 +++++++++---------- soldeer.lock | 6 ++ test/Constants.sol | 6 +- .../liquidity/UniswapV2DTL/onSettle.t.sol | 2 +- 11 files changed, 43 insertions(+), 44 deletions(-) delete mode 160000 lib/uniswap-v2-core diff --git a/.gitmodules b/.gitmodules index 108aa3746..0670e8919 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "lib/uniswap-v3-core"] path = lib/uniswap-v3-core url = https://github.com/uniswap/v3-core -[submodule "lib/uniswap-v2-core"] - path = lib/uniswap-v2-core - url = https://github.com/uniswap/v2-core diff --git a/foundry.toml b/foundry.toml index 943d07c64..16e1d1f3f 100644 --- a/foundry.toml +++ b/foundry.toml @@ -33,3 +33,4 @@ solmate = { version = "6.7.0" } solady = { version = "0.0.124" } "@openzeppelin-contracts" = { version = "4.9.2" } "@openzeppelin-contracts-upgradeable" = { version = "4.9.2" } +"@uniswap-v2-core" = { version = "1.0.1" } diff --git a/install.sh b/install.sh index 3d0f413d3..6bbdb8270 100755 --- a/install.sh +++ b/install.sh @@ -15,10 +15,6 @@ forge install echo "" echo "*** Restoring submodule commits" # Lock the submodules to specific commits -echo "" -echo "uniswap-v2-core" -cd lib/uniswap-v2-core && git checkout v1.0.1 && cd ../.. - echo "" echo "uniswap-v3-core" cd lib/uniswap-v3-core && git checkout 6562c52e8f75f0c10f9deaf44861847585fc8129 && cd ../.. diff --git a/lib/uniswap-v2-core b/lib/uniswap-v2-core deleted file mode 160000 index 4dd59067c..000000000 --- a/lib/uniswap-v2-core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4dd59067c76dea4a0e8e4bfdda41877a6b16dedc diff --git a/lib/uniswap-v2-periphery/contracts/UniswapV2Router02.sol b/lib/uniswap-v2-periphery/contracts/UniswapV2Router02.sol index e6b009e11..aaf9e1661 100644 --- a/lib/uniswap-v2-periphery/contracts/UniswapV2Router02.sol +++ b/lib/uniswap-v2-periphery/contracts/UniswapV2Router02.sol @@ -1,6 +1,6 @@ pragma solidity >=0.6.6; -import "uniswap-v2-core/interfaces/IUniswapV2Factory.sol"; +import "@uniswap-v2-core-1.0.1/interfaces/IUniswapV2Factory.sol"; import './libraries/TransferHelper.sol'; import './interfaces/IUniswapV2Router02.sol'; diff --git a/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2Library.sol b/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2Library.sol index d18bfa691..000c025a6 100644 --- a/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2Library.sol +++ b/lib/uniswap-v2-periphery/contracts/libraries/UniswapV2Library.sol @@ -1,6 +1,6 @@ pragma solidity >=0.5.0; -import {IUniswapV2Pair} from "uniswap-v2-core/interfaces/IUniswapV2Pair.sol"; +import {IUniswapV2Pair} from "@uniswap-v2-core-1.0.1/interfaces/IUniswapV2Pair.sol"; import "./SafeMath.sol"; library UniswapV2Library { diff --git a/remappings.txt b/remappings.txt index 2978bc496..924082b1c 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,5 +1,4 @@ ds-test/=lib/forge-std/lib/ds-test/src/ -uniswap-v2-core/=lib/uniswap-v2-core/contracts/ uniswap-v3-core/=lib/uniswap-v3-core/contracts/ uniswap-v3-periphery/=lib/uniswap-v3-periphery/contracts/ @uniswap/v3-core/=lib/uniswap-v3-core/ @@ -9,3 +8,4 @@ g-uni-v1-core/=lib/g-uni-v1-core/contracts/ @solady-0.0.124=dependencies/solady-0.0.124/src @openzeppelin-contracts-4.9.2=dependencies/@openzeppelin-contracts-4.9.2 @openzeppelin-contracts-upgradeable-4.9.2=dependencies/@openzeppelin-contracts-upgradeable-4.9.2 +@uniswap-v2-core-1.0.1=dependencies/@uniswap-v2-core-1.0.1/contracts diff --git a/script/salts/salts.json b/script/salts/salts.json index 4f1531fa6..8e1adfb50 100644 --- a/script/salts/salts.json +++ b/script/salts/salts.json @@ -61,51 +61,51 @@ "0xf758779927a94ce49a1ea7e126142cca8472adf8cc3133234411737bb193ce41": "0xe826d67a09b7f9d1da2beacf436b833ae46aae40524c788fd02a10b5c3258c9a" }, "Test_AllocatedMerkleAllowlist": { - "0x4a840ad6c157c317f6fb87d2e93345ae1ae386010696db6c759fe22d1f2adc56": "0x6dd59ea841d65533ea9da6c7fca5e2778993f96a8bc1eb4468136d40739f2632", - "0xfe3e50be5107f6c30500ae78c780b56a7c810c98321a1d32450d00b58a2c7440": "0x27e3c187eadb3a5859874d5f1a0082130e086f362c2c78473843396bd47a575b" + "0x19b17d88f599542d2bfa057d852fa0a65b3478e24f6c80488bdc9a9768b4686f": "0xc4f2dd47f34adcd4890e6324dc5008d50bc6885ce29b4154676b760b0241ebe4", + "0xf2579c2e51d185b3918b1d0d6ee987616989cdd943a940c97e13c42a35db6338": "0xfae47d4131f11a8b5c52005eb76aaad3fc14c792ade68a7791770cc6af99e04d" }, "Test_CappedMerkleAllowlist": { - "0x8123d2e224049e51bffef40e89461093a9f63312d34ff1f7c32378f9d2a9fbd5": "0x05b784a3c1a9e692d3b254647353784d11abb230631b21ccbd5d115d97f06d41", - "0xa4dd77627b3dc083bbc73a9677717af60afeab7aaa80e24e23c4a5b69a505f99": "0xf1eebb64d3d3a0fe25db054bdb6c152ea9b206318a0074e82c65835fa42061f4" + "0x341cd3aa9f3ac6ca349fcae80a49a3886a0e9a1d40735b57392cbcfd86870c10": "0x372a405596407532503c87eed731e5d41c98c2053ea00eb52ae6c2cdf8afa9bb", + "0x98d12a28fbdc5a0cd0de76c4fd31f3c030653dba0c35916d5ed23c211c99e151": "0xce9c6daec43f6cc9df066c5821242e497c50301e40a6efec3195e7c81870ae8e" }, "Test_GUniFactory": { - "0x1fa8a8b401b9743a96d4942b3ac19db462daaec804e14ffe42fac101376df4c5": "0x83fff72503ba3c97d50a7c4974e157bc4ee8eeb1599ec56107845d9906ac95cc" + "0x0549f46f4328e133485bc3f6df637b5c29f386ca0eecd3f7cf8247a9a798b42c": "0x9f782b45b8cd40ba9b277839d9c2c3c21f09329e70497a53cf4764ca8e621684" }, "Test_MockCallback": { - "0x0da9dc049e66b3dc1bb5dca74a38a5abf9749b5fd0e5489dc0858bf78af9b0c6": "0xf70904657f222a61426511d26c8f62df492ab0421f6912a172671ec9978d1e40", - "0x1061a6422cdc2046155b4bbd37f3725f69d0e3ad48619b88f4f9e4f40f6cc5c7": "0x9802e9efbad788e534ac7fcf14948e93120a47f105072a9c5f030929f76755ce", - "0x1469ebda82eeee10ee2ce0c102323aefd405a21d1c9f2515a79a4663166ff2b2": "0xc5a2394a5f0d9625669ed50003711d1d78741e4899bf0f17ac542cc98691acab", - "0x3ae65d3c83309e2130b2fd38ec63c1f42c19b8c8bbdf77235c3ca22e6c458f9c": "0x7fd5e28d0f3b25b737e7ec3ab5b7241c0f17f5876b9316bc5668f5067f796a3a", - "0x4080e5f786afd1f6710694a1c518a1e8137252c3203adda0c31feef1506b69bf": "0xe2e501991ac1980fb51ea5348726f62271df904934eb9c7bb64897ea7a6f3e52", - "0x4bf9273d92aa039e7856a19308888194101ad96766830ffaca90fbb2f03bb033": "0xa1b94f88055ae12faeb6a4fe07d423d7e5a8dcca1a2d0d0c9b3450fb2280b05b", - "0x57f6c154aba1b590972fe69f5af3baf24430b1edf5ec448914d51e50995b00a5": "0xbabd2b7a73e126631c6d3b0655cd6bf7a7f3674e8b83e4c111bbc00dfe3bdbaa", - "0x5d14423b966c8effcf2df92e1962dfae61583592ea1145565ddf1841920fcdfa": "0x05d7d1058102cde26ef134833f4affd9fb7b587a53f1c3ac5d870e8ef46e1cc3", - "0x5e13ce49e834c8267fc296254478dd508c1302c5dba4b6d2902b983bd9d72292": "0xca37f2cffb1855a132490d6290c79f0260efce069eaba89e5956e95fd86f8e0e", - "0x644d7200a73ee05b78d9f6e6c2d16112fecefb349d5228ac36873670944f378c": "0x935ca68ef295d48a4cf8518e23225fdf8383bc037ee5e3c03c215b3214a886bd", - "0x7bbec016716dfdcf8f4d60f41d897944ce480a3724b79b2cdc13cb2a90c1276b": "0xdec818279fc3dc75a032a5781e19add5923a95a41c258c47731c369a06cd834c", - "0x9681e151e9aefecf038af4f8e667ac5504656c4d935f764e5750bd9234938d65": "0x40a7e6816f647d220f6a3c3505f25b4f963fe20be93cf84f7be08e9f169bde65", - "0xa49dd4a25152bc6c564e218d3955051b022dd94d7b0d7cff1f97b9b63a70d0a3": "0xe8249bef0e8cb977617062957194a6435249e4b6ae9d3e3324a503772559027f", - "0xb17d5a2c9e5ae358cc2d8786b4b21a04dbd1994bb675df4bcb90089a40fdfc81": "0x00066e51bb06711b6dee381ecd878cbcc69e06abc56072e67fb5430d6ff67a16", - "0xb474848821d195af0d47a2287338652a7194c3bee7618be47d8e785000385ad8": "0xfc43bddab2a7fd843f35b89d2b50708b68a53eefa39995b35b7b9344ba351c39", - "0xb8fe0a445183d101fea0abf1fc2d081718ba40af6890a354000f60bfd72ad4dd": "0x782eb6294e34a4d8704321f3c44005b4a1963b42670f65f3ad7903fbcfc665cc", - "0xbaa8af6bec426e64868d264cc03458ab77efa93f7b29b7959314e1c24a0b081f": "0xe8e772e113e18e3cbb927e7e65352b434da0fc9996506b0e77a8efe1c9b5b48a", - "0xe2a0df2ac452d31dedc68c1d85cf8bdc38ee052b5e44c86eb61b6a307ea3add3": "0x102e6ee1e447ff75a71e0f5e9e225588ac96e16e780a011e9e96abab1428018d" + "0x063be4644d5d1ac56a96f62ae09701480c8a5a554295332345292ea087d916a0": "0x52d609e80b3d7e54d395d42d62c4be06ea2dfab3c021695b306fa78467bc7218", + "0x0dec718134eba479f622ad64ba6d50dea62e4f4091ada3264e7d5bb77e5312ec": "0x3231c6cabf9fccfa8ab9156ccfd1249b407637b897eb7c7f6da365c07a0d88ae", + "0x453a1b82db7313eade02b033e3515b4f43db66154fdadb047f90ae5384e6d221": "0xf37b42430202f9fbdb2fc0684ae45ab9e169da249c30eaa889d38a6291f1bf9e", + "0x4bf26eb274226be31a04a5740626e9c44c05684839192feb33c2dc3737cb2db0": "0x967a96125ab8279ef4e622e26bba12ef52dc660c215a584d4e1dab56b41d97a5", + "0x527f6ee0dbd6732f566c59f89982b539e1617984795130aaf3ea03af9af7b5e0": "0x806e14c64796b57a6215ec8c7a567d18878125fcd8cddb365aef704bdff46a05", + "0x6da20606b212900adf37294b32f80ba70dde399748cb3476861b51c2dd824940": "0xcd90297f8750ef4049b499fb2f0013dabd32aed04157ff4fb6b6922cdb3ae159", + "0x717ea5b558ed3ae273e917aa61bee72cf4451e00fd7c9d9e5b3a7dfa763c94f2": "0x545cdcf787fb2d9fbd9fd6eb03f144b804e98bd5ed8cd8bf51cb01fc53948823", + "0x8670197f4beeac71948c69469184ae53d434ab9d1e5e2e39d9d3e073493e0409": "0x594875123af7adfaeab3715f6d2cc0096a97af6852ad3dbbd8911f40f2c97721", + "0x8a3917b6f62349f95369c3d5eb44fbe35ae794b707ab7e604d46556a123af94d": "0x6c5047c2f165fe43f0ccdfcf00149ac2441d488623e7f9d70e22e034fe78ada0", + "0x97db269cc12667187698717f984ca6f92ae526e122220a28ca72743c8652429c": "0xabdfc8cf3146886ec8a3d9e1012b11fc626cccfecff53d11ec8a62b3dc0f6bfd", + "0xa09d2c80d6b7ee77f4d9dbaf5e3dc1e35bbdec5cecfacb229a86c6c2af19d533": "0x72a43eb5ef949c5879e1b4dac1b97b8489b831b04530a3a0b22afe09885a11cf", + "0xb6054e588b58563d3d54af5913ee6c49a272a061c32c8f8929ff52bff996ab2d": "0xf8de61b3371c771cffb890e17eaf93c0101cae8becbe90367d90978abf1c0be2", + "0xb738a8796a339d91c2b29f05bb5df9feecf5cc10b2d66e41c14eb34fcee940d6": "0xa7fafd0dc35e8eec9f64c319a01c0180d5dbe7ae67c18a293fd6eca376ea7fe1", + "0xd790cda54da9201e6ba9a1661ad45f24906073df336ffe5d3d0a93f1ef3537d7": "0xd6fee9ba3bbf2a81e2c4a11b1549bae70c4d44d838c13dbde84631e87095ee71", + "0xf3a1ed8e439a23112a2bb5b916690f268c09e611e4baaf85f0c932bdf3f106e1": "0x05703633679a2ac2625a47d9d4bdf0412911fcb2db2960d0841e99962f301d82", + "0xf4e5c14c1b5cf49b5838ba45730cdc392eabd0f0a9aacdca0594cce86e00ebe6": "0x8f624ba6f99291dd8762885c038a2c2f2c71f7382cb624a583e92f9e22e3a6e9", + "0xf8cf8eaa2b3fe84183154362b6246349b0a74edcc5b6f8f39f33ca9610688310": "0x57e9a9491bd5b942dd9de60f5b94246f207c429fa4b84a8bec7c9cbb5954774a", + "0xfd43163d340531180bcc4c46b3feb567d0566349d45816d722faa052e82dafb0": "0xf8cd12d681680506239e8fd66bab08034d03bc0f3eb81d8e2f5e7bdfb2f94348" }, "Test_TokenAllowlist": { - "0x3fa3e175a11a44429b44bfe24e64aeeef95f968329c664dcc3808db38de2d1c9": "0x8b334032f1ae0b504eb294d11bc063e524732308a682bd813abed24ede7e6a09", - "0xd85c48f802f5c56a200bf158953e31e100d2caa0baca378b7e2bd4016771c212": "0xfff09020e1fabf8b6683940c60e00b167db8c0dbcd8dff7a6aea89416f779ae5" + "0x693fb7b8ec231b0c86e69a86656a629d32b680bbe02a6a1521dae1c1804e458c": "0xd9ff9a1409dbab72182efe69c22eb9469d5160979cfc747917b23bc2ba261e6d", + "0xff68dc9333ef3205072cf8e8482ce763db6e3ac4f123758d74b27e243366848c": "0x159aac583003497954980a2e79547a81d4666404bc53509ffcb9608c18d13f5b" }, "Test_UniswapV2DirectToLiquidity": { - "0xf1a6dafdf6561efe8bfee62050038868662523dcdaf7ffcc9f12096e858d20dc": "0xbfbe0bff230f3cc15a3b0a5ab413b06fb3f45e418dfdc20cc73a3ab7583a62b0" + "0x98d0d55409b0a713d6f824951d7e1c2204a243c87299b951c30e2b41b2ce2af4": "0x8592ec7aa86fd88702732ed9e91a47513b54ab2ea2c0f88c05e579c052587385" }, "Test_UniswapV2Router": { - "0xb4d4061951d379d42e3622590446920a25a06ab41fbddacb654ef1a061b4bdbe": "0xd5ebe09bd470c154e1af22bcbace8b39ac397de153b429d955f2dd75e21a5260" + "0x53f74f1fb6ea3aad46a2e71e142f6051ed1974f7058eb5888405b09cac48c665": "0x4afac5e1352d6a38ebf006c0bb1d5fc8c00dd086502d4e16d81b57e5831ab1a5" }, "Test_UniswapV3DirectToLiquidity": { - "0x19111a2d7625fb6418accb80e24b59dbc13cafe1dd2fa1fe3f6579ecca820db0": "0x0374767ecd1ae8b0c1948e8b6188974ba7cd38c58ca62c4fbc6b95ec75bdf507" + "0x2b7fb984e8bc685a3cfaad2ef6bda7c00927f5e8821d8e93fa2f96e635cd8976": "0xaa2e06f02ce8af5e2e033f0e2b927c4be92b060f2ccde95e7a3f76536b7eac5b" }, "Test_UniswapV3Factory": { - "0x3e1f1ef0d8a377f0cec8099d3ae70a4fe9497b3c7a14a70a0a9ec69f566d4fe6": "0xa5ba376b007410274bab6ee41d3a5688c8ca0e39b1177951b2233af7ee175cb5" + "0xb29ffc7473d26831fa04225c4f660e48486f91caf4e2410571a057f1d8376632": "0xf4f57484ceec43b90d16435b67c9daf7efa4d98fab03ad576a385a96c1d38527" }, "TokenAllowlist": { "0x09db47d395a68db033a3b222b9d1a212cec8422b03aeafc313aa4d2813c6dd60": "0xe07a005213f35e1f050a4da040d6bc3cae2ad333647b51a6ffa2e7941980043a", diff --git a/soldeer.lock b/soldeer.lock index bbaaa3330..119e1bdbb 100644 --- a/soldeer.lock +++ b/soldeer.lock @@ -28,3 +28,9 @@ name = "@openzeppelin-contracts-upgradeable" version = "4.9.2" source = "https://soldeer-revisions.s3.amazonaws.com/@openzeppelin-contracts-upgradeable/4_9_2_22-01-2024_13:15:04_contracts-upgradeable.zip" checksum = "33a161bf7799dcac1475d2470615b56a8f9a9387cb8eef921b49816dbbc61c2b" + +[[dependencies]] +name = "@uniswap-v2-core" +version = "1.0.1" +source = "https://soldeer-revisions.s3.amazonaws.com/@uniswap-v2-core/1_0_1_22-01-2024_13:18:30_v2-core.zip" +checksum = "efebb89237048771c19f52d3ce87ec4d0c591279bf1977c49f9e70e5fff530f0" diff --git a/test/Constants.sol b/test/Constants.sol index 51d4c913c..3ae8bedf8 100644 --- a/test/Constants.sol +++ b/test/Constants.sol @@ -7,10 +7,10 @@ abstract contract TestConstants { address internal constant _UNISWAP_V2_FACTORY = address(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); address internal constant _UNISWAP_V2_ROUTER = - address(0xAA965f95bBE106A978e9B9CDD4dC6EBEd2A4eA5c); + address(0xAA0d5cC0d62b1ef218F54f5B4aA03C607fAE5EdA); address internal constant _UNISWAP_V3_FACTORY = - address(0xAA34F2Aa90BC0FF7A05946f80Ed7CBD6Ab2d5278); - address internal constant _GUNI_FACTORY = address(0xAAbfC462E664D718c1938DBDC6183169151FedCb); + address(0xAAfDF914124C6D39C876bb448830bb608c11a579); + address internal constant _GUNI_FACTORY = address(0xAAd474134779191690B5bdB6bD4E4Cf2AbDCCa19); address internal constant _BASELINE_KERNEL = address(0xBB); address internal constant _BASELINE_QUOTE_TOKEN = address(0xAA58516d932C482469914260268EEA7611BF0eb4); diff --git a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol index 54d91b6a2..a8387c6b1 100644 --- a/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol +++ b/test/callbacks/liquidity/UniswapV2DTL/onSettle.t.sol @@ -8,7 +8,7 @@ import {FixedPointMathLib} from "@solmate-6.7.0/utils/FixedPointMathLib.sol"; import {ERC20} from "@solmate-6.7.0/tokens/ERC20.sol"; // Uniswap -import {IUniswapV2Pair} from "uniswap-v2-core/interfaces/IUniswapV2Pair.sol"; +import {IUniswapV2Pair} from "@uniswap-v2-core-1.0.1/interfaces/IUniswapV2Pair.sol"; // AuctionHouse import {ILinearVesting} from "src/interfaces/modules/derivatives/ILinearVesting.sol";