Files
hardhat-simple-storage/scripts/deploy.js
2024-08-02 18:50:02 +08:00

21 lines
537 B
JavaScript

// imports
const { ethers } = require("hardhat");
// async main
async function main() {
const simpleStorageFactory =
await ethers.getContractFactory("SimpleStorage");
console.log("Deploying contract...");
const simpleStorage = await simpleStorageFactory.deploy();
await simpleStorage.deployed();
console.log("Deployed contract to: " + simpleStorage.address);
}
// main
main()
.then(() => process.getMaxListeners(0))
.catch((error) => {
console.error(error);
process.exit(1);
});