From 701ffd90a911c5a3ea9aeea0815b6ef315a85310 Mon Sep 17 00:00:00 2001 From: josojo Date: Sat, 2 Dec 2023 23:36:44 +0100 Subject: [PATCH] no getter contract --- contracts/dependencies/Getter.sol | 15 -- hardhat.config.js | 375 +++++++++++++++--------------- package.json | 4 +- 3 files changed, 192 insertions(+), 202 deletions(-) delete mode 100644 contracts/dependencies/Getter.sol diff --git a/contracts/dependencies/Getter.sol b/contracts/dependencies/Getter.sol deleted file mode 100644 index 27e36a2f..00000000 --- a/contracts/dependencies/Getter.sol +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -pragma solidity ^0.8.17; - -// The following dependency is only needed for deployment -import {PolygonZkEVMDeployer} from "@RealityETH/zkevm-contracts/contracts/deployment/PolygonZkEVMDeployer.sol"; -import {PolygonZkEVMGlobalExitRootL2} from "@RealityETH/zkevm-contracts/contracts/PolygonZkEVMGlobalExitRootL2.sol"; -import {PolygonZkEVMTimelock} from "@RealityETH/zkevm-contracts/contracts/PolygonZkEVMTimelock.sol"; -import {VerifierRollupHelperMock} from "@RealityETH/zkevm-contracts/contracts/mocks/VerifierRollupHelperMock.sol"; -import {FflonkVerifier} from "@RealityETH/zkevm-contracts/contracts/verifiers/FflonkVerifier.sol"; - -// This contract only exists to laod dependencies that are not interherited by an other contract, but still needed -// by the repo -contract Getter { - -} diff --git a/hardhat.config.js b/hardhat.config.js index f1743c3e..901c0b3e 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -5,17 +5,17 @@ require('solidity-coverage'); require('@nomiclabs/hardhat-etherscan'); require('@openzeppelin/hardhat-upgrades'); require('hardhat-dependency-compiler'); -require("hardhat-preprocessor") -fs = require('fs') +require('hardhat-preprocessor'); +const fs = require('fs'); const DEFAULT_MNEMONIC = 'test test test test test test test test test test test junk'; function getRemappings() { - return fs - .readFileSync("remappings.txt", "utf8") - .split("\n") - .filter(Boolean) // remove empty lines - .map((line) => line.trim().split("=")); + return fs + .readFileSync('remappings.txt', 'utf8') + .split('\n') + .filter(Boolean) // remove empty lines + .map((line) => line.trim().split('=')); } /* @@ -27,188 +27,193 @@ function getRemappings() { * @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 - }, - preprocess: { - eachLine: (hre) => ({ - transform: (line) => { - if (line.match(/^\s*import /i)) { - for (const [from, to] of getRemappings()) { - if (line.includes(from)) { - line = line.replace(from, to); - break; - } - } - } - return line; - }, - }), - }, - paths: { - sources: "./contracts/", - cache: "./cache_hardhat", - artifacts: "./out/ForkonomicToken.sol" - }, - solidity: { - compilers: [ - { - version: "0.8.20", - settings: { - optimizer: { - enabled: true, - runs: 200 - } - } - }, - { - version: "0.6.11", - settings: { - optimizer: { - enabled: true, - runs: 200 - } - } - }, - { - version: "0.5.12", - settings: { - optimizer: { - enabled: true, - runs: 200 - } - } - }, - { - 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', + '@RealityETH/zkevm-contracts/contracts/deployment/PolygonZkEVMDeployer.sol', + '@RealityETH/zkevm-contracts/contracts/PolygonZkEVMGlobalExitRootL2.sol', + '@RealityETH/zkevm-contracts/contracts/PolygonZkEVMTimelock.sol', + '@RealityETH/zkevm-contracts/contracts/mocks/VerifierRollupHelperMock.sol', + '@RealityETH/zkevm-contracts/contracts/verifiers/FflonkVerifier.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, - }, + preprocess: { + eachLine: (hre) => ({ + transform: (line) => { + if (line.match(/^\s*import /i)) { + for (const [from, to] of getRemappings()) { + if (line.includes(from)) { + line = line.replace(from, to); + break; + } + } + } + return line; + }, + }), }, - 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, - }, + paths: { + sources: './contracts/', + cache: './cache_hardhat', + artifacts: './out/ForkonomicToken.sol', }, - sepolia: { - url: `https://sepolia.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.20', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + { + version: '0.6.11', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + { + version: '0.5.12', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + { + version: '0.5.16', + settings: { + optimizer: { + enabled: true, + runs: 999999, + }, + }, + }, + ], }, - 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, - }, + 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, + }, + }, + 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, + }, + }, + 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, + }, + }, + sepolia: { + url: `https://sepolia.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: `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, + 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, + }, + }, }, - 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, - }, + gasReporter: { + enabled: !!process.env.REPORT_GAS, + outputFile: process.env.REPORT_GAS_FILE ? './gas_report.md' : null, + noColors: !!process.env.REPORT_GAS_FILE, }, - hardhat: { - initialDate: '0', - allowUnlimitedContractSize: true, - 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}`, + sepolia: `${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/', + }, + }, + ], }, - 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}`, - sepolia: `${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 6766f10d..9b0dcbff 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "upgrade:timelock:mainnet": "npx hardhat run upgrade/timeLockUpgrade.js --network mainnet", "verify:ZkEVM:mainnet": "npx hardhat run deployment/verifyContracts.js --network mainnet", "compile": "npx hardhat compile", - "lintjs": "npx eslint ./deployment && npx eslint ./src", - "lintjs:fix": "npx eslint ./deployment --fix" + "lintjs": "npx eslint ./src", + "lintjs:fix": "npx eslint ./src/deployment --fix" }, "dependencies": { "chai": "^4.3.7",