Add ERC20 opt-in migration contract (#1054)

* Extract standard token behaviuor to reuse it in other tests

* Add opt in ERC20 migration contract

* Make migration contract not to depend from standard token

* Changes based on feedback

* Improve MigratableERC20 inline documentation

* move behaviors to behaviors directory

* refactor MigratableERC20 into ERC20Migrator

* fix errors

* change expectEvent to support multiple events with same name

* fix tests

* update documentation

* rename MigratableERC20 files to ERC20Migrator

* move to drafts

* test beginMigration

* rename to ERC20Migrator

* missing semicolon  (╯°□°)╯︵ ┻━┻

* add non-zero check

* improve documentation based on review comments

* improve test descriptions

* improve docs

* add getters

* fix contract

* improve tests
This commit is contained in:
Facundo Spagnuolo
2018-09-07 19:13:23 +02:00
committed by Francisco Giordano
parent 4b33eaefa2
commit 92133be7ea
9 changed files with 284 additions and 14 deletions

View File

@ -1,4 +1,4 @@
const { shouldBehaveLikeERC20Burnable } = require('./ERC20Burnable.behavior');
const { shouldBehaveLikeERC20Burnable } = require('./behaviors/ERC20Burnable.behavior');
const ERC20BurnableMock = artifacts.require('ERC20BurnableMock');
contract('ERC20Burnable', function ([_, owner, ...otherAccounts]) {

View File

@ -1,7 +1,7 @@
const { assertRevert } = require('../../helpers/assertRevert');
const { ether } = require('../../helpers/ether');
const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior');
const { shouldBehaveLikeERC20Capped } = require('./ERC20Capped.behavior');
const { shouldBehaveLikeERC20Mintable } = require('./behaviors/ERC20Mintable.behavior');
const { shouldBehaveLikeERC20Capped } = require('./behaviors/ERC20Capped.behavior');
const ERC20Capped = artifacts.require('ERC20Capped');

View File

@ -1,4 +1,4 @@
const { shouldBehaveLikeERC20Mintable } = require('./ERC20Mintable.behavior');
const { shouldBehaveLikeERC20Mintable } = require('./behaviors/ERC20Mintable.behavior');
const ERC20MintableMock = artifacts.require('ERC20MintableMock');
const { shouldBehaveLikePublicRole } = require('../../access/roles/PublicRole.behavior');

View File

@ -1,5 +1,5 @@
const { assertRevert } = require('../../helpers/assertRevert');
const expectEvent = require('../../helpers/expectEvent');
const { assertRevert } = require('../../../helpers/assertRevert');
const expectEvent = require('../../../helpers/expectEvent');
const BigNumber = web3.BigNumber;
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';

View File

@ -1,4 +1,5 @@
const { expectThrow } = require('../../helpers/expectThrow');
const { expectThrow } = require('../../../helpers/expectThrow');
const expectEvent = require('../../../helpers/expectEvent');
const BigNumber = web3.BigNumber;

View File

@ -1,5 +1,5 @@
const { assertRevert } = require('../../helpers/assertRevert');
const expectEvent = require('../../helpers/expectEvent');
const { assertRevert } = require('../../../helpers/assertRevert');
const expectEvent = require('../../../helpers/expectEvent');
const BigNumber = web3.BigNumber;