wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.19k stars 292 forks source link

Avoid front running between deterministic deployment and initialize function #448

Open sherpya opened 1 year ago

sherpya commented 1 year ago

Describe the bug I 'm using deterministic deployment, but I'm not using a proxy (perhaps I suspect proxy deployment has same issue). My contract has an empty constructor and I use initializer from oz, so:

await deploy('MyContract', { deterministicDeployment: true });
await execute('MyContract', {}, 'initialize', args);

There is a way to do inside a single transaction?

wighawag commented 1 year ago

There is no mechanism in hardhat-deploy for this currently You can wrap it in a multi call but you ll have to save the deployment information manually using deployments.save)