From c0a68cf5bbc68c958822c7217e99a103443066f3 Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Mon, 25 Nov 2024 16:16:43 -0500 Subject: [PATCH 1/2] Quick deploy enroll verify pipeline --- deploy.sh | 13 +++++++++++++ enroll.sh | 18 ++++++++++++++++++ hyperlane-arbiters.yaml | 3 +++ verify.sh | 18 ++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100755 deploy.sh create mode 100755 enroll.sh create mode 100644 hyperlane-arbiters.yaml create mode 100755 verify.sh diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..c786817 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,13 @@ +# deploy.sh +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 diff --git a/enroll.sh b/enroll.sh new file mode 100755 index 0000000..6e34f4e --- /dev/null +++ b/enroll.sh @@ -0,0 +1,18 @@ +# enroll.sh +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 diff --git a/hyperlane-arbiters.yaml b/hyperlane-arbiters.yaml new file mode 100644 index 0000000..87a7721 --- /dev/null +++ b/hyperlane-arbiters.yaml @@ -0,0 +1,3 @@ +optimism: 0x57F0638d4fba79DB978c4eE1B73d469ea21014b2 +ethereum: 0x088470910056221862d18fF2e65ffaeC96ec6dA4 +base: 0x43b60b47764B6460c96349A1B414214BBa7F22c9 diff --git a/verify.sh b/verify.sh new file mode 100755 index 0000000..9cdb5fd --- /dev/null +++ b/verify.sh @@ -0,0 +1,18 @@ +# verify.sh +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 From ea9a4e4695c7cd8fd0ee32523aac3cc003c6e300 Mon Sep 17 00:00:00 2001 From: Yorke Rhodes Date: Mon, 2 Dec 2024 17:09:09 -0500 Subject: [PATCH 2/2] Update deploy artifacts --- hyperlane-arbiters.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hyperlane-arbiters.yaml b/hyperlane-arbiters.yaml index 87a7721..fc0c7b1 100644 --- a/hyperlane-arbiters.yaml +++ b/hyperlane-arbiters.yaml @@ -1,3 +1,3 @@ -optimism: 0x57F0638d4fba79DB978c4eE1B73d469ea21014b2 -ethereum: 0x088470910056221862d18fF2e65ffaeC96ec6dA4 -base: 0x43b60b47764B6460c96349A1B414214BBa7F22c9 +base: 0x92977f79ec5F085EEB32F464Cadf041aFd6cEEcc +ethereum: 0x7744381d9E068653FDB46a56320466aA16672f49 +optimism: 0x7968d0E0C3cee60921865E0B32fb50276d126DdE