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/create2 testnets #327

Merged
merged 4 commits into from
Jul 22, 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
16 changes: 16 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ ZKEVM_ETHERSCAN_URL=https://api-zkevm.polygonscan.com/api
ZKEVM_ETHERSCAN_KEY=PasteYourOwnKeyPlease

# TESTNET CHAINS
# Arbitrum Sepolia
ARB_SEPOLIA_API=https://arbitrum-sepolia.blockpi.network/v1/rpc/public
ARB_SEPOLIA_ETHERSCAN_URL=https://api-sepolia.arbiscan.io/api
ARB_SEPOLIA_ETHERSCAN_KEY=YourArbiScanKey
# Base Sepolia
BASE_SEPOLIA_API=https://base-sepolia.blockpi.network/v1/rpc/public
BASE_SEPOLIA_ETHERSCAN_URL=https://api-sepolia.basescan.org/api
BASE_SEPOLIA_ETHERSCAN_KEY=YourBaseScanKey
# BNB Testnet
BNB_TESTNET_API=https://bsc-testnet.blockpi.network/v1/rpc/public
BNB_TESTNET_ETHERSCAN_URL=https://api-testnet.bscscan.com/api
BNB_TESTNET_ETHERSCAN_KEY=YourBscScanKey
# Ethereum Sepolia
ETH_SEPOLIA_API=https://rpc.sepolia.org
ETH_SEPOLIA_ETHERSCAN_URL=https://api-sepolia.etherscan.io/api
Expand All @@ -103,3 +115,7 @@ ETH_SEPOLIA_ETHERSCAN_KEY=YourEtherScanKey
OP_SEPOLIA_API=https://optimism-sepolia.blockpi.network/v1/rpc/public
OP_SEPOLIA_ETHERSCAN_URL=https://api-sepolia-optimistic.etherscan.io/api
OP_SEPOLIA_ETHERSCAN_KEY=YourOptimismEtherScanKey
# Scroll Sepolia
SCROLL_SEPOLIA_API=https://scroll-sepolia.blockpi.network/v1/rpc/public
SCROLL_SEPOLIA_ETHERSCAN_URL=https://api-sepolia.scrollscan.com/api
SCROLL_SEPOLIA_ETHERSCAN_KEY=YourScrollScanKey
1 change: 1 addition & 0 deletions deployments/arb_sepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
421614
4 changes: 4 additions & 0 deletions deployments/arb_sepolia/Create2Factory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"address": "0xa6190aBC82427800935E0598892f7488a7F73A04",
"constructorArgs": "0x"
}
1 change: 1 addition & 0 deletions deployments/base_sepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
84532
4 changes: 4 additions & 0 deletions deployments/base_sepolia/Create2Factory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"address": "0xa6190aBC82427800935E0598892f7488a7F73A04",
"constructorArgs": "0x"
}
1 change: 1 addition & 0 deletions deployments/bnb_testnet/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
97
4 changes: 4 additions & 0 deletions deployments/bnb_testnet/Create2Factory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"address": "0xa6190aBC82427800935E0598892f7488a7F73A04",
"constructorArgs": "0x"
}
4 changes: 4 additions & 0 deletions deployments/eth_sepolia/Create2Factory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"address": "0xa6190aBC82427800935E0598892f7488a7F73A04",
"constructorArgs": "0x"
}
4 changes: 4 additions & 0 deletions deployments/op_sepolia/Create2Factory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"address": "0xa6190aBC82427800935E0598892f7488a7F73A04",
"constructorArgs": "0x"
}
1 change: 1 addition & 0 deletions deployments/scroll_sepolia/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
534351
4 changes: 4 additions & 0 deletions deployments/scroll_sepolia/Create2Factory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"address": "0xa6190aBC82427800935E0598892f7488a7F73A04",
"constructorArgs": "0x"
}
6 changes: 6 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ optimism = "${OPTIMISM_API}"
polygon = "${POLYGON_API}"
zkevm = "${ZKEVM_API}"
# Testnets
arb_sepolia = "${ARB_SEPOLIA_API}"
base_sepolia = "${BASE_SEPOLIA_API}"
eth_sepolia = "${ETH_SEPOLIA_API}"
op_sepolia = "${OP_SEPOLIA_API}"
scroll_sepolia = "${SCROLL_SEPOLIA_API}"

[etherscan]
arbitrum = { key = "${ARBITRUM_ETHERSCAN_KEY}", url = "${ARBITRUM_ETHERSCAN_URL}" }
Expand All @@ -69,5 +72,8 @@ optimism = { key = "${OPTIMISM_ETHERSCAN_KEY}", url = "${OPTIMISM_ETHERSCAN_URL}
polygon = { key = "${POLYGON_ETHERSCAN_KEY}", url = "${POLYGON_ETHERSCAN_URL}" }
zkevm = { key = "${ZKEVM_ETHERSCAN_KEY}", url = "${ZKEVM_ETHERSCAN_URL}" }
# Testnets
arb_sepolia = { key = "${ARB_SEPOLIA_ETHERSCAN_KEY}", url = "${ARB_SEPOLIA_ETHERSCAN_URL}" }
base_sepolia = { key = "${BASE_SEPOLIA_ETHERSCAN_KEY}", url = "${BASE_SEPOLIA_ETHERSCAN_URL}" }
eth_sepolia = { key = "${ETH_SEPOLIA_ETHERSCAN_KEY}", url = "${ETH_SEPOLIA_ETHERSCAN_URL}" }
op_sepolia = { key = "${OP_SEPOLIA_ETHERSCAN_KEY}", url = "${OP_SEPOLIA_ETHERSCAN_URL}" }
scroll_sepolia = { key = "${SCROLL_SEPOLIA_ETHERSCAN_KEY}", url = "${SCROLL_SEPOLIA_ETHERSCAN_URL}" }
25 changes: 25 additions & 0 deletions script/chain-id.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# This script fetches the cahin ID using cast and saves it to deployments/<chainName>/.chainId
# Usage: ./script/chain-id.sh <chainName>

# Colors
RED="\033[0;31m"
NC="\033[0m" # No Color

chainName=$1
# Check that chainName is passed
if [ -z "$chainName" ]; then
echo -e "${RED}Usage: ./script/chain-id.sh <chainName>${NC}"
exit 1
fi

# Fetch the RPC URL for the chain from .env
source .env
chainRpcEnv=${chainName^^}_API
chainRpc=${!chainRpcEnv}

# Create the deployments/<chainName> directory if it doesn't exist
mkdir -p "deployments/$chainName"
chainId=$(cast chain-id -r "$chainRpc")
# Print chainId without a newline
echo -n "$chainId" >"deployments/$chainName/.chainId"
Loading