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

Quick deploy enroll verify pipeline #4

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
13 changes: 13 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# deploy.sh <CHAIN>
CHAIN=$1

THE_COMPACT_ADDRESS=0x00000000000018DF021Ff2467dF97ff846E09f48
MAILBOX_ADDRESS=$(cat ~/.hyperlane/chains/$CHAIN/addresses.yaml | yq '.mailbox')
RPC_URL=$(cat ~/.hyperlane/chains/$CHAIN/metadata.yaml | yq '.rpcUrls[0].http')
HYP_KEY=$(gcloud secrets versions access latest --secret "hyperlane-mainnet3-key-deployer" | jq ".privateKey" -c -r)
ARBITER_ADDRESS=$(forge create HyperlaneArbiter --json \
--rpc-url $RPC_URL \
--private-key $HYP_KEY \
--constructor-args $MAILBOX_ADDRESS $THE_COMPACT_ADDRESS \
| jq -r '.deployedTo')
echo "$CHAIN: $ARBITER_ADDRESS" >> hyperlane-arbiters.yaml
18 changes: 18 additions & 0 deletions enroll.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# enroll.sh <CHAIN> <CHAINS>
CHAIN=$1
CHAINS=$2

RPC_URL=$(cat ~/.hyperlane/chains/$CHAIN/metadata.yaml | yq '.rpcUrls[0].http')
HYP_KEY=$(gcloud secrets versions access latest --secret "hyperlane-mainnet3-key-deployer" | jq ".privateKey" -c -r)
ARBITER_ADDRESS=$(cat hyperlane-arbiters.yaml | yq ".$CHAIN")

# loop over each chain in chains
for DESTINATION in $CHAINS; do
DESTINATION_DOMAIN=$(cat ~/.hyperlane/chains/$DESTINATION/metadata.yaml | yq '.domainId')
ROUTER_ADDRESS=$(cat hyperlane-arbiters.yaml | yq ".$DESTINATION")
echo "Enrolling $DESTINATION on $CHAIN"
cast send $ARBITER_ADDRESS \
--rpc-url $RPC_URL \
--private-key $HYP_KEY \
"enrollRemoteRouter(uint32,bytes32)" $DESTINATION_DOMAIN $(yarn leftpad $ROUTER_ADDRESS)
done
3 changes: 3 additions & 0 deletions hyperlane-arbiters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
base: 0x92977f79ec5F085EEB32F464Cadf041aFd6cEEcc
ethereum: 0x7744381d9E068653FDB46a56320466aA16672f49
optimism: 0x7968d0E0C3cee60921865E0B32fb50276d126DdE
18 changes: 18 additions & 0 deletions verify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# verify.sh <CHAIN>
CHAIN=$1

set -x

THE_COMPACT_ADDRESS=0x00000000000018DF021Ff2467dF97ff846E09f48
MAILBOX_ADDRESS=$(cat ~/.hyperlane/chains/$CHAIN/addresses.yaml | yq '.mailbox')
ARBITER_ADDRESS=$(cat hyperlane-arbiters.yaml | yq ".$CHAIN")
RPC_URL=$(cat ~/.hyperlane/chains/$CHAIN/metadata.yaml | yq '.rpcUrls[0].http')
ETHERSCAN_API_KEY=$(gcloud secrets versions access latest --secret "explorer-api-keys" | jq -r ".$CHAIN")

CONSTRUCTOR_ARGS=$(cast abi-encode "constructor(address,address)" $MAILBOX_ADDRESS $THE_COMPACT_ADDRESS)

forge verify-contract $ARBITER_ADDRESS \
--rpc-url $RPC_URL \
--verifier-api-key $ETHERSCAN_API_KEY \
--constructor-args $CONSTRUCTOR_ARGS \
--watch
Loading