MiniMeTokenInterface.sol
1 pragma solidity ^0.5.2; 2 3 import "./ERC20Token.sol"; 4 5 6 contract MiniMeTokenInterface is ERC20Token { 7 8 /** 9 * @notice `msg.sender` approves `_spender` to send `_amount` tokens on 10 * its behalf, and then a function is triggered in the contract that is 11 * being approved, `_spender`. This allows users to use their tokens to 12 * interact with contracts in one function call instead of two 13 * @param _spender The address of the contract able to transfer the tokens 14 * @param _amount The amount of tokens to be approved for transfer 15 * @return True if the function call was successful 16 */ 17 function approveAndCall( 18 address _spender, 19 uint256 _amount, 20 bytes calldata _extraData 21 ) 22 external 23 returns (bool success); 24 25 /** 26 * @notice Creates a new clone token with the initial distribution being 27 * this token at `_snapshotBlock` 28 * @param _cloneTokenName Name of the clone token 29 * @param _cloneDecimalUnits Number of decimals of the smallest unit 30 * @param _cloneTokenSymbol Symbol of the clone token 31 * @param _snapshotBlock Block when the distribution of the parent token is 32 * copied to set the initial distribution of the new clone token; 33 * if the block is zero than the actual block, the current block is used 34 * @param _transfersEnabled True if transfers are allowed in the clone 35 * @return The address of the new MiniMeToken Contract 36 */ 37 function createCloneToken( 38 string calldata _cloneTokenName, 39 uint8 _cloneDecimalUnits, 40 string calldata _cloneTokenSymbol, 41 uint _snapshotBlock, 42 bool _transfersEnabled 43 ) 44 external 45 returns(address); 46 47 /** 48 * @notice Generates `_amount` tokens that are assigned to `_owner` 49 * @param _owner The address that will be assigned the new tokens 50 * @param _amount The quantity of tokens generated 51 * @return True if the tokens are generated correctly 52 */ 53 function generateTokens( 54 address _owner, 55 uint _amount 56 ) 57 external 58 returns (bool); 59 60 /** 61 * @notice Burns `_amount` tokens from `_owner` 62 * @param _owner The address that will lose the tokens 63 * @param _amount The quantity of tokens to burn 64 * @return True if the tokens are burned correctly 65 */ 66 function destroyTokens( 67 address _owner, 68 uint _amount 69 ) 70 external 71 returns (bool); 72 73 /** 74 * @notice Enables token holders to transfer their tokens freely if true 75 * @param _transfersEnabled True if transfers are allowed in the clone 76 */ 77 function enableTransfers(bool _transfersEnabled) external; 78 79 /** 80 * @notice This method can be used by the controller to extract mistakenly 81 * sent tokens to this contract. 82 * @param _token The address of the token contract that you want to recover 83 * set to 0 in case you want to extract ether. 84 */ 85 function claimTokens(address _token) external; 86 87 /** 88 * @dev Queries the balance of `_owner` at a specific `_blockNumber` 89 * @param _owner The address from which the balance will be retrieved 90 * @param _blockNumber The block number when the balance is queried 91 * @return The balance at `_blockNumber` 92 */ 93 function balanceOfAt( 94 address _owner, 95 uint _blockNumber 96 ) 97 public 98 view 99 returns (uint); 100 101 /** 102 * @notice Total amount of tokens at a specific `_blockNumber`. 103 * @param _blockNumber The block number when the totalSupply is queried 104 * @return The total amount of tokens at `_blockNumber` 105 */ 106 function totalSupplyAt(uint _blockNumber) public view returns(uint); 107 108 }