Skip to content

Commit

Permalink
Merge pull request #221 from ethereum-optimism/10-22-feat_monorepo_us…
Browse files Browse the repository at this point in the history
…e_forge_install_to_install_monorepo

feat(monorepo): use forge install to install monorepo
  • Loading branch information
jakim929 authored Oct 23, 2024
2 parents 52b9095 + 0cd8210 commit 1040bb0
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 85 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/optimism"]
path = lib/optimism
[submodule "contracts/lib/optimism"]
path = contracts/lib/optimism
url = https://github.com/ethereum-optimism/optimism
26 changes: 8 additions & 18 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set positional-arguments

build-contracts:
forge --version
forge build --sizes --root ./
forge build --sizes --root ./contracts

build-go:
go build ./...
Expand All @@ -11,38 +11,28 @@ lint-go:
golangci-lint run -E goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint --timeout 5m -e "errors.As" -e "errors.Is" ./...

test-contracts:
forge test -vvv --root ./
forge test -vvv --root ./contracts

test-go:
go test ./... -v

start:
go run ./...

clean-lib:
rm -rf lib

checkout-optimism-monorepo:
cd lib/optimism && \
git fetch origin $(cat ../../monorepo-commit-hash) && \
git checkout $(cat ../../monorepo-commit-hash)

install-submodules:
cd $(git rev-parse --show-toplevel)
git add lib/optimism
git submodule update --init --recursive --progress --depth=1 && \
git reset lib/optimism
force-install-monorepo-version:
cd contracts/lib/optimism && \
forge install ethereum-optimism/optimism@$(cat ../../../monorepo-commit-hash) --no-commit

calculate-artifact-url:
#!/usr/bin/env bash
cd lib/optimism/packages/contracts-bedrock && \
cd contracts/lib/optimism/packages/contracts-bedrock && \
checksum=$(bash scripts/ops/calculate-checksum.sh) && \
echo "https://storage.googleapis.com/oplabs-contract-artifacts/artifacts-v1-$checksum.tar.gz"
generate-monorepo-bindings: checkout-optimism-monorepo install-submodules
generate-monorepo-bindings:
./scripts/generate-bindings.sh -u $(just calculate-artifact-url) -n CrossL2Inbox,L2ToL2CrossDomainMessenger,L1BlockInterop,SuperchainWETH,SuperchainERC20,SuperchainTokenBridge -o ./bindings

generate-genesis: checkout-optimism-monorepo install-submodules build-contracts
generate-genesis: build-contracts
go run ./genesis/cmd/main.go --monorepo-artifacts $(just calculate-artifact-url) --periphery-artifacts ./contracts/out --outdir ./genesis/generated

generate-all: generate-genesis generate-monorepo-bindings
5 changes: 2 additions & 3 deletions bindings/crossl2inbox.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/l1blockinterop.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/l2tol2crossdomainmessenger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/superchainerc20.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/superchaintokenbridge.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions bindings/superchainweth.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions foundry.toml → contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[profile.default]
src = "contracts/src"
test = "contracts/test"
script = "contracts/script"
out = "contracts/out"
libs = ["lib", "contracts/lib"]
src = "src"
test = "test"
script = "script"
out = "out"
libs = ["lib"]
evm_version = "cancun"

fs_permissions = []
Expand Down
14 changes: 7 additions & 7 deletions genesis/generated/900-l1-genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"depositContractAddress": "0x0000000000000000000000000000000000000000"
},
"nonce": "0x0",
"timestamp": "0x67181a22",
"timestamp": "0x671856b9",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"difficulty": "0x0",
Expand Down Expand Up @@ -299,7 +299,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000fb295aa436f23be2bd17678adf1232bdec02fed1",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x00000000000000000000000094e2e1fcbfd1099b450b2d5ac1f1701327361163",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067181a2200000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x000000000000000000000000000000000000000000000000671856b900000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000d98e0b378583bbcc8183184ce053aecbd15f22e5"
},
Expand All @@ -315,7 +315,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000fd19a33f8d757b8ea93bb2b40b1cde946c1e1f4d",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000124efba5858a36f53726e107481e71d9060d84e0",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067181a2200000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x000000000000000000000000000000000000000000000000671856b900000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x0000000000000000000000000c2405b5f131d7fe2e1f49e41e8a20d8e4179e7e"
},
Expand Down Expand Up @@ -521,7 +521,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x00000000000000000000000025782c27ef09d9173f8f274bead411bb9ac5417c",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000ed76b1d812dad3a322fdc3d766f251d51a78c3a9",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067181a2200000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x000000000000000000000000000000000000000000000000671856b900000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x00000000000000000000000048ff3b8ac58f74a9060dadfd60093d71a2e0b2ea"
},
Expand Down Expand Up @@ -830,7 +830,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x00000000000000000000000083e3463f6d53730367af74ad398779760b6404dd",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x0000000000000000000000000a4bf4bfdbd1155df635021f4558eef0754e3706",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067181a2200000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x000000000000000000000000000000000000000000000000671856b900000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000041ce2550a7925b7307fb1253962a3a6d89e7135"
},
Expand Down Expand Up @@ -937,7 +937,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000035": "0x0000000000000000000000811d626a3444c5c10fa01607ee11efbeaf19b0ff00",
"0x0000000000000000000000000000000000000000000000000000000000000037": "0x000000000000000000000000489d9f7f107dfca422f31f7b9d90d27442c76d64",
"0x0000000000000000000000000000000000000000000000000000000000000038": "0x000000000000000000000000ed5f8f44f210716c76111f7973acbddb39784d73",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067181a2200000001",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x000000000000000000000000000000000000000000000000671856b900000001",
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000fa16d7079aab573acdf911dd58e4457a20547548",
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x000000000000000000000000702ff7bf17315db7a068039006515a1c9a40c1c0"
},
Expand Down Expand Up @@ -1266,7 +1266,7 @@
"0x0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000000001",
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x000000000000000000000000000000000000000000000000000000003b9aca00",
"0x0000000000000000000000000000000000000000000000000000000000000032": "0x000000000000000000000000000000000000000000000000000000000000dead",
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x00000000000000000000000000000000000000000000000067181a2200000000"
"0x000000000000000000000000000000000000000000000000000000000000003b": "0x000000000000000000000000000000000000000000000000671856b900000000"
},
"balance": "0x0",
"nonce": "0x1"
Expand Down
Loading

0 comments on commit 1040bb0

Please sign in to comment.