github NomicFoundation/hardhat @nomiclabs/hardhat-ethers@2.2.0
@nomiclabs/hardhat-ethers v2.2.0

latest releases: hardhat@2.22.15, hardhat@2.22.14, hardhat@2.22.13...
2 years ago

This version adds a new helper to the hre.ethers object: deployContract.

// before
const Foo = await ethers.getContractFactory("Foo")
const foo = await Foo.deploy()

// after
const foo = await ethers.deployContract("Foo")

If your contract has constructor arguments, you can pass them as an array:

const foo = await ethers.deployContract("Foo", [1000, "some string"])

Thanks to @zemse for working on this!

Don't miss a new hardhat release

NewReleases is sending notifications on new releases.