diff --git a/.github/workflows/foundry.yml b/.github/workflows/foundry.yml index fa46022e4..735024ec5 100644 --- a/.github/workflows/foundry.yml +++ b/.github/workflows/foundry.yml @@ -18,8 +18,6 @@ on: env: FOUNDRY_PROFILE: ci - WORLDCHAIN_PROVIDER: "${{ secrets.WORLDCHAIN_PROVIDER }}" - ETHEREUM_PROVIDER: "${{ secrets.ETHEREUM_PROVIDER }}" jobs: check: @@ -34,7 +32,16 @@ jobs: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 with: persist-credentials: false - submodules: recursive + fetch-depth: 1 + submodules: true + + - uses: taiki-e/install-action@18b1216eba7f8039b0f8d131d5473787f0edce68 # v2.85.3 + with: + tool: just@1.57.0 + fallback: none + + - name: Set up Solidity dependencies + run: just setup-contracts - name: Install Foundry uses: foundry-rs/foundry-toolchain@b00af27efadbc7b4ca8b82abbd903b17cc874d2a # v1 @@ -54,3 +61,6 @@ jobs: - name: Run Forge tests run: forge test + env: + WORLDCHAIN_PROVIDER: "${{ secrets.WORLDCHAIN_PROVIDER }}" + ETHEREUM_PROVIDER: "${{ secrets.ETHEREUM_PROVIDER }}" diff --git a/.gitmodules b/.gitmodules index 85c55fd68..c8e702788 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,33 +1,44 @@ [submodule "pkg/contracts/lib/forge-std"] path = pkg/contracts/lib/forge-std url = https://github.com/foundry-rs/forge-std + shallow = true [submodule "pkg/contracts/lib/BokkyPooBahsDateTimeLibrary"] path = pkg/contracts/lib/BokkyPooBahsDateTimeLibrary url = https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary + shallow = true [submodule "pkg/contracts/lib/world-id-contracts"] path = pkg/contracts/lib/world-id-contracts url = https://github.com/worldcoin/world-id-contracts + shallow = true [submodule "pkg/contracts/lib/safe-contracts"] path = pkg/contracts/lib/safe-contracts url = https://github.com/safe-global/safe-contracts + shallow = true [submodule "pkg/contracts/lib/openzeppelin-contracts"] path = pkg/contracts/lib/openzeppelin-contracts url = https://github.com/OpenZeppelin/openzeppelin-contracts + shallow = true [submodule "pkg/contracts/lib/account-abstraction"] path = pkg/contracts/lib/account-abstraction url = https://github.com/eth-infinitism/account-abstraction + shallow = true [submodule "pkg/contracts/lib/openzeppelin-contracts-upgradeable"] path = pkg/contracts/lib/openzeppelin-contracts-upgradeable url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable + shallow = true [submodule "pkg/contracts/lib/safe-modules"] path = pkg/contracts/lib/safe-modules url = https://github.com/worldcoin/safe-modules + shallow = true [submodule "pkg/contracts/lib/nitro-validator"] path = pkg/contracts/lib/nitro-validator url = https://github.com/base/nitro-validator + shallow = true [submodule "pkg/contracts/lib/sp1-contracts"] path = pkg/contracts/lib/sp1-contracts url = https://github.com/succinctlabs/sp1-contracts + shallow = true [submodule "pkg/contracts/lib/optimism"] path = pkg/contracts/lib/optimism url = https://github.com/ethereum-optimism/optimism + shallow = true diff --git a/Justfile b/Justfile index 502c06473..4da048219 100644 --- a/Justfile +++ b/Justfile @@ -19,6 +19,9 @@ devnet-up: build deploy-contracts: @just ./pkg/contracts/deploy-contracts +setup-contracts: + @just ./pkg/contracts/setup-contracts + # Build the pinned Optimism implementation contracts in the isolated opstack/ sub-project. build-opstack: @just ./pkg/contracts/build-opstack diff --git a/pkg/contracts/Justfile b/pkg/contracts/Justfile index 94fba2ce7..0cceb4c4b 100644 --- a/pkg/contracts/Justfile +++ b/pkg/contracts/Justfile @@ -6,10 +6,15 @@ deploy-contracts: fmt: forge fmt +setup-contracts: + git -C ../.. submodule update --init --depth 1 --jobs 8 + git -C lib/optimism submodule update --init --depth 1 --jobs 8 -- ':(glob)packages/contracts-bedrock/lib/*' + git -C lib/world-id-contracts submodule update --init --depth 1 --jobs 8 -- ':(glob)lib/*' + # Build the pinned Optimism implementation contracts (solc 0.8.15) in the isolated # opstack/ sub-project. Tests and deploy scripts read these artifacts via # vm.getCode/vm.deployCode; run this before `forge test`. -build-opstack: +build-opstack: setup-contracts cd opstack && forge build build-contracts *args='': build-opstack diff --git a/pkg/contracts/foundry.toml b/pkg/contracts/foundry.toml index fc518ee31..9cceedc74 100644 --- a/pkg/contracts/foundry.toml +++ b/pkg/contracts/foundry.toml @@ -18,6 +18,7 @@ remappings = [ "@BokkyPooBahsDateTimeLibrary/=lib/BokkyPooBahsDateTimeLibrary/contracts/", "@pbh-lib/=src/lib/", "openzeppelin-contracts/=lib/world-id-contracts/lib/openzeppelin-contracts/contracts/", + "contracts-upgradeable/=lib/world-id-contracts/lib/openzeppelin-contracts-upgradeable/contracts/", "@4337=lib/safe-modules/modules/4337/contracts/", "@safe-global/safe-contracts/contracts/=lib/safe-contracts/contracts/", "@base-contracts/=vendor/base-contracts/",