Skip to content

Commit

Permalink
Create 02_deploy_Token.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
EstherLavender authored Nov 23, 2024
1 parent 5759fd3 commit c908c87
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/hardhat/deploy/02_deploy_Token.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { deployments, ethers } from "hardhat";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { verifyContract } from "./helpers";

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const [deployer] = await ethers.getSigners();
const ownerAddress = process.env.OWNER_ADDRESS ?? deployer.address;
const tokenContractName = "UAVToken";
const tokenName = process.env.TOKEN_NAME ?? "Urban Agri Token";
const tokenSymbol = process.env.TOKEN_SYMBOL ?? "UAV";

console.log("");
console.log("");
console.log("");
console.log("**************************************************************");
console.log("**************************************************************");
console.log("**************************************************************");
console.log(`********** Deploying ${tokenContractName} **********`);

const tokenDeploy = await deployments.deploy(tokenContractName, {
from: deployer.address,
args: [tokenName, tokenSymbol, ownerAddress],
log: true,
});

await verifyContract(tokenDeploy.address, [tokenName, tokenSymbol, ownerAddress]);
};

export default func;
func.tags = ["TokenDeploy"];

0 comments on commit c908c87

Please sign in to comment.