Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy multiple contracts #213

Merged
merged 16 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ CHAIN_ID=31337
DATABASE_URL=postgresql://blockful:ensdomains@localhost:5432/ensdomains

# Arbitrum
LAYER2_RPC=http://127.0.0.1:8547
L2_REGISTRAR_ADDRESS=0xB66Ff14A830D5527f06e384B309288B843d555C4 # Subdomain registrar
L2_RPC_URL=http://127.0.0.1:8547
L2_RESOLVER_ADDRESS=0xac3B14CB55C2242BB8Ca1dC8269701948CB0c348 # L2 Resolver
ROLLUP_ADDRESS=0x3cf538A94538a25ee3bcA0287aB530ACCf9Dbaf6 # L2 Rollup

Expand Down
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
src_dir := packages/contracts/src
script_dir := packages/contracts/script
deploy_dir := $(script_dir)/deploy

PRIVATE_KEY?=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
L2_PRIVATE_KEY?=0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659
ETHERSCAN_API_KEY?=VEJ7GISNRKFUESRPC4W4D3ZEM2P9B4J6C4

.PHONY: deploy-arb

include .env

deploy-arb-l1:
@set -e; \
echo "Deploying ArbitrumVerifier..." && \
forge script $(deploy_dir)/ArbitrumVerifier.sol \
--rpc-url sepolia \
--broadcast \
-vvv \
--private-key $(PRIVATE_KEY) \
--verify && \
echo "Deploying L1ArbitrumResolver..." && \
forge script $(deploy_dir)/L1ArbitrumResolver.sol \
--rpc-url sepolia \
--broadcast \
-vvv \
--private-key $(PRIVATE_KEY) \
--verify;

deploy-arb-resolver:
@set -e; \
echo "Deploying L2ArbitrumResolver..." && \
forge script $(deploy_dir)/L2ArbitrumResolver.sol \
--rpc-url arb_sepolia \
--broadcast \
-vvv \
--private-key $(L2_PRIVATE_KEY) \
--verify;


CONTRACTS := ENSRegistry ReverseRegistrar BaseRegistrarImplementation NameWrapper ETHRegistrarController SubdomainController L2ArbitrumResolver
deploy-arb-full:
@set -e; \
$(foreach contract,$(CONTRACTS),\
echo "Deploying $(contract)..." && \
forge script $(deploy_dir)/$(contract).sol \
--rpc-url arb_sepolia \
--broadcast \
-vvv \
--private-key $(L2_PRIVATE_KEY) \
--verify \
&& \
) true; \
echo "All contracts deployed successfully."
9 changes: 7 additions & 2 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ remappings = [
"@nitro-contracts=node_modules/@arbitrum/nitro-contracts",
"@evmgateway=packages/contracts/src/evmgateway",
]
fs_permissions = [
{ access = "read", path = "./broadcast" },
{ access = "read", path = "./packages/contracts/out" },
]
sparse_mode = true

ignored_warnings_from = [
"node_modules/",
Expand All @@ -29,8 +34,8 @@ sepolia = { key = "${ETHERSCAN_KEY}" }


[rpc_endpoints]
rpc_url = "${RPC_URL}"
arbitrum_rpc_url = "${ARBITRUM_RPC_URL}"
sepolia = "${RPC_URL}"
arb_sepolia = "${L2_RPC_URL}"


[fmt]
Expand Down
Loading
Loading