Conversation
fvictorio
left a comment
There was a problem hiding this comment.
First pass. I didn't review Dapp.tsx nor tsconfig.json yet.
| require("@nomicfoundation/hardhat-toolbox"); | ||
| import { HardhatUserConfig } from "hardhat/config"; | ||
| import "@nomicfoundation/hardhat-toolbox"; | ||
| import "@nomiclabs/hardhat-ethers" |
There was a problem hiding this comment.
This shouldn't be necessary if the toolbox is included. Does something stop working if you don't import it?
There was a problem hiding this comment.
You are right, import "@nomiclabs/hardhat-ethers" is redundant. Everything works as expected without it.
I remember having some trouble getting the imports right, so this was likely an artifact of that.
| .setAction(async ({ receiver }, { ethers }) => { | ||
| if (network.name === "hardhat") { | ||
| .setAction(async ({ receiver }, { ethers, config }) => { | ||
| if (config.defaultNetwork === "hardhat") { |
There was a problem hiding this comment.
I don't think this is correct, the default network will almost surely be hardhat all the time.
There was a problem hiding this comment.
You are also correct with that one. It should have been:
task("faucet", "Sends ETH and tokens to an address")
.addPositionalParam("receiver", "The address that will receive them")
.setAction(async ({ receiver }, { ethers, network }) => {
if (network.name === "hardhat") {
// ...
}
// ...Sorry for the inconvenience and thanks for your thorough review. I didn't know that there was a network object available and I also couldn't find any reference implementation which used it. Next time I will read the docs more obsessively!
|
@fvictorio should we merge this into a If we do that, we should add a link to that branch in |
The entire project uses now typescript.
The typescript restrictions are relatively lose so less changes were required then (my) last time.
I've tested the app locally and everything works as expected.
Apart from the port to typescript, no other changes were done.