Test & Deploy a Smart Contract
const { expect } = require("chai");
const { ethers } = require("hardhat");
describe("AchievementToken", function () {
it("Should deploy and issue tokens correctly", async function () {
const [owner, addr1] = await ethers.getSigners();
const AchievementToken = await ethers.getContractFactory("AchievementToken");
const token = await AchievementToken.deploy();
await token.deployed();
await token.issueToken(addr1.address, 100, "Test Achievement");
expect(await token.balanceOf(addr1.address)).to.equal(100);
});
});
Last updated
