Skip to content

Commit f786051

Browse files
committed
update to hardhat
1 parent b21f4c4 commit f786051

15 files changed

+2017
-2556
lines changed

buidler.config.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

hardhat.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { HardhatUserConfig } from 'hardhat/config'
2+
3+
import '@nomiclabs/hardhat-ethers'
4+
import '@nomiclabs/hardhat-waffle'
5+
import '@openzeppelin/hardhat-upgrades'
6+
import 'solidity-coverage'
7+
8+
require('./scripts/deploy')
9+
10+
export default {
11+
solidity: {
12+
version: '0.4.24',
13+
},
14+
mocha: {
15+
timeout: 100000,
16+
},
17+
} as HardhatUserConfig

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"license": "ISC",
1919
"author": "[email protected]",
2020
"scripts": {
21-
"compile": "yarn buidler compile",
22-
"test": "yarn buidler test",
23-
"coverage": "yarn buidler coverage --testfiles 'test/unit/*.ts'",
21+
"compile": "yarn hardhat compile",
22+
"test": "yarn hardhat test",
23+
"coverage": "yarn hardhat coverage --testfiles 'test/unit/*.ts'",
2424
"format": "yarn prettier --config .prettierrc --write '**/*.ts' 'contracts/**/*.sol'",
2525
"lint": "yarn solhint 'contracts/**/*.sol'"
2626
},
@@ -29,24 +29,24 @@
2929
"lint"
3030
],
3131
"devDependencies": {
32-
"@nomiclabs/buidler": "^1.4.5",
33-
"@nomiclabs/buidler-ethers": "^2.0.0",
34-
"@nomiclabs/buidler-waffle": "^2.1.0",
35-
"@openzeppelin/buidler-upgrades": "^1.0.2",
32+
"@nomiclabs/hardhat-ethers": "^2.0.1",
33+
"@nomiclabs/hardhat-waffle": "^2.0.1",
34+
"@openzeppelin/hardhat-upgrades": "^1.4.3",
3635
"@types/chai": "^4.2.12",
3736
"@types/mocha": "^8.0.3",
3837
"@types/node": "^14.6.1",
3938
"bignumber.js": "^9.0.0",
4039
"chai": "^4.2.0",
41-
"ethereum-waffle": "^3.0.0",
42-
"ethers": "^5.0.13",
40+
"ethereum-waffle": "^3.2.1",
41+
"ethers": "^5.0.24",
42+
"hardhat": "^2.0.6",
4343
"pre-commit": "^1.2.2",
4444
"prettier": "^2.1.1",
4545
"prettier-plugin-solidity": "^1.0.0-alpha.57",
4646
"solc": "0.4.24",
4747
"solhint": "^3.2.0",
4848
"solhint-plugin-prettier": "^0.0.5",
49-
"solidity-coverage": "^0.7.10",
49+
"solidity-coverage": "^0.7.13",
5050
"stochasm": "^0.5.0",
5151
"ts-node": "^9.0.0",
5252
"typescript": "^4.0.2"

scripts/deploy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { task } from '@nomiclabs/buidler/config'
1+
import { task } from 'hardhat/config'
22
import { getAdminAddress } from '@openzeppelin/upgrades-core'
33
import ProxyAdmin from '@openzeppelin/upgrades-core/artifacts/ProxyAdmin.json'
44
import MultiSigWallet from './MultiSigWalletWithDailyLimit.json'
5-
import { Interface } from 'ethers/lib/utils'
5+
import { Interface } from '@ethersproject/abi'
66
import { TransactionReceipt } from '@ethersproject/providers'
77

88
const parseEvents = (

test/simulation/supply_precision.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- the difference in totalSupply() before and after the rebase(+1) should be exactly 1.
77
*/
88

9-
import { ethers, upgrades } from '@nomiclabs/buidler'
9+
import { ethers, upgrades } from 'hardhat'
1010
import { expect } from 'chai'
1111

1212
async function exec() {

test/simulation/transfer_precision.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
increased by x fragments.
1010
*/
1111

12-
import { ethers, upgrades } from '@nomiclabs/buidler'
12+
import { ethers, upgrades } from 'hardhat'
1313
import { expect } from 'chai'
1414
import { BigNumber, BigNumberish, Contract, Signer } from 'ethers'
1515
import { imul } from '../utils/utils'

test/unit/Orchestrator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { ethers, waffle } from '@nomiclabs/buidler'
1+
import { ethers, waffle } from 'hardhat'
22
import { Contract, Signer } from 'ethers'
33
import { increaseTime } from '../utils/utils'
44
import { expect } from 'chai'
5+
import { TransactionResponse } from '@ethersproject/providers'
56

67
let orchestrator: Contract, mockPolicy: Contract, mockDownstream: Contract
7-
let r: any
8+
let r: Promise<TransactionResponse>
89
let deployer: Signer, user: Signer
910

1011
async function mockedOrchestrator() {

test/unit/SafeMathInt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ethers } from '@nomiclabs/buidler'
1+
import { ethers } from 'hardhat'
22
import { Contract } from 'ethers'
33
import { expect } from 'chai'
44

test/unit/UFragments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ethers, upgrades } from '@nomiclabs/buidler'
1+
import { ethers, upgrades } from 'hardhat'
22
import { Contract, Signer, BigNumber } from 'ethers'
33
import { expect } from 'chai'
44

test/unit/UFragmentsPolicy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ethers, upgrades, waffle } from '@nomiclabs/buidler'
1+
import { ethers, upgrades, waffle } from 'hardhat'
22
import { Contract, Signer, BigNumber, BigNumberish, Event } from 'ethers'
33
import { TransactionResponse } from '@ethersproject/providers'
44
import { expect } from 'chai'

test/unit/UInt256Lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ethers } from '@nomiclabs/buidler'
1+
import { ethers } from 'hardhat'
22
import { Contract } from 'ethers'
33
import { expect } from 'chai'
44

