Created
March 29, 2022 10:35
-
-
Save piorot/0ad5189f8ae7b75440b87ace63b71f1a to your computer and use it in GitHub Desktop.
Contract creator should have 100 shares of apartament
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.0; | |
import "hardhat/console.sol"; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
contract Apartment is ERC20 { | |
constructor() ERC20("ApartmentContract", "APRTM") { | |
super._mint(_msgSender(), 100); | |
console.log("Deploying a Greeter with greeting:"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { expect } from "chai"; | |
import { BigNumber } from "ethers"; | |
import { ethers } from "hardhat"; | |
let owner, Alice, Bob, Joe; | |
describe("Apartment", function () { | |
it("Contract creator should have 100 shares of apartament",async () => { | |
const Apartment = await ethers.getContractFactory("Apartment"); | |
const apartment = await Apartment.deploy(); | |
[owner, Alice, Bob, Joe] = await ethers.getSigners(); | |
await apartment.deployed(); | |
let ownerBalance = await apartment.balanceOf(owner.address); | |
expect(ownerBalance).to.equal(100); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment