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.
27 lines
811 B
27 lines
811 B
const { BN, ether, expectRevert } = require('@openzeppelin/test-helpers');
|
|
const { shouldBehaveLikeERC20Capped } = require('./ERC20Capped.behavior');
|
|
|
|
const ERC20Capped = artifacts.require('ERC20CappedMock');
|
|
|
|
contract('ERC20Capped', function (accounts) {
|
|
const [ minter, ...otherAccounts ] = accounts;
|
|
|
|
const cap = ether('1000');
|
|
|
|
const name = 'My Token';
|
|
const symbol = 'MTKN';
|
|
|
|
it('requires a non-zero cap', async function () {
|
|
await expectRevert(
|
|
ERC20Capped.new(name, symbol, new BN(0), { from: minter }), 'ERC20Capped: cap is 0',
|
|
);
|
|
});
|
|
|
|
context('once deployed', async function () {
|
|
beforeEach(async function () {
|
|
this.token = await ERC20Capped.new(name, symbol, cap, { from: minter });
|
|
});
|
|
|
|
shouldBehaveLikeERC20Capped(minter, otherAccounts, cap);
|
|
});
|
|
});
|
|
|