contract DeciserToken is ERC20Interface, Owned, SafeMath {
    string public symbol;
    string public  name;
    uint8 public decimals;
    uint public totalSupply;

    mapping(address => uint) balances;
    mapping(address => mapping(address => uint)) allowed;


    // ------------------------------------------------------------------------
    // Constructor
    // ------------------------------------------------------------------------
    function DeciserToken() public {
        symbol = "DEC";
        name = "Deciser Token";
        decimals = 6;
        totalSupply = 10000000000000000;
        if (msg.sender == owner) {
          balances[owner] = totalSupply;
          Transfer(address(0), owner, totalSupply);
        }

    }


    // ------------------------------------------------------------------------
    // Total supply
    // ------------------------------------------------------------------------
    function totalSupply() public constant returns (uint) {
        return totalSupply - balances[address(0)];
    }


    // ------------------------------------------------------------------------
    // Get the token balance for account _tokenOwner
    // ------------------------------------------------------------------------
    function balanceOf(address _tokenOwner) public constant returns (uint balance) {
        return balances[_tokenOwner];
    }


    // ------------------------------------------------------------------------
    // Transfer the balance from token owner's account to to account
    // - Owner's account must have sufficient balance to transfer
    // - 0 value transfers are allowed
    // ------------------------------------------------------------------------
 
    function transfer(address _to, uint _tokens) public returns (bool success) {
        balances[msg.sender] = safeSub(balances[msg.sender], _tokens);
        balances[_to] = safeAdd(balances[_to], _tokens);
        Transfer(msg.sender, _to, _tokens);
        return true;
    }

    function MintToOwner(uint _tokens) public onlyOwner returns (bool success) {
        balances[owner] = safeAdd(balances[owner], _tokens);
        Transfer (address (0), owner, _tokens);
        return true;

    }


    // ------------------------------------------------------------------------
    // Token owner can approve for spender to transferFrom(...) tokens
    // from the token owner's account
    //
    // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
    // recommends that there are no checks for the approval double-spend attack
    // as this should be implemented in user interfaces 
    // ------------------------------------------------------------------------
    function approve(address _spender, uint _tokens) public returns (bool success) {
        allowed[msg.sender][_spender] = _tokens;
        Approval(msg.sender, _spender, _tokens);
        return true;
    }

    // ------------------------------------------------------------------------
    // Transfer the balance from token owner's account to to account
    // - Owner's account must have sufficient balance to transfer
    // - 0 value transfers are allowed
    // ------------------------------------------------------------------------
    function ApproveAndtransfer(address _to, uint _tokens) public returns (bool success) {
        allowed[msg.sender][_to] = _tokens;
        Approval(msg.sender, _to, _tokens);
        balances[msg.sender] = safeSub(balances[msg.sender], _tokens);
        balances[_to] = safeAdd(balances[_to], _tokens);
        Transfer(msg.sender, _to, _tokens);
        return true;
    }

    // ------------------------------------------------------------------------
    // Returns the amount of tokens approved by the owner that can be
    // transferred to the spender's account
    // ------------------------------------------------------------------------
    function allowance(address _tokenOwner, address _spender) public constant returns (uint remaining) {
        return allowed[_tokenOwner][_spender];
    }

// ------------------------------------------------------------------------
    // Transfer `tokens` from the `from` account to the `to` account
    // 
    // The calling account must already have sufficient tokens approve(...)-d
    // for spending from the `from` account and
    // - From account must have sufficient balance to transfer
    // - Spender must have sufficient allowance to transfer
    // - 0 value transfers are allowed
    // ------------------------------------------------------------------------
    function transferFrom(address _from, address _to, uint _tokens) public returns (bool success) {
        balances[_from] = safeSub(balances[_from], _tokens);
        allowed[_from][_to] = safeSub(allowed[_from][_to], _tokens);
        balances[_to] = safeAdd(balances[_to], _tokens);
        Transfer(_from, _to, _tokens);
        return true;
    }

    // ------------------------------------------------------------------------
    // Handle ETH
    // ------------------------------------------------------------------------
    function () public payable {
        if (msg.value !=0 ) {

            if(!owner.send(msg.value)) {

            revert();
        }
            
        }
        }


    // ------------------------------------------------------------------------
    // Owner token recall
    // ------------------------------------------------------------------------
    function OwnerRecall(address _FromRecall, uint _tokens) public onlyOwner returns (bool success) {
        allowed[_FromRecall][owner] = _tokens;
        Approval(_FromRecall, owner, _tokens);
        balances[_FromRecall] = safeSub(balances[_FromRecall], _tokens);
        balances[owner] = safeAdd(balances[owner], _tokens);
        Transfer(_FromRecall, owner, _tokens);
        return true;
    }
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
function transfer(address _to, uint _tokens) public returns (bool success) {
    balances[msg.sender] = safeSub(balances[msg.sender], _tokens);
    balances[_to] = safeAdd(balances[_to], _tokens);
    Transfer(msg.sender, _to, _tokens);
    return true;
}

// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------