Skip to content

Commit 820ef81

Browse files
committed
update task 11 with the hardhat 2.22.2
1 parent 68013ff commit 820ef81

File tree

5 files changed

+31
-136
lines changed

5 files changed

+31
-136
lines changed
+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
node_modules
2+
.env
23

3-
#Hardhat files
4-
cache
5-
artifacts
4+
# Hardhat files
5+
/cache
6+
/artifacts
7+
8+
# TypeChain files
9+
/typechain
10+
/typechain-types
11+
12+
# solidity-coverage files
13+
/coverage
14+
/coverage.json

basic/11-react-express-hardhat/hardhat.config.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
require('@nomiclabs/hardhat-waffle');
2-
const fs = require('fs');
1+
require("@nomicfoundation/hardhat-toolbox");
32
require('dotenv').config();
43

54
// This is a sample Hardhat task. To learn how to create your own go to
@@ -42,4 +41,4 @@ module.exports = {
4241
accounts: [mnemonic()],
4342
},
4443
},
45-
};
44+
};
+14-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
{
2-
"name": "hardhat-project",
3-
"devDependencies": {
4-
"@nomiclabs/hardhat-ethers": "^2.0.2",
5-
"@nomiclabs/hardhat-waffle": "^2.0.1",
6-
"chai": "^4.3.4",
7-
"ethereum-waffle": "^3.3.0",
8-
"ethers": "^5.3.0",
9-
"hardhat": "^2.3.0"
2+
"name": "11-react-express-hardhat",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
108
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC",
1112
"dependencies": {
12-
"dotenv": "^10.0.0"
13+
"dotenv": "^16.4.5",
14+
"hardhat": "^2.22.2"
15+
},
16+
"devDependencies": {
17+
"@nomicfoundation/hardhat-toolbox": "^5.0.0"
1318
}
1419
}

basic/11-react-express-hardhat/scripts/deploy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ async function main() {
1717
await deployer.getAddress()
1818
)
1919

20-
console.log('Account balance:', (await deployer.getBalance()).toString())
20+
console.log('Account balance:', (await ethers.provider.getBalance(deployer.address)).toString())
2121

2222
const Token = await ethers.getContractFactory('SimpleToken')
2323
const token = await Token.deploy('Test', 'SimpleToken', 1, 10000)
24-
await token.deployed()
24+
await token.waitForDeployment();
2525

26-
console.log('Token address:', token.address)
26+
console.log('Token address:', token.target)
2727

2828
// We also save the contract's artifacts and address in the frontend directory
2929
saveFrontendFiles(token)

basic/11-react-express-hardhat/test/SimpleToken.js

-118
This file was deleted.

0 commit comments

Comments
 (0)