Skip to content

Commit

Permalink
migration buidler to hardhat (with some extra fixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harthor committed Nov 11, 2020
1 parent 4f84842 commit 7e7b839
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
18 changes: 10 additions & 8 deletions buidler.config.js → hardhat.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { usePlugin } = require('@nomiclabs/buidler/config')
const hooks = require('./scripts/buidler-hooks')
const { usePlugin } = require('hardhat/config')
const hooks = require('./scripts/hardhat-hooks')

usePlugin('@aragon/buidler-aragon')
usePlugin('@nomiclabs/buidler-solhint')
usePlugin('buidler-gas-reporter')
usePlugin('solidity-coverage')
require('@aragon/buidler-aragon')
require('@nomiclabs/hardhat-solhint')
require('hardhat-gas-reporter')
require('solidity-coverage')

const ACCOUNTS = (process.env.ETH_KEYS ? process.env.ETH_KEYS.split(',') : [])
.map(key => key.trim())
Expand Down Expand Up @@ -41,7 +41,7 @@ module.exports = {
// to have Frame running on your machine. Download it from:
// https://frame.sh
frame: {
httpHeaders: { origin: 'buidler' },
httpHeaders: { origin: 'hardhat' },
url: 'http://localhost:1248',
},
// xDAI network configured with Aragon node.
Expand All @@ -54,10 +54,12 @@ module.exports = {
},
solc: {
version: '0.4.24',
optimizer: {
settings: {
optimizer: {
enabled: true,
runs: 10000,
},
}
},
gasReporter: {
enabled: !!process.env.GAS_REPORTER,
Expand Down
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
"@aragon/buidler-aragon": "^0.2.9",
"@aragon/templates-shared": "^1.0.1",
"@aragon/test-helpers": "^2.0.0",
"@nomiclabs/buidler": "^1.4.3",
"@nomiclabs/buidler-etherscan": "^1.3.3",
"@nomiclabs/buidler-ganache": "^1.3.3",
"@nomiclabs/buidler-solhint": "^1.3.3",
"@nomiclabs/buidler-truffle5": "^1.3.4",
"@nomiclabs/buidler-web3": "^1.3.4",
"@nomiclabs/hardhat-etherscan": "^2.0.0",
"@nomiclabs/hardhat-ganache": "^2.0.0",
"@nomiclabs/hardhat-solhint": "^2.0.0",
"@nomiclabs/hardhat-truffle5": "^2.0.0",
"@nomiclabs/hardhat-web3": "^2.0.0",
"babel-eslint": "^10.0.2",
"buidler-extract": "^1.0.0",
"buidler-gas-reporter": "^0.1.3",
"hardhat-gas-reporter": "^1.0.1",
"cross-env": "^5.2.0",
"eslint": "^6.0.1",
"eslint-config-prettier": "^6.0.0",
Expand All @@ -33,6 +31,7 @@
"eslint-plugin-standard": "^4.0.0",
"ethlint": "^1.2.4",
"fs-extra": "^8.1.0",
"hardhat": "^2.0.2",
"prettier": "^1.18.2",
"solidity-coverage": "^0.7.9",
"solium": "^1.2.5",
Expand All @@ -41,15 +40,15 @@
"scripts": {
"postinstall": "npm run compile && npm run build-app",
"build-app": "cd app && npm install && cd ..",
"compile": "buidler compile --force",
"compile": "hardhat compile --force",
"lint": "solium --dir ./contracts",
"test": "buidler test --network buidlerevm",
"test:gas": "REPORT_GAS=true buidler test --network localhost",
"coverage": "buidler coverage --network coverage",
"abi:extract": "buidler-extract --output abi/ --keys abi",
"start": "buidler start",
"publish:major": "buidler publish major",
"publish:minor": "buidler publish minor",
"publish:patch": "buidler publish patch"
"test": "hardhat test --network hardhatevm",
"test:gas": "REPORT_GAS=true hardhat test --network localhost",
"coverage": "hardhat coverage --network coverage",
"abi:extract": "hardhat-extract --output abi/ --keys abi",
"start": "hardhat start",
"publish:major": "hardhat publish major",
"publish:minor": "hardhat publish minor",
"publish:patch": "hardhat publish patch"
}
}
4 changes: 2 additions & 2 deletions scripts/buidler-hooks.js → scripts/hardhat-hooks.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* These hooks are called by the Aragon Buidler plugin during the start task's lifecycle. Use them to perform custom tasks at certain entry points of the development build process, like deploying a token before a proxy is initialized, etc.
*
* Link them to the main buidler config file (buidler.config.js) in the `aragon.hooks` property.
* Link them to the main hardhat config file (hardhat.config.js) in the `aragon.hooks` property.
*
* All hooks receive two parameters:
* 1) A params object that may contain other objects that pertain to the particular hook.
* 2) A "bre" or BuidlerRuntimeEnvironment object that contains enviroment objects like web3, Truffle artifacts, etc.
* 2) A "hre" or HardhatRuntimeEnvironment object that contains enviroment objects like web3, Truffle artifacts, etc.
*
* Please see AragonConfigHooks, in the plugin's types for further details on these interfaces.
* https://github.com/aragon/buidler-aragon/blob/develop/src/types.ts#L31
Expand Down

0 comments on commit 7e7b839

Please sign in to comment.