List of Solidity Kata to Update - codewars/content-issues GitHub Wiki
No kata left to update.
Note that web3
package is no longer used and not installed.
See https://hardhat.org/tutorial/testing-contracts for how to write tests.
Click to see a basic test example
const { loadFixture } = require("@nomicfoundation/hardhat-network-helpers");
const { assert } = require("chai");
describe('GiftCoin', function() {
async function deployFixture() {
const accounts = await ethers.getSigners();
const Contract = await ethers.getContractFactory("GiftCoin");
const contract = await Contract.deploy();
await contract.deployed();
return { accounts, contract };
}
it("should start an account with 0 coins", async function() {
const { accounts, contract } = await loadFixture(deployFixture);
const balance = await contract.balanceOf(accounts[0].address);
assert.equal(balance, 0, "addresses should initially have zero coins");
});
});