Skip to main content
Glama
SimpleERC20.js1.13 kB
const { expect } = require("chai"); describe("SimpleERC20", function () { let SimpleERC20, token, owner, addr1; beforeEach(async function () { [owner, addr1] = await ethers.getSigners(); SimpleERC20 = await ethers.getContractFactory("SimpleERC20"); token = await SimpleERC20.deploy("Simple Token", "STK", 1000000, 6); await token.waitForDeployment(); }); it("Should set the correct name, symbol, and decimals", async function () { expect(await token.name()).to.equal("Simple Token"); expect(await token.symbol()).to.equal("STK"); expect(await token.decimals()).to.equal(6); }); it("Should mint initial supply to the owner with custom decimals", async function () { const ownerBalance = await token.balanceOf(owner.address); expect(ownerBalance).to.equal(ethers.parseUnits("1000000", 6)); // 1000000 * 10^6 }); it("Should transfer tokens correctly", async function () { await token.transfer(addr1.address, ethers.parseUnits("1000", 6)); const addr1Balance = await token.balanceOf(addr1.address); expect(addr1Balance).to.equal(ethers.parseUnits("1000", 6)); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kukapay/token-minter-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server