contract SodaCoinToken is MintableToken {
    string public constant name = "Sodacoin token";
    string public constant symbol = "SOD";
    uint8 public decimals = 18;
    bool public tradingStarted = false;

    // allow exceptional transfer fro sender address - this mapping  can be modified only before the starting rounds
    mapping (address => bool) public transferable;

    /**
     * @dev modifier that throws if spender address is not allowed to transfer
     * and the trading is not enabled
     */
    modifier allowTransfer(address _spender) {

        require(tradingStarted || transferable[_spender]);
        _;
    }
    /**
    *
    * Only the owner of the token smart contract can add allow token to be transfer before the trading has started
    *
    */

    function modifyTransferableHash(address _spender, bool value) onlyOwner public {
        transferable[_spender] = value;
    }

    /**
     * @dev Allows the owner to enable the trading.
     */
    function startTrading() onlyOwner public {
        tradingStarted = true;
    }

    /**
     * @dev Allows anyone to transfer the tokens once trading has started
     * @param _to the recipient address of the tokens.
     * @param _value number of tokens to be transfered.
     */
    function transfer(address _to, uint _value) allowTransfer(msg.sender) public returns (bool){
        return super.transfer(_to, _value);
    }

    /**
     * @dev Allows anyone to transfer the  tokens once trading has started or if the spender is part of the mapping

     * @param _from address The address which you want to send tokens from
     * @param _to address The address which you want to transfer to
     * @param _value uint the amout of tokens to be transfered
     */
    function transferFrom(address _from, address _to, uint _value) allowTransfer(_from) public returns (bool){
        return super.transferFrom(_from, _to, _value);
    }

    /**
   * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender when not paused.
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
    function approve(address _spender, uint256 _value) public allowTransfer(_spender) returns (bool) {
        return super.approve(_spender, _value);
    }

    /**
     * Adding whenNotPaused
     */
    function increaseApproval(address _spender, uint _addedValue) public allowTransfer(_spender) returns (bool success) {
        return super.increaseApproval(_spender, _addedValue);
    }

    /**
     * Adding whenNotPaused
     */
    function decreaseApproval(address _spender, uint _subtractedValue) public allowTransfer(_spender) returns (bool success) {
        return super.decreaseApproval(_spender, _subtractedValue);
    }
}
function approve(address _spender, uint256 _value) public allowTransfer(_spender) returns (bool) {
    return super.approve(_spender, _value);
}

/**
 * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender when not paused.
 * @param _spender The address which will spend the funds.
 * @param _value The amount of tokens to be spent.
 */