forked from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request PaulRBerg#164 from fvictorio/update-ethers-v6
Update dependencies to use ethers v6
- Loading branch information
Showing
10 changed files
with
179 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { Signer } from "@ethersproject/abstract-signer"; | ||
import { task } from "hardhat/config"; | ||
|
||
task("accounts", "Prints the list of accounts", async (_taskArgs, hre) => { | ||
const accounts: Signer[] = await hre.ethers.getSigners(); | ||
const accounts = await hre.ethers.getSigners(); | ||
|
||
for (const account of accounts) { | ||
console.log(await account.getAddress()); | ||
console.log(account.address); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; | ||
import { task } from "hardhat/config"; | ||
import type { TaskArguments } from "hardhat/types"; | ||
|
||
import type { Greeter } from "../../types/Greeter"; | ||
import type { Greeter__factory } from "../../types/factories/Greeter__factory"; | ||
|
||
task("task:deployGreeter") | ||
.addParam("greeting", "Say hello, be nice") | ||
.setAction(async function (taskArguments: TaskArguments, { ethers }) { | ||
const signers: SignerWithAddress[] = await ethers.getSigners(); | ||
const greeterFactory: Greeter__factory = <Greeter__factory>await ethers.getContractFactory("Greeter"); | ||
const greeter: Greeter = <Greeter>await greeterFactory.connect(signers[0]).deploy(taskArguments.greeting); | ||
await greeter.deployed(); | ||
console.log("Greeter deployed to: ", greeter.address); | ||
const signers = await ethers.getSigners(); | ||
const greeterFactory = await ethers.getContractFactory("Greeter"); | ||
const greeter = await greeterFactory.connect(signers[0]).deploy(taskArguments.greeting); | ||
await greeter.waitForDeployment(); | ||
console.log("Greeter deployed to: ", await greeter.getAddress()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address"; | ||
import { ethers } from "hardhat"; | ||
|
||
import type { Greeter } from "../../types/Greeter"; | ||
import type { Greeter__factory } from "../../types/factories/Greeter__factory"; | ||
|
||
export async function deployGreeterFixture(): Promise<{ greeter: Greeter }> { | ||
const signers: SignerWithAddress[] = await ethers.getSigners(); | ||
const admin: SignerWithAddress = signers[0]; | ||
const signers = await ethers.getSigners(); | ||
const admin = signers[0]; | ||
|
||
const greeting: string = "Hello, world!"; | ||
const greeterFactory: Greeter__factory = <Greeter__factory>await ethers.getContractFactory("Greeter"); | ||
const greeter: Greeter = <Greeter>await greeterFactory.connect(admin).deploy(greeting); | ||
await greeter.deployed(); | ||
const greeting = "Hello, world!"; | ||
const greeterFactory = await ethers.getContractFactory("Greeter"); | ||
const greeter = await greeterFactory.connect(admin).deploy(greeting); | ||
await greeter.waitForDeployment(); | ||
|
||
return { greeter }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters