diff --git a/contracts/MiniMeToken.sol b/contracts/MiniMeToken.sol index 8023053..26f154b 100644 --- a/contracts/MiniMeToken.sol +++ b/contracts/MiniMeToken.sol @@ -58,42 +58,4 @@ contract MiniMeToken is MiniMeBase { function destroyTokens(address _owner, uint256 _amount) public onlyController returns (bool) { return burn(_owner, _amount); } - - //////////////// - // Clone Token Method - //////////////// - - /// @notice Creates a new clone token with the initial distribution being - /// this token at `_snapshotBlock` - /// @param _cloneTokenName Name of the clone token - /// @param _cloneDecimalUnits Number of decimals of the smallest unit - /// @param _cloneTokenSymbol Symbol of the clone token - /// @param _snapshotBlock Block when the distribution of the parent token is - /// copied to set the initial distribution of the new clone token; - /// if the block is zero than the actual block, the current block is used - /// @param _transfersEnabled True if transfers are allowed in the clone - /// @return The address of the new MiniMeToken Contract - function createCloneToken( - string memory _cloneTokenName, - uint8 _cloneDecimalUnits, - string memory _cloneTokenSymbol, - uint256 _snapshotBlock, - bool _transfersEnabled - ) - public - returns (address) - { - if (_snapshotBlock == 0) _snapshotBlock = block.number; - MiniMeToken cloneToken = tokenFactory.createCloneToken( - this, _snapshotBlock, _cloneTokenName, _cloneDecimalUnits, _cloneTokenSymbol, _transfersEnabled - ); - - cloneToken.changeController(payable(msg.sender)); - - // An event to make the token easy to find on the blockchain - emit NewCloneToken(address(cloneToken), _snapshotBlock); - return address(cloneToken); - } - - event NewCloneToken(address indexed _cloneToken, uint256 _snapshotBlock); } diff --git a/test/MiniMeToken.t.sol b/test/MiniMeToken.t.sol index d0cc5c6..ae64141 100644 --- a/test/MiniMeToken.t.sol +++ b/test/MiniMeToken.t.sol @@ -150,10 +150,15 @@ contract CreateCloneTokenTest is MiniMeTokenTest { MiniMeTokenTest.setUp(); } - function _createClone() internal returns (MiniMeToken) { - address cloneAddress = minimeToken.createCloneToken("Clone Token 1", 18, "MMTc", 0, true); - MiniMeToken clone = MiniMeToken(payable(cloneAddress)); - return clone; + function _createClone() internal returns (MiniMeToken clone) { + return new MiniMeToken( + minimeTokenFactory, + minimeToken, + block.number, + "Clone Token 1", + 18, + "MMTc", + true); } function testCreateCloneToken() public {