-
Notifications
You must be signed in to change notification settings - Fork 38
[PT1-92] added automation scripts #206
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
Open
Sunnesoft
wants to merge
10
commits into
master
Choose a base branch
from
feature/deployment-automation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+12,599
−8,428
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
71844db
added automation scripts
Sunnesoft ad3cf26
fixed skip all
Sunnesoft 7d558e9
added suffix to deployment name; fixed Makefile
Sunnesoft ed0c148
fixed suffix parsing
Sunnesoft ba971e3
refactored constants; simplified makefile
Sunnesoft 2c6d4bb
added deployment automation for all contracts
Sunnesoft fa24581
fixed salt parser
Sunnesoft 8827635
updated solidity utils to 6.8.0
Sunnesoft e41a926
updated packages versions
Sunnesoft 1577f11
fixed pacjage.json
Sunnesoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -17,4 +17,5 @@ coverage.json | |
|
|
||
| .idea | ||
|
|
||
| .env | ||
| .env* | ||
| .yarn | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| nodeLinker: node-modules |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,298 @@ | ||
| # Conditionally include .env or .env.automation based on OPS_LAUNCH_MODE | ||
| ifeq ($(OPS_LAUNCH_MODE),auto) | ||
| -include .env.automation | ||
| else | ||
| -include .env | ||
| endif | ||
| export | ||
|
|
||
| OPS_NETWORK := $(subst ",,$(OPS_NETWORK)) | ||
| OPS_CHAIN_ID := $(subst ",,$(OPS_CHAIN_ID)) | ||
| OPS_KYC_TOKEN_SUFFIX := $(subst ",,$(OPS_KYC_TOKEN_SUFFIX)) | ||
| OPS_DEPLOYMENT_METHOD := $(subst ",,$(OPS_DEPLOYMENT_METHOD)) | ||
|
|
||
| CURRENT_DIR := $(shell pwd) | ||
|
|
||
| FILE_DEPLOY_KYC_NFT := $(CURRENT_DIR)/deploy/deploy-kyc-nft.js | ||
| FILE_DEPLOY_SETTLEMENT := $(CURRENT_DIR)/deploy/deploy-settlement.js | ||
| FILE_DEPLOY_POWER_POD := $(CURRENT_DIR)/deploy/deploy-power-pod.js | ||
| FILE_DEPLOY_WHITELIST_REGISTRY := $(CURRENT_DIR)/deploy/deploy-whitelist-registry.js | ||
| FILE_DEPLOY_CROSSCHAIN_WHITELIST := $(CURRENT_DIR)/deploy/deploy-crosschain-whitelist.js | ||
| FILE_DEPLOY_RESOLVER_METADATA := $(CURRENT_DIR)/deploy/deploy-resolver-metadata.js | ||
| FILE_CONSTANTS_JSON := $(CURRENT_DIR)/config/constants.json | ||
|
|
||
| ALL_DEPLOY_FILES := $(FILE_DEPLOY_KYC_NFT) $(FILE_DEPLOY_SETTLEMENT) $(FILE_DEPLOY_POWER_POD) $(FILE_DEPLOY_WHITELIST_REGISTRY) $(FILE_DEPLOY_CROSSCHAIN_WHITELIST) $(FILE_DEPLOY_RESOLVER_METADATA) | ||
|
|
||
| IS_ZKSYNC := $(findstring zksync,$(OPS_NETWORK)) | ||
|
|
||
| # Deployment targets | ||
| deploy-access-token: | ||
| @$(MAKE) OPS_CURRENT_DEP_FILE=$(FILE_DEPLOY_KYC_NFT) validate-access-token deploy-skip-all deploy-noskip deploy-impl deploy-skip | ||
|
|
||
| deploy-settlement: | ||
| @$(MAKE) OPS_CURRENT_DEP_FILE=$(FILE_DEPLOY_SETTLEMENT) validate-settlement deploy-skip-all deploy-noskip deploy-impl deploy-skip | ||
|
|
||
| deploy-power-pod: | ||
| @$(MAKE) OPS_CURRENT_DEP_FILE=$(FILE_DEPLOY_POWER_POD) validate-power-pod deploy-skip-all deploy-noskip deploy-impl deploy-skip | ||
|
|
||
| deploy-whitelist-registry: | ||
| @$(MAKE) OPS_CURRENT_DEP_FILE=$(FILE_DEPLOY_WHITELIST_REGISTRY) validate-whitelist-registry deploy-skip-all deploy-noskip deploy-impl deploy-skip | ||
|
|
||
| deploy-crosschain-whitelist: | ||
| @$(MAKE) OPS_CURRENT_DEP_FILE=$(FILE_DEPLOY_CROSSCHAIN_WHITELIST) validate-crosschain-whitelist deploy-skip-all deploy-noskip deploy-impl deploy-skip | ||
|
|
||
| deploy-resolver-metadata: | ||
| @$(MAKE) OPS_CURRENT_DEP_FILE=$(FILE_DEPLOY_RESOLVER_METADATA) validate-resolver-metadata deploy-skip-all deploy-noskip deploy-impl deploy-skip | ||
|
|
||
| deploy-impl: | ||
| @{ \ | ||
| yarn deploy $(OPS_NETWORK) || exit 1; \ | ||
| } | ||
|
|
||
| # Validation targets | ||
| validate-base: | ||
| @{ \ | ||
| $(MAKE) ID=OPS_NETWORK validate || exit 1; \ | ||
| $(MAKE) ID=OPS_CHAIN_ID validate || exit 1; \ | ||
| if [ "$(OPS_NETWORK)" = "hardhat" ]; then \ | ||
| $(MAKE) ID=MAINNET_RPC_URL validate || exit 1; \ | ||
| fi; \ | ||
| } | ||
|
|
||
| validate-access-token: | ||
| @{ \ | ||
| $(MAKE) validate-base || exit 1; \ | ||
| if [ "$(IS_ZKSYNC)" = "" ]; then \ | ||
| $(MAKE) ID=OPS_CREATE3_DEPLOYER_ADDRESS validate || exit 1; \ | ||
| $(MAKE) ID=OPS_KYC_TOKEN_SALT validate || exit 1; \ | ||
| fi; \ | ||
| $(MAKE) ID=OPS_KYC_TOKEN_OWNER_ADDRESS validate || exit 1; \ | ||
| $(MAKE) process-access-token-owner process-access-token-salt process-create3-deployer || exit 1; \ | ||
| } | ||
|
|
||
| validate-settlement: | ||
| @{ \ | ||
| $(MAKE) validate-base || exit 1; \ | ||
| $(MAKE) ID=OPS_ROUTER_V6_ADDRESS validate || exit 1; \ | ||
| $(MAKE) ID=OPS_ACCESS_TOKEN_ADDRESS validate || exit 1; \ | ||
| $(MAKE) ID=OPS_WETH_ADDRESS validate || exit 1; \ | ||
| $(MAKE) ID=OPS_SETTLEMENT_OWNER_ADDRESS validate || exit 1; \ | ||
| if [ "$(IS_ZKSYNC)" = "" ] && [ "$(OPS_DEPLOYMENT_METHOD)" != "create" ]; then \ | ||
| $(MAKE) ID=OPS_CREATE3_DEPLOYER_ADDRESS validate || exit 1; \ | ||
| $(MAKE) ID=OPS_SETTLEMENT_SALT validate || exit 1; \ | ||
| fi; \ | ||
| $(MAKE) process-router-v6 process-access-token-address process-weth process-settlement-owner process-settlement-salt process-create3-deployer || exit 1; \ | ||
| } | ||
|
|
||
| validate-power-pod: | ||
| @{ \ | ||
| $(MAKE) validate-base || exit 1; \ | ||
| $(MAKE) ID=OPS_ST1INCH_ADDRESS validate || exit 1; \ | ||
| $(MAKE) process-st1inch || exit 1; \ | ||
| } | ||
|
|
||
| validate-whitelist-registry: | ||
| @{ \ | ||
| $(MAKE) validate-base || exit 1; \ | ||
| $(MAKE) ID=OPS_POWER_POD_ADDRESS validate || exit 1; \ | ||
| $(MAKE) ID=OPS_DAO_ADDRESS validate || exit 1; \ | ||
| $(MAKE) process-power-pod process-dao || exit 1; \ | ||
| } | ||
|
|
||
| validate-crosschain-whitelist: | ||
| @{ \ | ||
| $(MAKE) validate-base || exit 1; \ | ||
| $(MAKE) ID=OPS_WHITELIST_REGISTRY_ADDRESS validate || exit 1; \ | ||
| $(MAKE) ID=OPS_DAO_ADDRESS validate || exit 1; \ | ||
| $(MAKE) process-whitelist-registry process-dao || exit 1; \ | ||
| } | ||
|
|
||
| validate-resolver-metadata: | ||
| @{ \ | ||
| $(MAKE) validate-base || exit 1; \ | ||
| $(MAKE) ID=OPS_POWER_POD_ADDRESS validate || exit 1; \ | ||
| $(MAKE) process-power-pod || exit 1; \ | ||
| } | ||
|
|
||
| # Process constant functions | ||
| process-access-token-owner: | ||
| @$(MAKE) OPS_GEN_KEY='accessTokenOwner' OPS_GEN_VAL='$(OPS_KYC_TOKEN_OWNER_ADDRESS)' upsert-constant | ||
|
|
||
| process-access-token-salt: | ||
| @$(MAKE) OPS_GEN_KEY='accessTokenSalt' OPS_GEN_VAL='$(OPS_KYC_TOKEN_SALT)' upsert-constant | ||
|
|
||
| process-access-token-address: | ||
| @$(MAKE) OPS_GEN_KEY='accessTokenAddress' OPS_GEN_VAL='$(OPS_ACCESS_TOKEN_ADDRESS)' upsert-constant | ||
|
|
||
| process-router-v6: | ||
| @$(MAKE) OPS_GEN_KEY='routerV6Address' OPS_GEN_VAL='$(OPS_ROUTER_V6_ADDRESS)' upsert-constant | ||
|
|
||
| process-weth: | ||
| @$(MAKE) OPS_GEN_KEY='weth' OPS_GEN_VAL='$(OPS_WETH_ADDRESS)' upsert-constant | ||
|
|
||
| process-st1inch: | ||
| @$(MAKE) OPS_GEN_KEY='st1inchAddr' OPS_GEN_VAL='$(OPS_ST1INCH_ADDRESS)' upsert-constant | ||
|
|
||
| process-power-pod: | ||
| @$(MAKE) OPS_GEN_KEY='powerPodAddress' OPS_GEN_VAL='$(OPS_POWER_POD_ADDRESS)' upsert-constant | ||
|
|
||
| process-dao: | ||
| @$(MAKE) OPS_GEN_KEY='daoAddress' OPS_GEN_VAL='$(OPS_DAO_ADDRESS)' upsert-constant | ||
|
|
||
| process-whitelist-registry: | ||
| @$(MAKE) OPS_GEN_KEY='whitelistRegistryAddress' OPS_GEN_VAL='$(OPS_WHITELIST_REGISTRY_ADDRESS)' upsert-constant | ||
|
|
||
| process-settlement-owner: | ||
| @$(MAKE) OPS_GEN_KEY='settlementOwnerAddress' OPS_GEN_VAL='$(OPS_SETTLEMENT_OWNER_ADDRESS)' upsert-constant | ||
|
|
||
| process-settlement-salt: | ||
| @{ \ | ||
| if [ -n "$$OPS_FEE_TAKER_SALT" ]; then \ | ||
| $(MAKE) OPS_GEN_KEY='settlementSalt' OPS_GEN_VAL='$(OPS_SETTLEMENT_SALT)' upsert-constant; \ | ||
| fi \ | ||
| } | ||
|
|
||
| process-create3-deployer: | ||
| @{ \ | ||
| if [ -n "$$OPS_CREATE3_DEPLOYER_ADDRESS" ]; then \ | ||
| $(MAKE) OPS_GEN_KEY='create3Deployers' OPS_GEN_VAL='$(OPS_CREATE3_DEPLOYER_ADDRESS)' upsert-constant; \ | ||
| fi \ | ||
| } | ||
|
|
||
| upsert-constant: | ||
| @{ \ | ||
| $(MAKE) ID=OPS_GEN_VAL validate || exit 1; \ | ||
| $(MAKE) ID=OPS_GEN_KEY validate || exit 1; \ | ||
| $(MAKE) ID=OPS_CHAIN_ID validate || exit 1; \ | ||
| tmpfile=$$(mktemp); \ | ||
| jq '.$(OPS_GEN_KEY)."$(OPS_CHAIN_ID)" = $(OPS_GEN_VAL)' $(FILE_CONSTANTS_JSON) > $$tmpfile && mv $$tmpfile $(FILE_CONSTANTS_JSON); \ | ||
| echo "Updated $(OPS_GEN_KEY)[$(OPS_CHAIN_ID)] = $(OPS_GEN_VAL)"; \ | ||
| } | ||
|
|
||
| deploy-skip-all: | ||
| @{ \ | ||
| for secret in $(ALL_DEPLOY_FILES); do \ | ||
| $(MAKE) OPS_CURRENT_DEP_FILE=$$secret deploy-skip; \ | ||
| done \ | ||
| } | ||
|
|
||
| deploy-skip: | ||
| @sed -i '' 's/module.exports.skip.*/module.exports.skip = async () => true;/g' $(OPS_CURRENT_DEP_FILE) | ||
|
|
||
| deploy-noskip: | ||
| @sed -i '' 's/module.exports.skip.*/module.exports.skip = async () => false;/g' $(OPS_CURRENT_DEP_FILE) | ||
Sunnesoft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| install: install-utils install-dependencies | ||
|
|
||
| install-utils: | ||
| brew install yarn wget jq | ||
|
|
||
| install-dependencies: | ||
| yarn | ||
|
|
||
| clean: | ||
| @rm -Rf $(CURRENT_DIR)/deployments/$(OPS_NETWORK)/* | ||
|
|
||
|
|
||
| get: | ||
| @{ \ | ||
| $(MAKE) ID=PARAMETER validate || exit 1; \ | ||
| $(MAKE) ID=OPS_NETWORK validate || exit 1; \ | ||
| if [ ! -d "$(CURRENT_DIR)/deployments/$(OPS_NETWORK)" ]; then \ | ||
| echo "Error: Directory $(CURRENT_DIR)/deployments/$(OPS_NETWORK) does not exist"; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| CONTRACT_FILE=""; \ | ||
| contracts_list=$$(ls $(CURRENT_DIR)/deployments/$(OPS_NETWORK)/*.json | xargs -n1 basename | sed 's/\.json$$//'); \ | ||
| found=0; \ | ||
| for contract in $$contracts_list; do \ | ||
| contract_upper=$$(echo $$contract | sed 's/\([A-Z]\)/_\1/g' | sed 's/^_//' | tr 'a-z' 'A-Z'); \ | ||
| if [ "$(PARAMETER)" = "OPS_$${contract_upper}_ADDRESS" ]; then \ | ||
| CONTRACT_FILE="$${contract}.json"; \ | ||
| found=1; \ | ||
| break; \ | ||
| fi; \ | ||
| done; \ | ||
| if [ "$$found" -eq 0 ]; then \ | ||
| echo "Error: Unknown parameter $(PARAMETER)"; exit 1; \ | ||
| fi; \ | ||
| DEPLOYMENT_FILE="$(CURRENT_DIR)/deployments/$(OPS_NETWORK)/$$CONTRACT_FILE"; \ | ||
| if [ ! -f "$$DEPLOYMENT_FILE" ]; then \ | ||
| echo "Error: Deployment file $$DEPLOYMENT_FILE not found"; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| ADDRESS=$$(cat "$$DEPLOYMENT_FILE" | grep '"address"' | head -1 | sed 's/.*"address": *"\([^"]*\)".*/\1/'); \ | ||
| echo "$$ADDRESS"; \ | ||
| } | ||
|
|
||
| get-outputs: | ||
| @{ \ | ||
| $(MAKE) ID=OPS_NETWORK validate || exit 1; \ | ||
| if [ ! -d "$(CURRENT_DIR)/deployments/$(OPS_NETWORK)" ]; then \ | ||
| echo "Error: Directory $(CURRENT_DIR)/deployments/$(OPS_NETWORK) does not exist"; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| result="{"; \ | ||
| first=1; \ | ||
| for file in $(CURRENT_DIR)/deployments/$(OPS_NETWORK)/*.json; do \ | ||
| filename=$$(basename $$file .json); \ | ||
| key="OPS_$$(echo $$filename | sed 's/\([A-Z]\)/_\1/g' | sed 's/^_//' | tr 'a-z' 'A-Z')_ADDRESS"; \ | ||
| if [ $$first -eq 1 ]; then \ | ||
| result="$$result\"$$key\": \"$$key\""; \ | ||
| first=0; \ | ||
| else \ | ||
| result="$$result, \"$$key\": \"$$key\""; \ | ||
| fi; \ | ||
| done; \ | ||
| result="$$result}"; \ | ||
| echo "$$result"; \ | ||
| } | ||
|
|
||
| validate: | ||
| @{ \ | ||
| VALUE=$$(echo "$${!ID}" | tr -d '"'); \ | ||
| if [ -z "$${VALUE}" ]; then \ | ||
| echo "$${ID} is not set (Value: '$${VALUE}')!"; \ | ||
| exit 1; \ | ||
| fi; \ | ||
| } | ||
|
|
||
| help: | ||
| @echo "Available targets:" | ||
| @echo " deploy-access-token Deploy access token contracts" | ||
| @echo " deploy-settlement Deploy settlement contract" | ||
| @echo " deploy-power-pod Deploy power pod contract" | ||
| @echo " deploy-whitelist-registry Deploy whitelist registry contract" | ||
| @echo " deploy-crosschain-whitelist Deploy crosschain whitelist contract" | ||
| @echo " deploy-resolver-metadata Deploy resolver metadata contract" | ||
| @echo " validate-base Validate base required environment variables" | ||
| @echo " validate-access-token Validate access token deployment variables" | ||
| @echo " validate-settlement Validate settlement deployment variables" | ||
| @echo " validate-power-pod Validate power pod deployment variables" | ||
| @echo " validate-whitelist-registry Validate whitelist registry deployment variables" | ||
| @echo " validate-crosschain-whitelist Validate crosschain whitelist deployment variables" | ||
| @echo " validate-resolver-metadata Validate resolver metadata deployment variables" | ||
| @echo " process-access-token-owner Update access token owner constant" | ||
| @echo " process-access-token-salt Update access token salt constant" | ||
| @echo " process-settlement-owner Update settlement owner constant" | ||
| @echo " process-settlement-salt Update settlement salt constant" | ||
| @echo " process-router-v6 Update router V6 address constant" | ||
| @echo " process-weth Update WETH address constant" | ||
| @echo " process-st1inch Update st1INCH address constant" | ||
| @echo " process-power-pod Update PowerPod address constant" | ||
| @echo " process-dao Update DAO address constant" | ||
| @echo " process-whitelist-registry Update WhitelistRegistry address constant" | ||
| @echo " process-create3-deployer Update create3 deployer constant" | ||
| @echo " upsert-constant Upsert constant value in JSON file" | ||
| @echo " deploy-skip-all Mark all deploy files as skipped" | ||
| @echo " deploy-skip Mark current deploy file as skipped" | ||
| @echo " deploy-noskip Mark current deploy file as not skipped" | ||
| @echo " install Install utils and dependencies" | ||
| @echo " install-utils Install required utilities" | ||
| @echo " install-dependencies Install yarn dependencies" | ||
| @echo " clean Remove deployment files" | ||
| @echo " get PARAMETER=... Get deployed contract address" | ||
| @echo " help Show this help message" | ||
|
|
||
|
|
||
| .PHONY: help deploy-access-token deploy-settlement deploy-power-pod deploy-whitelist-registry deploy-crosschain-whitelist deploy-resolver-metadata deploy-impl validate-base validate-access-token validate-settlement validate-power-pod validate-whitelist-registry validate-crosschain-whitelist validate-resolver-metadata process-access-token-owner process-access-token-salt process-access-token-address process-settlement-owner process-settlement-salt process-router-v6 process-weth process-st1inch process-power-pod process-dao process-whitelist-registry process-create3-deployer upsert-constant deploy-skip-all deploy-skip deploy-noskip install install-utils install-dependencies clean get get-outputs validate | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| const constants = require('./constants.json'); | ||
|
|
||
| module.exports = { | ||
| ACCESS_TOKEN_SALT: constants.accessTokenSalt || {}, | ||
| ACCESS_TOKEN_OWNER: constants.accessTokenOwner || {}, | ||
| CREATE3_DEPLOYERS: constants.create3Deployers || {}, | ||
| SETTLEMENT_SALT: constants.settlementSalt || {}, | ||
| SETTLEMENT_OWNER_ADDRESS: constants.settlementOwnerAddress || {}, | ||
| ACCESS_TOKEN_ADDRESS: constants.accessTokenAddress || {}, | ||
| WETH: constants.weth || {}, | ||
| ROUTER_V6_ADDRESS: constants.routerV6Address || {}, | ||
| ST1INCH_ADDR: constants.st1inchAddr || {}, | ||
| DAO_ADDRESS: constants.daoAddress || {}, | ||
| POWER_POD_ADDRESS: constants.powerPodAddress || {}, | ||
| WHITELIST_REGISTRY_ADDRESS: constants.whitelistRegistryAddress || {}, | ||
| }; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "accessTokenSalt": { | ||
| "31337": "0xfd0450e10366502b67f46a6037db5b90d1cad2d4a744b961f7986bf35f4d35d7" | ||
| }, | ||
| "accessTokenOwner": { | ||
| "31337": "0x56E44874F624EbDE6efCc783eFD685f0FBDC6dcF" | ||
| }, | ||
| "create3Deployers": { | ||
| "31337": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "1": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "56": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "137": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "42161": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "10": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "43114": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "100": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "250": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "1313161554": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "8217": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "8453": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "59144": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "146": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65", | ||
| "130": "0xD935a2bb926019E0ed6fb31fbD5b1Bbb7c05bf65" | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| const hre = require('hardhat'); | ||
| const { deployAndGetContract } = require('@1inch/solidity-utils'); | ||
| const constants = require('../config/constants'); | ||
| const { getChainId } = hre; | ||
|
|
||
| module.exports = async ({ getNamedAccounts, deployments }) => { | ||
| const networkName = hre.network.name; | ||
| console.log(`running ${networkName} deploy script`); | ||
| const chainId = await getChainId(); | ||
| console.log('network id ', chainId); | ||
|
|
||
| if ( | ||
| networkName in hre.config.networks && | ||
| chainId !== hre.config.networks[networkName].chainId?.toString() | ||
| ) { | ||
| console.log(`network chain id: ${hre.config.networks[networkName].chainId}, your chain id ${chainId}`); | ||
| console.log('skipping wrong chain id deployment'); | ||
| return; | ||
| } | ||
|
|
||
| const { deployer } = await getNamedAccounts(); | ||
|
|
||
| const whitelist = await deployAndGetContract({ | ||
| contractName: 'CrosschainWhitelistRegistry', | ||
| constructorArgs: [constants.WHITELIST_REGISTRY_ADDRESS[chainId]], | ||
| deployments, | ||
| deployer, | ||
| deploymentName: 'CrosschainWhitelistRegistry', | ||
| }); | ||
|
|
||
| const tx = await whitelist.transferOwnership(constants.DAO_ADDRESS[chainId]); | ||
| await tx.wait(); | ||
| console.log(`Ownership has been successfully transferred to ${constants.DAO_ADDRESS[chainId]}`); | ||
| }; | ||
|
|
||
| module.exports.skip = async () => true; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.