deploy.ts 575 B

123456789101112131415161718
  1. import { DeployFunction } from "hardhat-deploy/types";
  2. import { HardhatRuntimeEnvironment } from "hardhat/types";
  3. const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
  4. const { deployer } = await hre.getNamedAccounts();
  5. const { deploy } = hre.deployments;
  6. const greeter = await deploy("Greeter", {
  7. from: deployer,
  8. args: ["Bonjour, le monde!"],
  9. log: true,
  10. });
  11. console.log(`Greeter contract: `, greeter.address);
  12. };
  13. export default func;
  14. func.id = "deploy_greeter"; // id required to prevent reexecution
  15. func.tags = ["Greeter"];