From a450f97acba8b4caf38a54969afe1a15c8e5606f Mon Sep 17 00:00:00 2001 From: Shebin John Date: Fri, 4 Oct 2024 10:54:28 +0200 Subject: [PATCH] Adding custom deployment script command --- modules/4337/package.json | 1 + modules/allowances/.env.sample | 1 + modules/allowances/hardhat.config.ts | 12 +++++++++++- modules/allowances/package.json | 1 + modules/passkey/package.json | 1 + modules/recovery/package.json | 1 + 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/4337/package.json b/modules/4337/package.json index 1a969b23..eb6fac69 100644 --- a/modules/4337/package.json +++ b/modules/4337/package.json @@ -24,6 +24,7 @@ "benchmark": "pnpm run test test/gas/*.ts", "deploy-all": "hardhat deploy-contracts --network", "deploy": "hardhat deploy --network", + "deploy-custom": "rm -rf deployments/custom && npm run deploy custom", "lint": "pnpm run lint:sol && npm run lint:ts", "lint:sol": "solhint 'contracts/**/*.sol'", "lint:ts": "eslint ./src && eslint ./test", diff --git a/modules/allowances/.env.sample b/modules/allowances/.env.sample index c3c43746..d069fcb9 100644 --- a/modules/allowances/.env.sample +++ b/modules/allowances/.env.sample @@ -1,3 +1,4 @@ MNEMONIC= INFURA_KEY= ETHERSCAN_API_KEY= +CUSTOM_NODE_URL= diff --git a/modules/allowances/hardhat.config.ts b/modules/allowances/hardhat.config.ts index 8a6d5c4b..47b16e91 100644 --- a/modules/allowances/hardhat.config.ts +++ b/modules/allowances/hardhat.config.ts @@ -8,7 +8,7 @@ import { getSingletonFactoryInfo } from '@safe-global/safe-singleton-factory' dotenv.config() -const { INFURA_KEY, MNEMONIC, ETHERSCAN_API_KEY } = process.env +const { INFURA_KEY, MNEMONIC, ETHERSCAN_API_KEY, CUSTOM_NODE_URL } = process.env const sharedNetworkConfig: HttpNetworkUserConfig = { accounts: { @@ -18,6 +18,15 @@ const sharedNetworkConfig: HttpNetworkUserConfig = { }, } +const customNetwork = CUSTOM_NODE_URL + ? { + custom: { + ...sharedNetworkConfig, + url: CUSTOM_NODE_URL, + }, + } + : {} + const config: HardhatUserConfig = { paths: { artifacts: 'build/artifacts', @@ -77,6 +86,7 @@ const config: HardhatUserConfig = { ...sharedNetworkConfig, url: `https://api.avax.network/ext/bc/C/rpc`, }, + ...customNetwork, }, deterministicDeployment, namedAccounts: { diff --git a/modules/allowances/package.json b/modules/allowances/package.json index 365b3d51..3243e7fb 100644 --- a/modules/allowances/package.json +++ b/modules/allowances/package.json @@ -14,6 +14,7 @@ "test": "hardhat test", "coverage": "hardhat coverage", "deploy": "hardhat deploy-verify --network", + "deploy-custom": "rm -rf deployments/custom && npm run deploy custom", "prepare": "pnpm run clean && npm run build", "lint": "pnpm run lint:sol && npm run lint:ts", "lint:sol": "solhint 'contracts/**/*.sol'", diff --git a/modules/passkey/package.json b/modules/passkey/package.json index 220312a3..1083ec79 100644 --- a/modules/passkey/package.json +++ b/modules/passkey/package.json @@ -34,6 +34,7 @@ "codesize": "hardhat codesize", "deploy-all": "hardhat deploy-contracts --network", "deploy": "hardhat deploy --network", + "deploy-custom": "rm -rf deployments/custom && npm run deploy custom", "fmt": "prettier --write .", "fmt:check": "prettier --check .", "lint": "pnpm run lint:sol && pnpm run lint:ts", diff --git a/modules/recovery/package.json b/modules/recovery/package.json index 1e04ca7c..c4cf061f 100644 --- a/modules/recovery/package.json +++ b/modules/recovery/package.json @@ -16,6 +16,7 @@ "build:sol": "rimraf build typechain-types && hardhat compile", "build:ts": "rimraf dist && tsc", "deploy-all": "hardhat deploy-contracts --network", + "deploy-custom": "rm -rf deployments/custom && npm run deploy custom", "lint": "pnpm run lint:ts", "lint:ts": "eslint ./src", "lint:fix": "eslint ./src --fix",