From 3e0aa7784c9d19399fd0bc173a1d9f78f96f9a86 Mon Sep 17 00:00:00 2001 From: Shebin John Date: Fri, 4 Oct 2024 17:51:07 +0200 Subject: [PATCH] Adding custom deployment script command (#497) While creating custom deployments for the module, the command for the same was missing from `package.json`, this PR adds the same to all the modules. Additional: - Path update for Certora conf - Certora Version Update --- modules/4337/certora/conf/Safe4337Module.conf | 2 +- modules/4337/certora/conf/SignatureLengthCheck.conf | 2 +- .../certora/conf/TransactionExecutionMethods.conf | 2 +- .../4337/certora/conf/ValidationDataLastBitOne.conf | 2 +- modules/4337/certora/requirements.txt | 2 +- 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 + 11 files changed, 21 insertions(+), 6 deletions(-) diff --git a/modules/4337/certora/conf/Safe4337Module.conf b/modules/4337/certora/conf/Safe4337Module.conf index d0786b27..2211712c 100644 --- a/modules/4337/certora/conf/Safe4337Module.conf +++ b/modules/4337/certora/conf/Safe4337Module.conf @@ -18,6 +18,6 @@ "verify": "Safe4337Module:certora/specs/Safe4337Module.spec", "packages": [ "@account-abstraction=../../node_modules/.pnpm/@account-abstraction+contracts@0.7.0/node_modules/@account-abstraction", - "@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@6.0.4_/node_modules/@safe-global" + "@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@5.0.10_/node_modules/@safe-global" ] } diff --git a/modules/4337/certora/conf/SignatureLengthCheck.conf b/modules/4337/certora/conf/SignatureLengthCheck.conf index 0d11133f..b7090c48 100644 --- a/modules/4337/certora/conf/SignatureLengthCheck.conf +++ b/modules/4337/certora/conf/SignatureLengthCheck.conf @@ -11,6 +11,6 @@ "verify": "Safe4337ModuleHarness:certora/specs/SignatureLengthCheck.spec", "packages": [ "@account-abstraction=../../node_modules/.pnpm/@account-abstraction+contracts@0.7.0/node_modules/@account-abstraction", - "@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@6.0.4_/node_modules/@safe-global" + "@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@5.0.10_/node_modules/@safe-global" ] } diff --git a/modules/4337/certora/conf/TransactionExecutionMethods.conf b/modules/4337/certora/conf/TransactionExecutionMethods.conf index c0632071..baa46389 100644 --- a/modules/4337/certora/conf/TransactionExecutionMethods.conf +++ b/modules/4337/certora/conf/TransactionExecutionMethods.conf @@ -18,6 +18,6 @@ "verify": "Safe4337Module:certora/specs/TransactionExecutionMethods.spec", "packages": [ "@account-abstraction=../../node_modules/.pnpm/@account-abstraction+contracts@0.7.0/node_modules/@account-abstraction", - "@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@6.0.4_/node_modules/@safe-global" + "@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@5.0.10_/node_modules/@safe-global" ] } diff --git a/modules/4337/certora/conf/ValidationDataLastBitOne.conf b/modules/4337/certora/conf/ValidationDataLastBitOne.conf index 8cca2072..71ad0c5f 100644 --- a/modules/4337/certora/conf/ValidationDataLastBitOne.conf +++ b/modules/4337/certora/conf/ValidationDataLastBitOne.conf @@ -18,6 +18,6 @@ "verify": "Safe4337Module:certora/specs/ValidationDataLastBitOne.spec", "packages": [ "@account-abstraction=../../node_modules/.pnpm/@account-abstraction+contracts@0.7.0/node_modules/@account-abstraction", - "@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@6.0.4_/node_modules/@safe-global" + "@safe-global=../../node_modules/.pnpm/@safe-global+safe-contracts@1.4.1-build.0_ethers@6.13.1_bufferutil@4.0.8_utf-8-validate@5.0.10_/node_modules/@safe-global" ] } diff --git a/modules/4337/certora/requirements.txt b/modules/4337/certora/requirements.txt index df37fea8..b5c9c5e0 100644 --- a/modules/4337/certora/requirements.txt +++ b/modules/4337/certora/requirements.txt @@ -1 +1 @@ -certora-cli==7.10.1 +certora-cli==7.14.3 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",