Commit 015bcd94 authored by Georgios Konstantopoulos's avatar Georgios Konstantopoulos Committed by GitHub

chore: use trimmed down smock/plugins (#347)

* chore: use trimmed down smock/plugins

* fix: add storage layout for smock

* chore: lint

* fix: explicitly compile the OVM artifacts

* Use latest plugins and tweak package.json
Co-authored-by: default avatarKelvin Fichter <kelvinfichter@gmail.com>
parent b18e1f82
node_modules/ node_modules/
artifacts/ artifacts/
artifacts-ovm/
cache/ cache/
cache-ovm/
yarn-error.log yarn-error.log
build/ build/
.DS_STORE .DS_STORE
...@@ -10,7 +10,6 @@ import '@nomiclabs/hardhat-ethers' ...@@ -10,7 +10,6 @@ import '@nomiclabs/hardhat-ethers'
import '@nomiclabs/hardhat-waffle' import '@nomiclabs/hardhat-waffle'
import '@typechain/hardhat' import '@typechain/hardhat'
import '@eth-optimism/plugins/hardhat/compiler' import '@eth-optimism/plugins/hardhat/compiler'
import '@eth-optimism/smock/build/src/plugins/hardhat-storagelayout'
const config: HardhatUserConfig = { const config: HardhatUserConfig = {
networks: { networks: {
...@@ -26,6 +25,11 @@ const config: HardhatUserConfig = { ...@@ -26,6 +25,11 @@ const config: HardhatUserConfig = {
version: '0.7.6', version: '0.7.6',
settings: { settings: {
optimizer: { enabled: true, runs: 200 }, optimizer: { enabled: true, runs: 200 },
outputSelection: {
'*': {
'*': ['storageLayout'],
},
},
}, },
}, },
typechain: { typechain: {
......
...@@ -7,19 +7,22 @@ ...@@ -7,19 +7,22 @@
"build/contracts/*", "build/contracts/*",
"build/dumps/*json", "build/dumps/*json",
"build/artifacts/**/*.json", "build/artifacts/**/*.json",
"build/artifacts-ovm/**/*.json",
"build/types/**/*.ts" "build/types/**/*.ts"
], ],
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"all": "yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint", "all": "yarn clean && yarn build && yarn test && yarn lint:fix && yarn lint",
"build": "yarn run build:contracts && yarn run build:typescript && yarn run build:copy && yarn run build:dump && yarn run build:typechain", "build": "yarn run build:contracts && yarn run build:contracts:ovm && yarn run build:typescript && yarn run build:copy && yarn run build:dump && yarn run build:typechain",
"build:kovan": "yarn run build:contracts && yarn run build:typescript && yarn run build:copy && CHAIN_ID=69 yarn run build:dump && yarn run build:typechain", "build:kovan": "yarn run build:contracts && yarn run build:typescript && yarn run build:copy && CHAIN_ID=69 yarn run build:dump && yarn run build:typechain",
"build:mainnet": "yarn run build:contracts && yarn run build:typescript && yarn run build:copy && CHAIN_ID=10 yarn run build:dump && yarn run build:typechain", "build:mainnet": "yarn run build:contracts && yarn run build:typescript && yarn run build:copy && CHAIN_ID=10 yarn run build:dump && yarn run build:typechain",
"build:typescript": "tsc -p .", "build:typescript": "tsc -p .",
"build:contracts": "hardhat compile --show-stack-traces", "build:contracts": "hardhat compile --show-stack-traces",
"build:contracts:ovm": "TARGET=ovm hardhat compile --show-stack-traces",
"build:dump": "ts-node \"bin/take-dump.ts\"", "build:dump": "ts-node \"bin/take-dump.ts\"",
"build:copy": "yarn run build:copy:artifacts && yarn run build:copy:contracts", "build:copy": "yarn run build:copy:artifacts && yarn build:copy:artifacts:ovm && yarn run build:copy:contracts",
"build:copy:artifacts": "copyfiles -u 1 \"artifacts/**/*.json\" \"build/artifacts\"", "build:copy:artifacts": "copyfiles -u 1 \"artifacts/**/*.json\" \"build/artifacts\"",
"build:copy:artifacts:ovm": "copyfiles -u 1 \"artifacts-ovm/**/*.json\" \"build/artifacts-ovm\"",
"build:copy:contracts": "copyfiles -u 2 \"contracts/optimistic-ethereum/**/*.sol\" \"build/contracts\"", "build:copy:contracts": "copyfiles -u 2 \"contracts/optimistic-ethereum/**/*.sol\" \"build/contracts\"",
"build:typechain": "hardhat typechain", "build:typechain": "hardhat typechain",
"test": "yarn run test:contracts", "test": "yarn run test:contracts",
...@@ -29,25 +32,25 @@ ...@@ -29,25 +32,25 @@
"lint:typescript": "tslint --format stylish --project .", "lint:typescript": "tslint --format stylish --project .",
"lint:fix": "yarn run lint:fix:typescript", "lint:fix": "yarn run lint:fix:typescript",
"lint:fix:typescript": "prettier --config prettier-config.json --write \"hardhat.config.ts\" \"{src,test}/**/*.ts\"", "lint:fix:typescript": "prettier --config prettier-config.json --write \"hardhat.config.ts\" \"{src,test}/**/*.ts\"",
"clean": "rm -rf ./artifacts ./build ./cache", "clean": "rm -rf ./build ./artifacts ./artifacts-ovm ./cache ./cache-ovm",
"deploy": "./bin/deploy.js", "deploy": "./bin/deploy.js",
"serve": "./bin/serve_dump.sh" "serve": "./bin/serve_dump.sh"
}, },
"dependencies": { "dependencies": {
"@eth-optimism/core-utils": "^0.1.8", "@eth-optimism/core-utils": "^0.1.10",
"@eth-optimism/dev": "^1.1.1",
"@eth-optimism/solc": "^0.6.12-alpha.1", "@eth-optimism/solc": "^0.6.12-alpha.1",
"@ethersproject/abstract-provider": "^5.0.8", "@ethersproject/abstract-provider": "^5.0.8",
"@ethersproject/contracts": "^5.0.5", "@ethersproject/contracts": "^5.0.5",
"@ethersproject/hardware-wallets": "^5.0.8", "@ethersproject/hardware-wallets": "^5.0.8",
"@openzeppelin/contracts": "^3.3.0", "@openzeppelin/contracts": "^3.3.0",
"@typechain/hardhat": "^1.0.1", "@typechain/hardhat": "^1.0.1",
"ganache-core": "^2.12.1", "ganache-core": "^2.13.2",
"glob": "^7.1.6" "glob": "^7.1.6"
}, },
"devDependencies": { "devDependencies": {
"@eth-optimism/dev": "^1.1.1", "@eth-optimism/plugins": "^1.0.0-alpha.2",
"@eth-optimism/plugins": "^0.0.17", "@eth-optimism/smock": "^1.0.0-alpha.3",
"@eth-optimism/smock": "0.2.1-alpha.0",
"@nomiclabs/hardhat-ethers": "^2.0.1", "@nomiclabs/hardhat-ethers": "^2.0.1",
"@nomiclabs/hardhat-waffle": "^2.0.1", "@nomiclabs/hardhat-waffle": "^2.0.1",
"@typechain/ethers-v5": "1.0.0", "@typechain/ethers-v5": "1.0.0",
...@@ -56,7 +59,7 @@ ...@@ -56,7 +59,7 @@
"buffer-xor": "^2.0.2", "buffer-xor": "^2.0.2",
"chai": "^4.3.1", "chai": "^4.3.1",
"copyfiles": "^2.3.0", "copyfiles": "^2.3.0",
"ethereum-waffle": "3.0.0", "ethereum-waffle": "^3.3.0",
"ethers": "^5.0.31", "ethers": "^5.0.31",
"hardhat": "^2.0.8", "hardhat": "^2.0.8",
"lodash": "^4.17.20", "lodash": "^4.17.20",
......
...@@ -5,8 +5,8 @@ import { Interface } from 'ethers/lib/utils' ...@@ -5,8 +5,8 @@ import { Interface } from 'ethers/lib/utils'
export const getContractDefinition = (name: string, ovm?: boolean): any => { export const getContractDefinition = (name: string, ovm?: boolean): any => {
const match = glob.sync( const match = glob.sync(
path.resolve(__dirname, `../artifacts`) + path.resolve(__dirname, `../artifacts${ovm ? '-ovm' : ''}`) +
`/**/${name}${ovm ? '-ovm' : ''}.json` `/**/${name}.json`
) )
if (match.length > 0) { if (match.length > 0) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment