This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is rather than hardcoding the contract value. It slows down the e2e tests (by having to wait 1 L1 block for contracts to be ready), but it is more accurate to what occurs (and is now required as we initialize actions).
- Loading branch information
1 parent
3307176
commit f648a12
Showing
12 changed files
with
4,067 additions
and
568 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,49 @@ | ||
SHELL := /bin/bash | ||
|
||
CONTRACTS_PATH := "../../packages/contracts/artifacts/contracts" | ||
CONTRACTS_PATH := "../../packages/contracts/" | ||
OPTIMISM_PORTAL := ../../packages/contracts/contracts/L1/OptimismPortal.sol | ||
L1_BLOCK_INFO := ../../packages/contracts/contracts/L2/L1Block.sol | ||
|
||
binding: abi | ||
$(eval temp := $(shell mktemp)) | ||
|
||
cat abis/DepositFeed.json \ | ||
| jq -r .bytecode > $(temp) | ||
bindings: bindings-l1-block-info bindings-optimism-oracle deployed-bin-l1-block-info | ||
|
||
cat abis/DepositFeed.json \ | ||
| jq .abi \ | ||
| abigen --pkg deposit \ | ||
--abi - \ | ||
--out deposit/deposit_feed_raw.go \ | ||
--type deposit \ | ||
--bin $(temp) | ||
|
||
$(eval deployedBytecode := $(shell cat abis/DepositFeed.json | jq -r .deployedBytecode)) | ||
echo "// Code generated - DO NOT EDIT." > deposit/deposit_feed_deployed.go | ||
echo "// This file is a generated binding and any manual changes will be lost." >> deposit/deposit_feed_deployed.go | ||
echo "package deposit" >> deposit/deposit_feed_deployed.go | ||
echo "var DepositDeployedBin = \"$(deployedBytecode)\"" >> deposit/deposit_feed_deployed.go | ||
gofmt -s -w deposit/deposit_feed_deployed.go | ||
|
||
rm $(temp) | ||
|
||
$(eval temp := $(shell mktemp)) | ||
|
||
cat abis/L1Block.json \ | ||
| jq -r .bytecode > $(temp) | ||
|
||
cat abis/L1Block.json \ | ||
| jq .abi \ | ||
| abigen --pkg l1block \ | ||
--abi - \ | ||
--out l1block/l1_block_info_raw.go \ | ||
--type l1block \ | ||
--bin $(temp) | ||
|
||
$(eval deployedBytecode := $(shell cat abis/L1Block.json | jq -r .deployedBytecode)) | ||
# Split up b/c I don't know how to include this step in the L1 Block Info Bindings | ||
# What is occuring is that the `temp` variable is hard to pull into the `eval` | ||
deployed-bin-l1-block-info: bindings-l1-block-info | ||
$(eval deployedBytecode := $(shell cat bin/l1block_deployed.hex)) | ||
echo "// Code generated - DO NOT EDIT." > l1block/l1_block_info_deployed.go | ||
echo "// This file is a generated binding and any manual changes will be lost." >> l1block/l1_block_info_deployed.go | ||
echo "package l1block" >> l1block/l1_block_info_deployed.go | ||
echo "var L1blockDeployedBin = \"$(deployedBytecode)\"" >> l1block/l1_block_info_deployed.go | ||
gofmt -s -w l1block/l1_block_info_deployed.go | ||
|
||
rm $(temp) | ||
|
||
abi: | ||
cat $(CONTRACTS_PATH)/L1/DepositFeed.sol/DepositFeed.json \ | ||
| jq '{abi,bytecode,deployedBytecode}' \ | ||
> abis/DepositFeed.json | ||
cat $(CONTRACTS_PATH)/L2/L1Block.sol/L1Block.json \ | ||
| jq '{abi,bytecode,deployedBytecode}' \ | ||
> abis/L1Block.json | ||
bindings-l1-block-info: | ||
$(eval temp := $(shell mktemp -d)) | ||
solc \ | ||
--abi $(L1_BLOCK_INFO) \ | ||
--bin $(L1_BLOCK_INFO) \ | ||
--combined-json abi,bin,bin-runtime \ | ||
--allow-paths $(CONTRACTS_PATH) \ | ||
-o $(temp) | ||
abigen \ | ||
--combined-json $(temp)/combined.json \ | ||
--pkg l1block \ | ||
--type l1block \ | ||
--out ./l1block/l1_block_info_raw.go | ||
cat $(temp)/combined.json | jq -r ".contracts | with_entries(select(.key | match(\"L1Block\")))[] | .\"bin-runtime\"" > bin/l1block_deployed.hex | ||
|
||
|
||
bindings-optimism-oracle: | ||
$(eval temp := $(shell mktemp -d)) | ||
solc \ | ||
--abi $(OPTIMISM_PORTAL) \ | ||
--bin $(OPTIMISM_PORTAL) \ | ||
--combined-json abi,bin,bin-runtime \ | ||
--allow-paths $(CONTRACTS_PATH) \ | ||
-o $(temp) | ||
abigen \ | ||
--combined-json $(temp)/combined.json \ | ||
--pkg deposit \ | ||
--type deposit \ | ||
--out ./deposit/deposit_feed_raw.go |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.