contract RockToken is StandardToken {

    using SafeMath for uint;

    // UM
    uint256 public million = 1000000;
    uint8 public constant decimals = 18;
    string public constant symbol = "RKT";
    string public constant name = "Rock Token";
    bool public canConvertTokens;

    // Inited in constructor
    address public contractOwner; // Can stop the allocation of delayed tokens and can allocate delayed tokens.
    address public futureOwner;
    address public masterContractAddress; // The ICO contract to issue tokens.

    // Constructor
    // Sets the contractOwner for the onlyOwner modifier
    // Sets the public values in the ERC20 standard token
    // Opens the delayed allocation window.
    // can pre-allocate balances for an array of _accounts
    function RockToken(address _masterContractAddress, address[] _accounts, uint[] _balances) public {
        contractOwner = msg.sender;
        masterContractAddress = _masterContractAddress;

        totalSupply = 0;
        canConvertTokens = true;

        uint length = _accounts.length;
        require(length == _balances.length);
        for (uint i = 0; i < length; i++) {
            balances[_accounts[i]] = _balances[i];
            // Fire Transfer event for ERC-20 compliance. Adjust totalSupply.
            Transfer(address(0), _accounts[i], _balances[i]);
            totalSupply = totalSupply.add(_balances[i]);
        }
    }

    // Can only be called by the master contract during the TokenSale to issue tokens.
    function convertTokens(uint256 _amount, address _tokenReceiver) onlyMasterContract public {
        require(canConvertTokens);
        balances[_tokenReceiver] = balances[_tokenReceiver].add(_amount);
    }

    // Fire Transfer event for ERC-20 compliance. Adjust totalSupply. Can only be called by the Master Contract.
    function reportConvertTokens(uint256 _amount, address _address) onlyMasterContract public {
        require(canConvertTokens);
        Transfer(address(0), _address, _amount);
        totalSupply = totalSupply.add(_amount);
    }

    function stopConvertTokens() onlyOwner public {
        canConvertTokens = false;
    }

    // Called by the token owner to block or unblock transfers
    function enableTransfers() onlyOwner public {
        transferEnabled = true;
    }

    modifier onlyOwner() {
        require(msg.sender == contractOwner);
        _;
    }

    modifier onlyMasterContract() {
        require(msg.sender == masterContractAddress);
        _;
    }

    // Makes sure that the ownership is only changed by the owner
    function transferOwnership(address _newOwner) public onlyOwner {
    // Makes sure that the contract will have an owner
        require(_newOwner != address(0));
        futureOwner = _newOwner;
    }

    function claimOwnership() public {
        require(msg.sender == futureOwner);
        contractOwner = msg.sender;
        futureOwner = address(0);
    }

}
function convertTokens(uint256 _amount, address _tokenReceiver) onlyMasterContract public {
    require(canConvertTokens);
    balances[_tokenReceiver] = balances[_tokenReceiver].add(_amount);
}

// Can only be called by the master contract during the TokenSale to issue tokens.