work-sample/scripts/deploy.ts

22 lines
683 B
TypeScript
Raw Normal View History

2022-11-09 07:19:59 -08:00
import { ethers } from "hardhat";
async function main() {
const [deployer] = await ethers.getSigners();
console.log("Deploying contracts with the account:", deployer.address);
const Token = await ethers.getContractFactory("MagnaToken");
const token = await Token.deploy();
console.log("Token address:", token.address);
const Airdrop = await ethers.getContractFactory("Airdrop");
const airdrop = await Airdrop.deploy(token.address);
console.log("Airdrop address:", airdrop.address);
}
// We recommend this pattern to be able to use async/await everywhere
// and properly handle errors.
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});