diff --git a/.github/workflows/l1-contracts-foundry-ci.yaml b/.github/workflows/l1-contracts-foundry-ci.yaml index 74fdbb8dc325..02c551d63f86 100644 --- a/.github/workflows/l1-contracts-foundry-ci.yaml +++ b/.github/workflows/l1-contracts-foundry-ci.yaml @@ -29,7 +29,7 @@ jobs: run: yarn - name: Build artifacts - working-directory: ./l1-contracts-foundry + working-directory: ./l1-contracts run: forge build - name: Build system-contract artifacts @@ -40,8 +40,8 @@ jobs: with: key: artifacts-l1-contracts-foudry-${{ github.sha }} path: | - l1-contracts-foundry/cache - l1-contracts-foundry/out + l1-contracts/cache + l1-contracts/out system-contracts/artifacts-zk system-contracts/bootloader/build system-contracts/cache-zk @@ -63,8 +63,8 @@ jobs: fail-on-cache-miss: true key: artifacts-l1-contracts-foudry-${{ github.sha }} path: | - l1-contracts-foundry/cache - l1-contracts-foundry/out + l1-contracts/cache + l1-contracts/out system-contracts/artifacts-zk system-contracts/bootloader/build system-contracts/cache-zk @@ -75,8 +75,8 @@ jobs: uses: foundry-rs/foundry-toolchain@v1 - name: Copy configs from template - working-directory: ./l1-contracts-foundry - run: cp -r script-config-template script-config + working-directory: ./l1-contracts + run: cp -r deploy-script-config-template script-config - name: Run anvil run: | @@ -100,18 +100,18 @@ jobs: fi - name: Run DeployL1 script - working-directory: ./l1-contracts-foundry - run: forge script ./script/DeployL1.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY + working-directory: ./l1-contracts + run: forge script ./deploy-scripts/DeployL1.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY - name: Run DeployErc20 script - working-directory: ./l1-contracts-foundry - run: forge script ./script/DeployErc20.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY + working-directory: ./l1-contracts + run: forge script ./deploy-scripts/DeployErc20.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY # TODO restore scripts verification # - name: Run RegisterHyperchain script -# working-directory: ./l1-contracts-foundry +# working-directory: ./l1-contracts # run: | # cat ./script-out/output-deploy-l1.toml >> ./script-config/register-hyperchain.toml -# forge script ./script/RegisterHyperchain.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY +# forge script ./deploy-scripts/RegisterHyperchain.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY # - name: Run InitializeL2WethToken script # working-directory: ./l1-contracts-foundry -# run: forge script ./script/InitializeL2WethToken.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY +# run: forge script ./deploy-scripts/InitializeL2WethToken.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY diff --git a/.gitignore b/.gitignore index ab8dbb92c7f9..63f96063bd61 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ l1-contracts/lcov.info l1-contracts/report/* l1-contracts/coverage/* l1-contracts/out/* -l1-contracts-foundry/broadcast/* -l1-contracts-foundry/script-config/* -l1-contracts-foundry/script-out/* -!l1-contracts-foundry/script-out/.gitkeep +l1-contracts/broadcast/* +l1-contracts/script-config/* +l1-contracts/script-out/* +!l1-contracts/script-out/.gitkeep diff --git a/.gitmodules b/.gitmodules index 2a0ad281fc61..5cbc631ba847 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,12 +4,11 @@ [submodule "l1-contracts/lib/murky"] path = l1-contracts/lib/murky url = https://github.com/dmfxyz/murky -[submodule "l1-contracts-foundry/lib/forge-std"] - path = l1-contracts-foundry/lib/forge-std - url = https://github.com/foundry-rs/forge-std -[submodule "l1-contracts-foundry/lib/openzeppelin-contracts"] - path = l1-contracts-foundry/lib/openzeppelin-contracts - url = https://github.com/Openzeppelin/openzeppelin-contracts -[submodule "l1-contracts-foundry/lib/openzeppelin-contracts-upgradeable"] - path = l1-contracts-foundry/lib/openzeppelin-contracts-upgradeable +[submodule "l1-contracts/lib/openzeppelin-contracts-upgradeable"] + path = l1-contracts/lib/openzeppelin-contracts-upgradeable url = https://github.com/Openzeppelin/openzeppelin-contracts-upgradeable + branch = release-v4.9 +[submodule "l1-contracts/lib/openzeppelin-contracts"] + path = l1-contracts/lib/openzeppelin-contracts + url = https://github.com/Openzeppelin/openzeppelin-contracts + branch = release-v4.9 diff --git a/l1-contracts-foundry/foundry.toml b/l1-contracts-foundry/foundry.toml deleted file mode 100644 index ac978c3babbc..000000000000 --- a/l1-contracts-foundry/foundry.toml +++ /dev/null @@ -1,20 +0,0 @@ -[profile.default] -src = "../l1-contracts/contracts" -out = "out" -libs = ["lib"] -remappings = [ - "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", - "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", - "contracts/=../l1-contracts/contracts/", - "l2-contracts/=../l2-contracts/contracts/" -] -allow_paths = ["../l1-contracts/contracts", "../l2-contracts/contracts"] -fs_permissions = [ - { access = "read", path = "../system-contracts/bootloader/build/artifacts" }, - { access = "read", path = "../system-contracts/artifacts-zk/contracts-preprocessed" }, - { access = "read", path = "../l2-contracts/artifacts-zk/" }, - { access = "read", path = "./script-config" }, - { access = "read-write", path = "./script-out" }, - { access = "read", path = "./out" } -] -evm_version = "cancun" diff --git a/l1-contracts-foundry/lib/forge-std b/l1-contracts-foundry/lib/forge-std deleted file mode 160000 index b6a506db2262..000000000000 --- a/l1-contracts-foundry/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b6a506db2262cad5ff982a87789ee6d1558ec861 diff --git a/l1-contracts-foundry/lib/openzeppelin-contracts-upgradeable b/l1-contracts-foundry/lib/openzeppelin-contracts-upgradeable deleted file mode 160000 index a40cb0bda838..000000000000 --- a/l1-contracts-foundry/lib/openzeppelin-contracts-upgradeable +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a40cb0bda838c2ef3dfc252c179f5c37c32e80c4 diff --git a/l1-contracts-foundry/script-config-template/config-deploy-erc20.toml b/l1-contracts/deploy-script-config-template/config-deploy-erc20.toml similarity index 100% rename from l1-contracts-foundry/script-config-template/config-deploy-erc20.toml rename to l1-contracts/deploy-script-config-template/config-deploy-erc20.toml diff --git a/l1-contracts-foundry/script-config-template/config-deploy-l1.toml b/l1-contracts/deploy-script-config-template/config-deploy-l1.toml similarity index 100% rename from l1-contracts-foundry/script-config-template/config-deploy-l1.toml rename to l1-contracts/deploy-script-config-template/config-deploy-l1.toml diff --git a/l1-contracts-foundry/script-config-template/config-deploy-paymaster.toml b/l1-contracts/deploy-script-config-template/config-deploy-paymaster.toml similarity index 100% rename from l1-contracts-foundry/script-config-template/config-deploy-paymaster.toml rename to l1-contracts/deploy-script-config-template/config-deploy-paymaster.toml diff --git a/l1-contracts-foundry/script-config-template/config-initialize-l2-weth-token.toml b/l1-contracts/deploy-script-config-template/config-initialize-l2-weth-token.toml similarity index 100% rename from l1-contracts-foundry/script-config-template/config-initialize-l2-weth-token.toml rename to l1-contracts/deploy-script-config-template/config-initialize-l2-weth-token.toml diff --git a/l1-contracts-foundry/script-config-template/config-initialize-shared-bridges.toml b/l1-contracts/deploy-script-config-template/config-initialize-shared-bridges.toml similarity index 100% rename from l1-contracts-foundry/script-config-template/config-initialize-shared-bridges.toml rename to l1-contracts/deploy-script-config-template/config-initialize-shared-bridges.toml diff --git a/l1-contracts-foundry/script-config-template/register-hyperchain.toml b/l1-contracts/deploy-script-config-template/register-hyperchain.toml similarity index 100% rename from l1-contracts-foundry/script-config-template/register-hyperchain.toml rename to l1-contracts/deploy-script-config-template/register-hyperchain.toml diff --git a/l1-contracts-foundry/script/AcceptAdmin.s.sol b/l1-contracts/deploy-scripts/AcceptAdmin.s.sol similarity index 100% rename from l1-contracts-foundry/script/AcceptAdmin.s.sol rename to l1-contracts/deploy-scripts/AcceptAdmin.s.sol diff --git a/l1-contracts-foundry/script/DeployErc20.s.sol b/l1-contracts/deploy-scripts/DeployErc20.s.sol similarity index 100% rename from l1-contracts-foundry/script/DeployErc20.s.sol rename to l1-contracts/deploy-scripts/DeployErc20.s.sol diff --git a/l1-contracts-foundry/script/DeployL1.s.sol b/l1-contracts/deploy-scripts/DeployL1.s.sol similarity index 100% rename from l1-contracts-foundry/script/DeployL1.s.sol rename to l1-contracts/deploy-scripts/DeployL1.s.sol diff --git a/l1-contracts-foundry/script/DeployPaymaster.s.sol b/l1-contracts/deploy-scripts/DeployPaymaster.s.sol similarity index 100% rename from l1-contracts-foundry/script/DeployPaymaster.s.sol rename to l1-contracts/deploy-scripts/DeployPaymaster.s.sol diff --git a/l1-contracts-foundry/script/InitializeL2WethToken.s.sol b/l1-contracts/deploy-scripts/InitializeL2WethToken.s.sol similarity index 100% rename from l1-contracts-foundry/script/InitializeL2WethToken.s.sol rename to l1-contracts/deploy-scripts/InitializeL2WethToken.s.sol diff --git a/l1-contracts-foundry/script/InitializeSharedBridgeOnL2.sol b/l1-contracts/deploy-scripts/InitializeSharedBridgeOnL2.sol similarity index 100% rename from l1-contracts-foundry/script/InitializeSharedBridgeOnL2.sol rename to l1-contracts/deploy-scripts/InitializeSharedBridgeOnL2.sol diff --git a/l1-contracts-foundry/script/RegisterHyperchain.s.sol b/l1-contracts/deploy-scripts/RegisterHyperchain.s.sol similarity index 100% rename from l1-contracts-foundry/script/RegisterHyperchain.s.sol rename to l1-contracts/deploy-scripts/RegisterHyperchain.s.sol diff --git a/l1-contracts-foundry/script/Utils.sol b/l1-contracts/deploy-scripts/Utils.sol similarity index 100% rename from l1-contracts-foundry/script/Utils.sol rename to l1-contracts/deploy-scripts/Utils.sol diff --git a/l1-contracts/foundry.toml b/l1-contracts/foundry.toml index dad52171854c..82910dad0fdf 100644 --- a/l1-contracts/foundry.toml +++ b/l1-contracts/foundry.toml @@ -2,6 +2,20 @@ src = 'contracts' out = 'out' libs = ['node_modules', 'lib'] +remappings = [ + "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", + "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", + "l2-contracts/=../l2-contracts/contracts/" +] +allow_paths = ["../l2-contracts/contracts"] +fs_permissions = [ + { access = "read", path = "../system-contracts/bootloader/build/artifacts" }, + { access = "read", path = "../system-contracts/artifacts-zk/contracts-preprocessed" }, + { access = "read", path = "../l2-contracts/artifacts-zk/" }, + { access = "read", path = "./script-config" }, + { access = "read-write", path = "./script-out" }, + { access = "read", path = "./out" } +] cache_path = 'cache-forge' test = 'test/foundry' solc_version = "0.8.24" diff --git a/l1-contracts/lib/forge-std b/l1-contracts/lib/forge-std index 705263c95892..52715a217dc5 160000 --- a/l1-contracts/lib/forge-std +++ b/l1-contracts/lib/forge-std @@ -1 +1 @@ -Subproject commit 705263c95892a906d7af65f0f73ce8a4a0c80b80 +Subproject commit 52715a217dc51d0de15877878ab8213f6cbbbab5 diff --git a/l1-contracts/lib/murky b/l1-contracts/lib/murky index 40de6e80117f..5feccd1253d7 160000 --- a/l1-contracts/lib/murky +++ b/l1-contracts/lib/murky @@ -1 +1 @@ -Subproject commit 40de6e80117f39cda69d71b07b7c824adac91b29 +Subproject commit 5feccd1253d7da820f7cccccdedf64471025455d diff --git a/l1-contracts-foundry/lib/openzeppelin-contracts b/l1-contracts/lib/openzeppelin-contracts similarity index 100% rename from l1-contracts-foundry/lib/openzeppelin-contracts rename to l1-contracts/lib/openzeppelin-contracts diff --git a/l1-contracts/lib/openzeppelin-contracts-upgradeable b/l1-contracts/lib/openzeppelin-contracts-upgradeable new file mode 160000 index 000000000000..2d081f24cac1 --- /dev/null +++ b/l1-contracts/lib/openzeppelin-contracts-upgradeable @@ -0,0 +1 @@ +Subproject commit 2d081f24cac1a867f6f73d512f2022e1fa987854 diff --git a/l1-contracts/remappings.txt b/l1-contracts/remappings.txt index fa456851c018..d866a0c22e9c 100644 --- a/l1-contracts/remappings.txt +++ b/l1-contracts/remappings.txt @@ -1,5 +1,4 @@ @ensdomains/=node_modules/@ensdomains/ -@openzeppelin/=node_modules/@openzeppelin/ ds-test/=lib/forge-std/lib/ds-test/src/ eth-gas-reporter/=node_modules/eth-gas-reporter/ forge-std/=lib/forge-std/src/ diff --git a/l1-contracts-foundry/script-out/.gitkeep b/l1-contracts/script-out/.gitkeep similarity index 100% rename from l1-contracts-foundry/script-out/.gitkeep rename to l1-contracts/script-out/.gitkeep