You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that a lot of things are changing as I progress through the course. I am making a changelog read me file and was hoping to share here so that new people can get unstuck faster :) - I was wondering if anyone has already created one? . My changelog so far (not complete yet):
Hardhat FCC course - credits to Pat Collins
This is mainly a changelog/readme file - things that I did differently will be recorded here
Some changes here:
Ganache and truffle suite is being retired and used latest v2.7.1 as 2.5 was get socket error - hangups
deploy.js - await.deployTransaction.wait() has changed to await.deploymentTransaction().wait(2)
chainId is 1337 and not ganache UI value of 5777
In encryptKey.js, after wallet creation, no need to pass in private key again as wallet.encrypt automatically knows wallet = private_key. So only private key password needs to be passed into the encrypt function. Encrypt function doco:
constprovider=newethers.JsonRpcProvider(process.env.RPC_URL);/* const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider); *///not a good practice but demo hereconstencryptedJson=fs.readFileSync("./.encryptedKey.json","utf8");letwallet=newethers.Wallet.fromEncryptedJsonSync(encryptedJson,process.env.PRIVATE_KEY_PASSWORD);wallet=awaitwallet.connect(provider);
An encryption script is used to provide the encrypted key json file:
At timestamp 8:32:09, when Patrick demoes 'yarn hardhat accounts', this error is thrown :
vivekmitra@MBPro hardhat-simple-storage-fcc % yarn hardhat accounts
...
Error HH303: Unrecognized task accounts
For more info go to https://hardhat.org/HH303 or run Hardhat with --show-stack-traces
You need to add the following to the hardhat.config.js file :
task("accounts","Prints the list of accounts",async()=>{constaccounts=awaitethers.getSigners();for(constaccountofaccounts){console.log(account.address);}});
Output:
vivekmitra@MBPro hardhat-simple-storage-fcc % yarn hardhat accounts
yarn run v1.22.21
$ /Users/vivekmitra/Desktop/hh-fcc/hardhat-simple-storage-fcc/node_modules/.bin/hardhat accounts
WARNING: You are currently using Node.js v21.5.0, which is not supported by Hardhat. This can lead to unexpected behavior. See https://hardhat.org/nodejs-versions
0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
0x70997970C51812dc3A010C7d01b50e0d17dc79C8
0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
0x90F79bf6EB2c4f870365E785982E1f101E93b906
0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65
0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc
0x976EA74026E726554dB657fA54763abd0C3a0aa9
0x14dC79964da2C08b23698B3D3cc7Ca32193d9955
0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f
0xa0Ee7A142d267C1f36714E4a8F75612F20a79720
0xBcd4042DE499D14e55001CcbB24a551F3b954096
0x71bE63f3384f5fb98995898A86B02Fb2426c5788
0xFABB0ac9d68B0B445fB7357272Ff202C5651694a
0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec
0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097
0xcd3B766CCDd6AE721141F452C550Ca635964ce71
0x2546BcD3c84621e976D8185a91A922aE77ECEc30
0xbDA5747bFD65F08deb54cb465eB87D40e51B197E
0xdD2FD4581271e230360230F9337D5c0430Bf44C0
0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199
✨ Done in 2.36s.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have noticed that a lot of things are changing as I progress through the course. I am making a changelog read me file and was hoping to share here so that new people can get unstuck faster :) - I was wondering if anyone has already created one? . My changelog so far (not complete yet):
Hardhat FCC course - credits to Pat Collins
This is mainly a changelog/readme file - things that I did differently will be recorded here
Some changes here:
However, this project will not be using the encrypted key file, it will only use the .env gitignored
At timestamp 8:04, contract.address has been changed :
old one :
Output:
new one :
Output:
You need to add the following to the hardhat.config.js file :
Output:
vivekmitra@MBPro hardhat-simple-storage-fcc % yarn hardhat accounts yarn run v1.22.21 $ /Users/vivekmitra/Desktop/hh-fcc/hardhat-simple-storage-fcc/node_modules/.bin/hardhat accounts WARNING: You are currently using Node.js v21.5.0, which is not supported by Hardhat. This can lead to unexpected behavior. See https://hardhat.org/nodejs-versions 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 0x70997970C51812dc3A010C7d01b50e0d17dc79C8 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC 0x90F79bf6EB2c4f870365E785982E1f101E93b906 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65 0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc 0x976EA74026E726554dB657fA54763abd0C3a0aa9 0x14dC79964da2C08b23698B3D3cc7Ca32193d9955 0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f 0xa0Ee7A142d267C1f36714E4a8F75612F20a79720 0xBcd4042DE499D14e55001CcbB24a551F3b954096 0x71bE63f3384f5fb98995898A86B02Fb2426c5788 0xFABB0ac9d68B0B445fB7357272Ff202C5651694a 0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec 0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097 0xcd3B766CCDd6AE721141F452C550Ca635964ce71 0x2546BcD3c84621e976D8185a91A922aE77ECEc30 0xbDA5747bFD65F08deb54cb465eB87D40e51B197E 0xdD2FD4581271e230360230F9337D5c0430Bf44C0 0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199 ✨ Done in 2.36s.
Beta Was this translation helpful? Give feedback.
All reactions