diff --git a/.gitignore b/.gitignore index e6704cbb..09986ddb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ .env #Buidler files cache +cache-ovm artifacts +artifacts-ovm node_modules dist/ build/ diff --git a/hardhat.config.ts b/hardhat.config.ts index 7ae07a0d..f98bb70d 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -21,6 +21,9 @@ import 'hardhat-gas-reporter'; import 'hardhat-typechain'; import '@tenderly/hardhat-tenderly'; import 'solidity-coverage'; +import 'hardhat-contract-sizer'; +import "@eth-optimism/plugins/hardhat/compiler"; + import { fork } from 'child_process'; const SKIP_LOAD = process.env.SKIP_LOAD === 'true'; @@ -132,7 +135,51 @@ const buidlerConfig: HardhatUserConfig = { count: 20, }, }, + optimism_main: { // main + url: 'https://mainnet.optimism.io', + gasPrice: 0, + chainId: 10, + accounts: { + mnemonic: MNEMONIC, + path: MNEMONIC_PATH, + initialIndex: 0, + count: 20, + }, + ovm: true, + }, + optimismKovan: { // kovan + url: 'https://kovan.optimism.io', + gasPrice: 15000000, + chainId: 69, + accounts: { + mnemonic: MNEMONIC, + path: MNEMONIC_PATH, + initialIndex: 0, + count: 20, + }, + ovm: true, + }, + optimism: { // docker + url: 'http://localhost:8545', + gasPrice: 0, + chainId: 420, + accounts: { + mnemonic: MNEMONIC, + path: MNEMONIC_PATH, + initialIndex: 0, + count: 20, + }, + ovm: true, + } }, + contractSizer: { + alphaSort: true, + runOnCompile: true, + disambiguatePaths: false, + }, + ovm: { + solcVersion: '0.6.12' + } }; export default buidlerConfig; diff --git a/package.json b/package.json index 70ed56fa..5702dbe5 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,9 @@ "hardhat:docker": "hardhat --network hardhatevm_docker", "hardhat:mumbai": "hardhat --network mumbai", "hardhat:matic": "hardhat --network matic", + "hardhat:optimismKovan": "hardhat --network optimismKovan", "compile": "SKIP_LOAD=true hardhat compile", + "compile:ovm": "npm run compile -- --network optimism", "console:fork": "FORK=main hardhat console", "test": "npm run compile && TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-aave/*.spec.ts", "test-amm": "npm run compile && TS_NODE_TRANSPILE_ONLY=1 hardhat test ./test-suites/test-amm/*.spec.ts", @@ -33,6 +35,7 @@ "matic:mumbai:full:migration": "npm run compile && npm run hardhat:mumbai sidechain:mainnet -- --pool Matic --skip-registry", "matic:matic:full:migration": "npm run compile && npm run hardhat:matic sidechain:mainnet -- --pool Matic --skip-registry", "amm:kovan:full:migration": "npm run compile && npm run hardhat:kovan -- amm:mainnet --skip-registry", + "optimism:kovan:full:migration": "npm run compile:ovm && npm run hardhat:optimismKovan -- optimism:mainnet --pool Optimism --skip-registry", "aave:docker:full:migration:add-registry": "npm run compile && npm run hardhat:docker -- aave:mainnet", "aave:kovan:full:migration:add-registry": "npm run compile && npm run hardhat:kovan -- aave:mainnet", "matic:mumbai:full:migration:add-registry": "npm run compile && npm run hardhat:mumbai sidechain:mainnet -- --pool Matic", @@ -64,7 +67,7 @@ "prettier:check": "npx prettier -c 'tasks/**/*.ts' 'contracts/**/*.sol' 'helpers/**/*.ts' 'test-suites/test-aave/**/*.ts'", "prettier:write": "prettier --write 'tasks/**/*.ts' 'contracts/**/*.sol' 'helpers/**/*.ts' 'test-suites/test-aave/**/*.ts'", "ci:test": "npm run compile && npm run test", - "ci:clean": "rm -rf ./artifacts ./cache ./types", + "ci:clean": "rm -rf ./artifacts ./cache ./types ./artifacts-ovm ./cache-ovm", "print-contracts:kovan": "npm run hardhat:kovan -- print-contracts", "print-contracts:main": "npm run hardhat:main -- print-contracts", "print-contracts:ropsten": "npm run hardhat:main -- print-contracts", @@ -93,6 +96,7 @@ "prepublishOnly": "npm run compile" }, "devDependencies": { + "@eth-optimism/plugins": "*", "@nomiclabs/buidler": "^1.4.7", "@nomiclabs/buidler-ethers": "2.0.0", "@nomiclabs/buidler-etherscan": "^2.1.0", @@ -123,6 +127,7 @@ "ethers": "^5.0.19", "globby": "^11.0.1", "hardhat": "^2.2.0", + "hardhat-contract-sizer": "^2.0.3", "hardhat-gas-reporter": "^1.0.0", "hardhat-typechain": "^0.3.3", "husky": "^4.2.5",