test/unit/uFragments_erc20_behavior.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@
2222
https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/test/token/ERC20/ERC20.test.js
2323
*/
2424

25-
import { ethers, upgrades, waffle } from '@nomiclabs/buidler'
25+
import { ethers, upgrades, waffle } from 'hardhat'
2626
import { Contract, Signer, BigNumber } from 'ethers'
2727
import { TransactionResponse } from '@ethersproject/providers'
2828
import { expect } from 'chai'
29-
import { AnySrvRecord } from 'dns'
3029

3130
const toUFrgDenomination = (ample: string): BigNumber =>
3231
ethers.utils.parseUnits(ample, DECIMALS)
@@ -261,7 +260,7 @@ describe('UFragments:ERC20:approve', () => {
261260
describe('when the spender is NOT the zero address', function () {
262261
describe('when the sender has enough balance', function () {
263262
describe('when there was no approved amount before', function () {
264-
let r: any
263+
let r: Promise<TransactionResponse>
265264
before(async function () {
266265
await token
267266
.connect(owner)
@@ -293,7 +292,7 @@ describe('UFragments:ERC20:approve', () => {
293292
})
294293

295294
describe('when the spender had an approved amount', function () {
296-
let r: any
295+
let r: Promise<TransactionResponse>
297296
before(async function () {
298297
await token
299298
.connect(owner)
@@ -327,7 +326,7 @@ describe('UFragments:ERC20:approve', () => {
327326

328327
describe('when the sender does not have enough balance', function () {
329328
describe('when there was no approved amount before', function () {
330-
let r: any
329+
let r: Promise<TransactionResponse>
331330
before(async function () {
332331
await token
333332
.connect(owner)
@@ -359,7 +358,7 @@ describe('UFragments:ERC20:approve', () => {
359358
})
360359

361360
describe('when the spender had an approved amount', function () {
362-
let r: any
361+
let r: Promise<TransactionResponse>
363362
before(async function () {
364363
await token
365364
.connect(owner)
@@ -403,7 +402,7 @@ describe('UFragments:ERC20:increaseAllowance', () => {
403402
describe('when the spender is NOT the zero address', function () {
404403
describe('when the sender has enough balance', function () {
405404
describe('when there was no approved amount before', function () {
406-
let r: any
405+
let r: Promise<TransactionResponse>
407406
before(async function () {
408407
await token
409408
.connect(owner)
@@ -437,7 +436,7 @@ describe('UFragments:ERC20:increaseAllowance', () => {
437436
})
438437

439438
describe('when the spender had an approved amount', function () {
440-
let r: any
439+
let r: Promise<TransactionResponse>
441440
beforeEach(async function () {
442441
await token
443442
.connect(owner)
@@ -474,7 +473,7 @@ describe('UFragments:ERC20:increaseAllowance', () => {
474473

475474
describe('when the sender does not have enough balance', function () {
476475
describe('when there was no approved amount before', function () {
477-
let r: any
476+
let r: Promise<TransactionResponse>
478477
before(async function () {
479478
await token
480479
.connect(owner)
@@ -509,7 +508,7 @@ describe('UFragments:ERC20:increaseAllowance', () => {
509508
})
510509

511510
describe('when the spender had an approved amount', function () {
512-
let r: any
511+
let r: Promise<TransactionResponse>
513512
beforeEach(async function () {
514513
await token
515514
.connect(owner)
@@ -556,7 +555,7 @@ describe('UFragments:ERC20:decreaseAllowance', () => {
556555
describe('when the spender is NOT the zero address', function () {
557556
describe('when the sender does NOT have enough balance', function () {
558557
describe('when there was no approved amount before', function () {
559-
let r: any
558+
let r: Promise<TransactionResponse>
560559
before(async function () {
561560
r = token
562561
.connect(owner)
@@ -588,7 +587,7 @@ describe('UFragments:ERC20:decreaseAllowance', () => {
588587
})
589588

590589
describe('when the spender had an approved amount', function () {
591-
let r: any
590+
let r: Promise<TransactionResponse>
592591
before(async function () {
593592
await token
594593
.connect(owner)
@@ -625,7 +624,7 @@ describe('UFragments:ERC20:decreaseAllowance', () => {
625624

626625
describe('when the sender has enough balance', function () {
627626
describe('when there was no approved amount before', function () {
628-
let r: any
627+
let r: Promise<TransactionResponse>
629628
before(async function () {
630629
await token
631630
.connect(owner)
@@ -660,7 +659,7 @@ describe('UFragments:ERC20:decreaseAllowance', () => {
660659
})
661660

662661
describe('when the spender had an approved amount', function () {
663-
let r: any
662+
let r: Promise<TransactionResponse>
664663
before(async function () {
665664
await token
666665
.connect(owner)

test/utils/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ethers } from '@nomiclabs/buidler'
1+
import { ethers } from 'hardhat'
22
import { BigNumberish } from 'ethers'
33
import { BigNumber as BN } from 'bignumber.js'
44

tsconfig.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
12
{
23
"compilerOptions": {
34
"target": "es5",
45
"module": "commonjs",
56
"strict": true,
67
"esModuleInterop": true,
78
"resolveJsonModule": true,
9+
"downlevelIteration": true,
810
"outDir": "dist"
911
},
1012
"include": ["./scripts", "./test"],
1113
"files": [
12-
"buidler.config.ts",
13-
"./node_modules/@nomiclabs/buidler-ethers/src/type-extensions.d.ts",
14-
"./node_modules/@nomiclabs/buidler-waffle/src/type-extensions.d.ts",
15-
"./node_modules/@openzeppelin/buidler-upgrades/src/type-extensions.d.ts"
14+
"hardhat.config.ts",
15+
"./node_modules/@nomiclabs/hardhat-ethers/src/type-extensions.ts",
16+
"./node_modules/@nomiclabs/hardhat-waffle/src/type-extensions.ts",
17+
"./node_modules/@openzeppelin/hardhat-upgrades/src/type-extensions.ts"
1618
]
17-
}
19+
}

0 commit comments

Comments
 (0)