From 3c41a8f2eca5c52b19cfa1fe46b4d6f6d09e333e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dan?= Date: Fri, 16 Jun 2023 14:01:26 -0400 Subject: [PATCH] chore: remove unused script --- package.json | 1 - scripts/predict-const-address.ts | 52 -------------------------------- 2 files changed, 53 deletions(-) delete mode 100644 scripts/predict-const-address.ts diff --git a/package.json b/package.json index 25956c9..8e4999d 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "lint:sol:fix": "npm run lint:sol -- --fix", "lint:ts": "eslint --ext .ts .", "lint:ts:fix": "npm run lint:ts -- --fix", - "predict-const-address": "ts-node scripts/predict-const-address.ts", "register-subnet": "ts-node scripts/register-subnet.ts", "test": "hardhat test" }, diff --git a/scripts/predict-const-address.ts b/scripts/predict-const-address.ts deleted file mode 100644 index 165360c..0000000 --- a/scripts/predict-const-address.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { utils, Wallet } from 'ethers' -import fs from 'fs' - -import { - Arg, - ContractOutputJSON, - predictContractConstant, -} from './const-addr-deployer' - -const main = async function (..._args: Arg[]) { - const [contractJsonPath, salt, ...args] = _args - const privateKey = process.env.PRIVATE_KEY - - if (!privateKey || !utils.isHexString(privateKey, 32)) { - console.error('ERROR: Please provide a valid private key! (PRIVATE_KEY)') - return - } - - const wallet = new Wallet(process.env.PRIVATE_KEY || '') - - let rawdata - try { - rawdata = fs.readFileSync(contractJsonPath) - } catch (error) { - console.error( - `ERROR: Could not find a contract JSON file at ${contractJsonPath}` - ) - return - } - - let contractJson: ContractOutputJSON - try { - contractJson = JSON.parse(rawdata.toString()) - } catch (error) { - console.error( - `ERROR: Could not parse the contract JSON file found at ${contractJsonPath}` - ) - return - } - - const address = await predictContractConstant( - wallet, - contractJson, - salt, - args - ).catch(console.error) - - return address -} - -const args = process.argv.slice(2) -main(...args)