You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
const { constants, expectEvent } = require('@openzeppelin/test-helpers');
|
|
const { ZERO_ADDRESS } = constants;
|
|
|
|
const { expect } = require('chai');
|
|
|
|
const SimpleToken = artifacts.require('SimpleToken');
|
|
|
|
contract('SimpleToken', function ([_, creator]) {
|
|
beforeEach(async function () {
|
|
this.token = await SimpleToken.new({ from: creator });
|
|
});
|
|
|
|
it('has a name', async function () {
|
|
expect(await this.token.name()).to.equal('SimpleToken');
|
|
});
|
|
|
|
it('has a symbol', async function () {
|
|
expect(await this.token.symbol()).to.equal('SIM');
|
|
});
|
|
|
|
it('has 18 decimals', async function () {
|
|
expect(await this.token.decimals()).to.be.bignumber.equal('18');
|
|
});
|
|
|
|
it('assigns the initial total supply to the creator', async function () {
|
|
const totalSupply = await this.token.totalSupply();
|
|
const creatorBalance = await this.token.balanceOf(creator);
|
|
|
|
expect(creatorBalance).to.be.bignumber.equal(totalSupply);
|
|
|
|
await expectEvent.inConstruction(this.token, 'Transfer', {
|
|
from: ZERO_ADDRESS,
|
|
to: creator,
|
|
value: totalSupply,
|
|
});
|
|
});
|
|
});
|
|
|