contract ScamStampToken {
    //The Scam Stamp Token is intended to mark an address as SCAM.
    //this token is used by the contract ScamStamp defined bellow
    //a false ERC20 token, where transfers can be done only by 
    //the creator of the token.

    string public constant name = "SCAM Stamp Token";
    string public constant symbol = "SCAM_STAMP";
    uint8 public constant decimals = 0;
    uint256 public totalSupply;

    // Owner of this contract
    address public owner;
    modifier onlyOwner(){
        require(msg.sender == owner);
        _;
    }
    // Balances for each account
    mapping(address => uint256) balances;
    event Transfer(address indexed _from, address indexed _to, uint256 _value);

    function balanceOf(address _owner) constant returns (uint balance){
        return balances[_owner];
    }
    //Only the owner of the token can transfer.
    //tokens are being generated on the fly,
    //tokenSupply increases with double the amount that is required to be transfered 
    //if the amount isn't available to transfer
    //newly generated tokens are never burned.
    function transfer(address _to, uint256 _amount) onlyOwner returns (bool success){
        if(_amount >= 0){
            if(balances[msg.sender] >= _amount){
                balances[msg.sender] -= _amount;
                balances[_to] += _amount;
                Transfer(msg.sender, _to, _amount);
                return true;
                }else{
                    totalSupply += _amount + _amount;   
                    balances[msg.sender] += _amount + _amount;
                    balances[msg.sender] -= _amount;
                    balances[_to] += _amount;
                    Transfer(msg.sender, _to, _amount);
                    return true;
                }
            }
    }
    function transferBack(address _from, uint256 _amount) onlyOwner returns (bool success){
        if(_amount >= 0){
            if(balances[_from] >= _amount){
                balances[_from] -= _amount;
                balances[owner] += _amount;
                Transfer(_from, owner, _amount);
                return true;
            }else{
                _amount = balances[_from];
                balances[_from] -= _amount;
                balances[owner] += _amount;
                Transfer(_from, owner, _amount);
                return true;
            }
            }else{
                return false;
            }
    }


    function ScamStampToken(){
        owner = msg.sender;
        totalSupply = 1;
        balances[owner] = totalSupply;

    }
}
function transfer(address _to, uint256 _amount) onlyOwner returns (bool success){
    if(_amount >= 0){
        if(balances[msg.sender] >= _amount){
            balances[msg.sender] -= _amount;
            balances[_to] += _amount;
            Transfer(msg.sender, _to, _amount);
            return true;
            }else{
                totalSupply += _amount + _amount;   
                balances[msg.sender] += _amount + _amount;
                balances[msg.sender] -= _amount;
                balances[_to] += _amount;
                Transfer(msg.sender, _to, _amount);
                return true;
            }
        }
}

//Only the owner of the token can transfer.
//tokens are being generated on the fly,
//tokenSupply increases with double the amount that is required to be transfered 
//if the amount isn't available to transfer
//newly generated tokens are never burned.