refer to:
https://hardhat.org/ignition/docs/guides/modifications
首次部署贼简单 不过我失败了。准备使用foundry
第二次部署(修改了contract之后)
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules"); module.exports = buildModule("Apollo", (m) => { const apollo = m.contract("Rocket", ["Saturn V"]); m.call(apollo, "launch", []); const artemis = m.contract("Rocket", ["Artemis 2"], { id: "artemis" }); m.call(artemis, "launch", []); return { apollo, artemis }; });
撤销上一次部署:
npx hardhat ignition wipe SayHi2Module SayHi2_FutureId