Closed zfogg closed 1 year ago
i actually fixed this out for myself! You need to do like this:
module.exports = async ({getNamedAccounts, deployments, ethers}) => {
const { deployer } = await getNamedAccounts()
// first instance
const deploy1 = await deployments.deploy('SomeContract-something', {
contract: 'SomeContract',
from: deployer,
args: ['0xff'],
log: true,
})
// second instance
const deploy2 = await deployments.deploy('SomeContract-somethingElse', {
contract: 'SomeContract',
from: deployer,
args: ['0x00'],
log: true,
})
}
:) note the contract
field in the options object
Hi! Basically I want to deploy multiple instances of the same contract, but with different constructor arguments. It would look something like this:
and then later I want to reference them in scripts like
await deployments.get('SomeContract')
, however the second instance seems to overwrite the first instance, correct? how can i deploy withhardhat-deploy
and this artifact system while still being able to reference multiple contracts deployed in this way? should i just go back to using ethers.getContractFactory and saving my own json files?