2022-10-11Web300
请注意,本文编写于 556 天前,最后修改于 556 天前,其中某些信息可能已经过时。

创建项目

yarn hardhat

部署

const { ethers } = require("hardhat");

async function main() {
  const contractFactory = await ethers.getContractFactory("SimpleStorage");
  const contract = await contractFactory.deploy();
  console.log(contract.address);
  await contract.deployed();
}

main()
  .then(() => {
    process.exit(0);
  })
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });

本文作者:前端小毛

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!