Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28 lines
811 B
JavaScript
28 lines
811 B
JavaScript
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);
|
|
});
|
|
});
|