deploy.ts 566 B

12345678910111213141516171819
  1. import { ethers } from "hardhat";
  2. async function main() {
  3. const contractName = 'Flash'
  4. const Contract = await ethers.getContractFactory(contractName);
  5. console.log('deploying...')
  6. const contract = await Contract.deploy();
  7. console.log(`${ contractName } deployed, confirm...`)
  8. await contract.deployed();
  9. console.log(`${ contractName } deployed to ${contract.address}`);
  10. }
  11. // We recommend this pattern to be able to use async/await everywhere
  12. // and properly handle errors.
  13. main().catch((error) => {
  14. console.error(error);
  15. process.exitCode = 1;
  16. });