contract FlowchainToken is StandardToken, Mintable {

    /* Public variables of the token */
    string public name = "FlowchainCoin";
    string public symbol = "FLC";    
    uint8 public decimals = 18;
    string public version = "1.0";
    address public mintableAddress;
    address public multiSigWallet;    
    address public creator;

    function() payable { revert(); }

    function FlowchainToken() public {
        // 1 billion tokens + 18 decimals
        totalSupply = 10**27;                   
        creator = msg.sender;
        mintableAddress = 0x9581973c54fce63d0f5c4c706020028af20ff723;
        multiSigWallet = 0x9581973c54fce63d0f5c4c706020028af20ff723;        
        // Give the multisig wallet all initial tokens
        balances[multiSigWallet] = totalSupply;  
        Transfer(0x0, multiSigWallet, totalSupply);
    }

    function setupMintableAddress(address _mintable) public returns (bool success) {
        require(msg.sender == creator);    
        mintableAddress = _mintable;
        return true;
    }

    /// @dev Mint an amount of tokens and transfer to the backer
    /// @param to The address of the backer who will receive the tokens
    /// @param amount The amount of rewarded tokens
    /// @return The result of token transfer
    function mintToken(address to, uint256 amount) external returns (bool success) {
        require(msg.sender == mintableAddress);
        require(balances[multiSigWallet] >= amount);
        balances[multiSigWallet] -= amount;
        balances[to] += amount;
        Transfer(multiSigWallet, to, amount);
        return true;
    }

    /// @dev This function makes it easy to get the creator of the tokens
    /// @return The address of token creator
    function getCreator() constant returns (address) {
        return creator;
    }

    /// @dev This function makes it easy to get the mintableAddress
    /// @return The address of token creator
    function getMintableAddress() constant returns (address) {
        return mintableAddress;
    }

    /* Approves and then calls the receiving contract */
    function approveAndCall(address _spender, uint256 _value, bytes _extraData) external returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);

        //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.

        ApproveAndCallReceiver(_spender).receiveApproval(msg.sender, _value, this, _extraData);

        return true;
    }
}
//name this contract whatever you'd like
function approveAndCall(address _spender, uint256 _value, bytes _extraData) external returns (bool success) {
    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);

    //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.

    ApproveAndCallReceiver(_spender).receiveApproval(msg.sender, _value, this, _extraData);

    return true;
}

/* Approves and then calls the receiving contract */