From 2a410eb2744e88fac7ca79159ef6cea4b6740add Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Fri, 26 Apr 2019 06:57:11 -0300 Subject: [PATCH] fix embark run --- contracts/token/MiniMeToken.sol | 47 +++++++++++++++++++++++- contracts/token/MiniMeTokenFactory.sol | 49 -------------------------- 2 files changed, 46 insertions(+), 50 deletions(-) delete mode 100644 contracts/token/MiniMeTokenFactory.sol diff --git a/contracts/token/MiniMeToken.sol b/contracts/token/MiniMeToken.sol index 7151b7b..f4cdd04 100644 --- a/contracts/token/MiniMeToken.sol +++ b/contracts/token/MiniMeToken.sol @@ -29,7 +29,6 @@ pragma solidity >=0.5.0 <0.6.0; import "../common/Controlled.sol"; import "./TokenController.sol"; import "./ApproveAndCallFallBack.sol"; -import "./MiniMeTokenFactory.sol"; /** * @dev The actual token contract, the default controller is the msg.sender @@ -631,3 +630,49 @@ contract MiniMeToken is Controlled { ); } + +//////////////// +// MiniMeTokenFactory +//////////////// + +/** + * @dev This contract is used to generate clone contracts from a contract. + * In solidity this is the way to create a contract from a contract of the + * same class + */ +contract MiniMeTokenFactory { + + /** + * @notice Update the DApp by creating a new token with new functionalities + * the msg.sender becomes the controller of this clone token + * @param _parentToken Address of the token being cloned + * @param _snapshotBlock Block of the parent token that will + * determine the initial distribution of the clone token + * @param _tokenName Name of the new token + * @param _decimalUnits Number of decimals of the new token + * @param _tokenSymbol Token Symbol for the new token + * @param _transfersEnabled If true, tokens will be able to be transferred + * @return The address of the new token contract + */ + function createCloneToken( + address _parentToken, + uint _snapshotBlock, + string memory _tokenName, + uint8 _decimalUnits, + string memory _tokenSymbol, + bool _transfersEnabled + ) public returns (MiniMeToken) { + MiniMeToken newToken = new MiniMeToken( + address(this), + _parentToken, + _snapshotBlock, + _tokenName, + _decimalUnits, + _tokenSymbol, + _transfersEnabled + ); + + newToken.changeController(msg.sender); + return newToken; + } +} \ No newline at end of file diff --git a/contracts/token/MiniMeTokenFactory.sol b/contracts/token/MiniMeTokenFactory.sol deleted file mode 100644 index d8e7bbe..0000000 --- a/contracts/token/MiniMeTokenFactory.sol +++ /dev/null @@ -1,49 +0,0 @@ -pragma solidity >=0.5.0 <0.6.0; - -import "./MiniMeToken.sol"; - -//////////////// -// MiniMeTokenFactory -//////////////// - -/** - * @dev This contract is used to generate clone contracts from a contract. - * In solidity this is the way to create a contract from a contract of the - * same class - */ -contract MiniMeTokenFactory { - - /** - * @notice Update the DApp by creating a new token with new functionalities - * the msg.sender becomes the controller of this clone token - * @param _parentToken Address of the token being cloned - * @param _snapshotBlock Block of the parent token that will - * determine the initial distribution of the clone token - * @param _tokenName Name of the new token - * @param _decimalUnits Number of decimals of the new token - * @param _tokenSymbol Token Symbol for the new token - * @param _transfersEnabled If true, tokens will be able to be transferred - * @return The address of the new token contract - */ - function createCloneToken( - address _parentToken, - uint _snapshotBlock, - string memory _tokenName, - uint8 _decimalUnits, - string memory _tokenSymbol, - bool _transfersEnabled - ) public returns (MiniMeToken) { - MiniMeToken newToken = new MiniMeToken( - address(this), - _parentToken, - _snapshotBlock, - _tokenName, - _decimalUnits, - _tokenSymbol, - _transfersEnabled - ); - - newToken.changeController(msg.sender); - return newToken; - } -} \ No newline at end of file