From dd2d061348c9c19b75fffa528b6bc4741a78f0aa Mon Sep 17 00:00:00 2001 From: invocamanman Date: Fri, 30 Jun 2023 13:31:04 +0200 Subject: [PATCH] update configs --- hardhat.config.js | 301 +++++++++++++++++++++++----------------------- package.json | 4 +- 2 files changed, 154 insertions(+), 151 deletions(-) diff --git a/hardhat.config.js b/hardhat.config.js index ff6d02c08..622a4f6a6 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -17,158 +17,159 @@ const DEFAULT_MNEMONIC = 'test test test test test test test test test test test * @type import('hardhat/config').HardhatUserConfig */ module.exports = { - dependencyCompiler: { - paths: [ - '@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol', - '@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol', - '@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol' - ]//, - //keep: true - }, - solidity: { - compilers: [ - { - version: "0.8.17", - settings: { - optimizer: { - enabled: true, - runs: 999999 - } - } - }, - { - version: "0.6.11", - settings: { - optimizer: { - enabled: true, - runs: 999999 - } - } - }, - { - version: "0.5.12", - settings: { - optimizer: { - enabled: true, - runs: 999999 - } - } - }, - { - version: "0.5.16", - settings: { - optimizer: { - enabled: true, - runs: 999999 - } - } - } - ] - }, - networks: { - mainnet: { - url: `https://mainnet.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, - accounts: { - mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, - path: "m/44'/60'/0'/0", - initialIndex: 0, - count: 20, - }, + dependencyCompiler: { + paths: [ + '@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol', + '@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol', + '@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol', + ], // , + // keep: true }, - ropsten: { - url: `https://ropsten.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, - accounts: { - mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, - path: "m/44'/60'/0'/0", - initialIndex: 0, - count: 20, - }, + solidity: { + compilers: [ + { + version: '0.8.17', + settings: { + optimizer: { + enabled: true, + runs: 999999, + }, + }, + }, + { + version: '0.6.11', + settings: { + optimizer: { + enabled: true, + runs: 999999, + }, + }, + }, + { + version: '0.5.12', + settings: { + optimizer: { + enabled: true, + runs: 999999, + }, + }, + }, + { + version: '0.5.16', + settings: { + optimizer: { + enabled: true, + runs: 999999, + }, + }, + }, + ], }, - goerli: { - url: `https://goerli.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, - accounts: { - mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, - path: "m/44'/60'/0'/0", - initialIndex: 0, - count: 20, - }, + networks: { + mainnet: { + url: process.env.MAINNET_PROVIDER ? process.env.MAINNET_PROVIDER : `https://mainnet.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + accounts: { + mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, + path: "m/44'/60'/0'/0", + initialIndex: 0, + count: 20, + }, + }, + ropsten: { + url: process.env.ROPSTEN_PROVIDER ? process.env.ROPSTEN_PROVIDER : `https://ropsten.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + accounts: { + mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, + path: "m/44'/60'/0'/0", + initialIndex: 0, + count: 20, + }, + }, + goerli: { + url: process.env.GOERLI_PROVIDER ? process.env.GOERLI_PROVIDER : `https://goerli.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + accounts: { + mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, + path: "m/44'/60'/0'/0", + initialIndex: 0, + count: 20, + }, + }, + rinkeby: { + url: process.env.RINKEBY_PROVIDER ? process.env.RINKEBY_PROVIDER : `https://rinkeby.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, + accounts: { + mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, + path: "m/44'/60'/0'/0", + initialIndex: 0, + count: 20, + }, + }, + localhost: { + url: 'http://127.0.0.1:8545', + accounts: { + mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, + path: "m/44'/60'/0'/0", + initialIndex: 0, + count: 20, + }, + }, + hardhat: { + initialDate: '0', + allowUnlimitedContractSize: true, + initialBaseFeePerGas: '0', + accounts: { + mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, + path: "m/44'/60'/0'/0", + initialIndex: 0, + count: 20, + }, + }, + polygonZKEVMTestnet: { + url: 'https://rpc.public.zkevm-test.net', + accounts: { + mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, + path: "m/44'/60'/0'/0", + initialIndex: 0, + count: 20, + }, + }, + polygonZKEVMMainnet: { + url: 'https://zkevm-rpc.com', + accounts: { + mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, + path: "m/44'/60'/0'/0", + initialIndex: 0, + count: 20, + }, + }, }, - rinkeby: { - url: `https://rinkeby.infura.io/v3/${process.env.INFURA_PROJECT_ID}`, - accounts: { - mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, - path: "m/44'/60'/0'/0", - initialIndex: 0, - count: 20, - }, + gasReporter: { + enabled: !!process.env.REPORT_GAS, + outputFile: process.env.REPORT_GAS_FILE ? './gas_report.md' : null, + noColors: !!process.env.REPORT_GAS_FILE, }, - localhost: { - url: 'http://127.0.0.1:8545', - accounts: { - mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, - path: "m/44'/60'/0'/0", - initialIndex: 0, - count: 20, - }, + etherscan: { + apiKey: { + polygonZKEVMTestnet: `${process.env.ETHERSCAN_ZKEVM_API_KEY}`, + polygonZKEVMMainnet: `${process.env.ETHERSCAN_ZKEVM_API_KEY}`, + goerli: `${process.env.ETHERSCAN_API_KEY}`, + mainnet: `${process.env.ETHERSCAN_API_KEY}`, + }, + customChains: [ + { + network: 'polygonZKEVMMainnet', + chainId: 1101, + urls: { + apiURL: 'https://api-zkevm.polygonscan.com/api', + browserURL: 'https://zkevm.polygonscan.com/', + }, + }, + { + network: 'polygonZKEVMTestnet', + chainId: 1442, + urls: { + apiURL: 'https://api-testnet-zkevm.polygonscan.com/api', + browserURL: 'https://testnet-zkevm.polygonscan.com/', + }, + }, + ], }, - hardhat: { - initialDate: '0', - allowUnlimitedContractSize: true, - accounts: { - mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, - path: "m/44'/60'/0'/0", - initialIndex: 0, - count: 20, - }, - }, - polygonZKEVMTestnet: { - url: "https://rpc.public.zkevm-test.net", - accounts: { - mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, - path: "m/44'/60'/0'/0", - initialIndex: 0, - count: 20, - }, - }, - polygonZKEVMMainnet: { - url: "https://zkevm-rpc.com", - accounts: { - mnemonic: process.env.MNEMONIC || DEFAULT_MNEMONIC, - path: "m/44'/60'/0'/0", - initialIndex: 0, - count: 20, - }, - }, - }, - gasReporter: { - enabled: !!process.env.REPORT_GAS, - outputFile: process.env.REPORT_GAS_FILE ? "./gas_report.md" : null, - noColors: process.env.REPORT_GAS_FILE ? true : false - }, - etherscan: { - apiKey: { - polygonZKEVMTestnet: `${process.env.ETHERSCAN_ZKEVM_API_KEY}`, - polygonZKEVMMainnet: `${process.env.ETHERSCAN_ZKEVM_API_KEY}`, - goerli: `${process.env.ETHERSCAN_API_KEY}`, - mainnet: `${process.env.ETHERSCAN_API_KEY}` - }, - customChains: [ - { - network: "polygonZKEVMMainnet", - chainId: 1101, - urls: { - apiURL: "https://api-zkevm.polygonscan.com/api", - browserURL: "https://zkevm.polygonscan.com/" - } - }, - { - network: "polygonZKEVMTestnet", - chainId: 1442, - urls: { - apiURL: "https://api-testnet-zkevm.polygonscan.com/api", - browserURL: "https://testnet-zkevm.polygonscan.com/" - } - } - ] - }, -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index 85cc39c16..f9cc2f8a6 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,8 @@ "update:genesis": "node deployment/1_createGenesis.js && node deployment/1_createGenesis.js --test --input ../docker/scripts/deploy_parameters_docker.json --out ../docker/scripts/genesis_docker.json", "coverage": "npx hardhat coverage", "gas:report": "REPORT_GAS=true npx hardhat test", - "gas:report:file": "rm -f .openzeppelin/unknown-31337.json && REPORT_GAS=true REPORT_GAS_FILE=true npx hardhat test" + "gas:report:file": "rm -f .openzeppelin/unknown-31337.json && REPORT_GAS=true REPORT_GAS_FILE=true npx hardhat test", + "deploy:testnet:ZkEVM:test:goerli": "npm run prepare:testnet:ZkEVM:goerli && npm run deploy:ZkEVM:test:goerli", + "deploy:ZkEVM:test:goerli": "node deployment/1_createGenesis.js --test && npx hardhat run deployment/3_deployContracts.js --network goerli && npm run saveDeployment:goerli" } }