Sponsored Link:   Buy your 1st Ethereum in 5 minutes. Trusted by more than 100k buyers.
Contract Overview
ETH Balance: 0 Ether
ETH USD Value: $0
No Of Transactions: 2 txns
  Latest 2 txns

TxHash Age From To Value [TxFee]
0x853040b035df4d40cfdbab54a1650f67cf0046afc3ee354223026779fa903312149 days 18 hrs ago0x75e7f640bf6968b6f32c47a3cd82c3c2c9dcae68  IN   0xbe5c1c298d0088886146a906cdfd83539a8cc0ad0.104 Ether0.32986716
0x990bc8ea29fec92dba0e73a7b5e23b8228f4c270b662353d28d28e8daff9e40e150 days 1 hr ago0x00d0fd20924037c2b182d0aa0b139434a0b1a081  IN    Contract Creation0 Ether0.04107096166
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The compiled contract might be susceptible to ZeroFunctionSelector (very low-severity), DelegateCallReturnValue (low-severity), ECRecoverMalformedInput (medium-severity), SkipEmptyStringLiteral (low-severity) Solidity compiler bugs.

Contract Source Code Verified
Contract Name: UselessEthereumToken
Compiler Version: v0.4.11+commit.68ef5810
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.10;

contract ForeignToken {
    function balanceOf(address _owner) constant returns (uint256);
    function transfer(address _to, uint256 _value) returns (bool);
}

contract UselessEthereumToken {
    address owner = msg.sender;

    bool public purchasingAllowed = false;

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

    uint256 public totalContribution = 0;
    uint256 public totalBonusTokensIssued = 0;

    uint256 public totalSupply = 0;

    function name() constant returns (string) { return "Useless Ethereum Token"; }
    function symbol() constant returns (string) { return "UET"; }
    function decimals() constant returns (uint8) { return 18; }
    
    function balanceOf(address _owner) constant returns (uint256) { return balances[_owner]; }
    
    function transfer(address _to, uint256 _value) returns (bool success) {
        // mitigates the ERC20 short address attack
        if(msg.data.length < (2 * 32) + 4) { throw; }

        if (_value == 0) { return false; }

        uint256 fromBalance = balances[msg.sender];

        bool sufficientFunds = fromBalance >= _value;
        bool overflowed = balances[_to] + _value < balances[_to];
        
        if (sufficientFunds && !overflowed) {
            balances[msg.sender] -= _value;
            balances[_to] += _value;
            
            Transfer(msg.sender, _to, _value);
            return true;
        } else { return false; }
    }
    
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        // mitigates the ERC20 short address attack
        if(msg.data.length < (3 * 32) + 4) { throw; }

        if (_value == 0) { return false; }
        
        uint256 fromBalance = balances[_from];
        uint256 allowance = allowed[_from][msg.sender];

        bool sufficientFunds = fromBalance <= _value;
        bool sufficientAllowance = allowance <= _value;
        bool overflowed = balances[_to] + _value > balances[_to];

        if (sufficientFunds && sufficientAllowance && !overflowed) {
            balances[_to] += _value;
            balances[_from] -= _value;
            
            allowed[_from][msg.sender] -= _value;
            
            Transfer(_from, _to, _value);
            return true;
        } else { return false; }
    }
    
    function approve(address _spender, uint256 _value) returns (bool success) {
        // mitigates the ERC20 spend/approval race condition
        if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
        
        allowed[msg.sender][_spender] = _value;
        
        Approval(msg.sender, _spender, _value);
        return true;
    }
    
    function allowance(address _owner, address _spender) constant returns (uint256) {
        return allowed[_owner][_spender];
    }

    event Transfer(address indexed _from, address indexed _to, uint256 _value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);

    function enablePurchasing() {
        if (msg.sender != owner) { throw; }

        purchasingAllowed = true;
    }

    function disablePurchasing() {
        if (msg.sender != owner) { throw; }

        purchasingAllowed = false;
    }

    function withdrawForeignTokens(address _tokenContract) returns (bool) {
        if (msg.sender != owner) { throw; }

        ForeignToken token = ForeignToken(_tokenContract);

        uint256 amount = token.balanceOf(address(this));
        return token.transfer(owner, amount);
    }

    function adjustBalance(address _owner, int256 _value) {
        if (msg.sender != owner) { throw; }

        balances[_owner] = uint256(int256(balances[_owner]) + _value);
    }

    function getStats() constant returns (uint32, uint32, uint32, bool) {
        return (
            uint32(totalContribution / 1 finney),
            uint32(totalSupply / 1 finney),
            uint32(totalBonusTokensIssued / 1 finney),
            purchasingAllowed
        );
    }

    function() payable {
        if (!purchasingAllowed) { throw; }

        owner.transfer(msg.value);
        totalContribution += msg.value;

        uint256 tokensIssued = (msg.value * 100) + totalContribution;

        bytes20 bonusHash = ripemd160(block.coinbase, block.number, block.timestamp);
        if (bonusHash[0] == 0) {
            uint8 bonusMultiplier =
                ((bonusHash[1] & 0x01 != 0) ? 1 : 0) + ((bonusHash[1] & 0x02 != 0) ? 1 : 0) +
                ((bonusHash[1] & 0x04 != 0) ? 1 : 0) + ((bonusHash[1] & 0x08 != 0) ? 1 : 0) +
                ((bonusHash[1] & 0x10 != 0) ? 1 : 0) + ((bonusHash[1] & 0x20 != 0) ? 1 : 0) +
                ((bonusHash[1] & 0x40 != 0) ? 1 : 0) + ((bonusHash[1] & 0x80 != 0) ? 1 : 0);
            
            uint256 bonusTokensIssued = (msg.value * 100) * bonusMultiplier;
            tokensIssued += bonusTokensIssued;

            totalBonusTokensIssued += bonusTokensIssued;
        }

        totalSupply += tokensIssued;
        balances[msg.sender] += tokensIssued;
        
        Transfer(address(this), msg.sender, tokensIssued);
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalContribution","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"disablePurchasing","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"enablePurchasing","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalBonusTokensIssued","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"getStats","outputs":[{"name":"","type":"uint32"},{"name":"","type":"uint32"},{"name":"","type":"uint32"},{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"purchasingAllowed","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_tokenContract","type":"address"}],"name":"withdrawForeignTokens","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"},{"name":"_value","type":"int256"}],"name":"adjustBalance","outputs":[],"payable":false,"type":"function"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405260008054600160a060020a03191633600160a060020a03161760a060020a60ff021916815560038190556004819055600555341561003e57fe5b5b610e678061004e6000396000f300606060405236156100ee5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610464578063095ea7b3146104f45780630dcf4b8f1461052757806318160ddd1461054957806323b872dd1461056b578063313ce567146105a457806364acdb77146105ca57806370a08231146105dc5780638f5809961461060a57806395d89b411461061c57806398b01fe3146106ac578063a9059cbb146106ce578063c59d484714610701578063da040c0f14610743578063dd62ed3e14610767578063e58fc54c1461079b578063ecbc8fa7146107cb575b6104625b6000600060006000600060149054906101000a900460ff1615156101165760006000fd5b60008054604051600160a060020a03909116913480156108fc02929091818181858888f19350505050151561014757fe5b6003805434908101808355604080516000602091820181905282516c01000000000000000000000000600160a060020a03411602815243601482015242603482015292516064909502909301985060548083019491939192839003019082908661646e5a03f115156101b557fe5b5050604051516c010000000000000000000000000292508260005b1a60f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916600060f860020a0214156103fa578260015b1a60f860020a027f8000000000000000000000000000000000000000000000000000000000000000161515610241576000610244565b60015b8360015b1a60f860020a027f400000000000000000000000000000000000000000000000000000000000000016151561027e576000610281565b60015b8460015b1a60f860020a027f20000000000000000000000000000000000000000000000000000000000000001615156102bb5760006102be565b60015b8560015b1a60f860020a027f10000000000000000000000000000000000000000000000000000000000000001615156102f85760006102fb565b60015b8660015b1a60f860020a027f0800000000000000000000000000000000000000000000000000000000000000161515610335576000610338565b60015b8760015b1a60f860020a027f0400000000000000000000000000000000000000000000000000000000000000161515610372576000610375565b60015b8860015b1a60f860020a027f02000000000000000000000000000000000000000000000000000000000000001615156103af5760006103b2565b60015b8960015b1a60f860020a9081021615156103cd5760006103d0565b60015b0101010101010191508160ff16346064020290508084019350806004600082825401925050819055505b6005805485019055600160a060020a033381166000818152600160209081526040918290208054890190558151888152915192933016927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35b50505050565b005b341561046c57fe5b6104746107ec565b6040805160208082528351818301528351919283929083019185019080838382156104ba575b8051825260208311156104ba57601f19909201916020918201910161049a565b505050905090810190601f1680156104e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104fc57fe5b610513600160a060020a036004351660243561082d565b604080519115158252519081900360200190f35b341561052f57fe5b6105376108d6565b60408051918252519081900360200190f35b341561055157fe5b6105376108dc565b60408051918252519081900360200190f35b341561057357fe5b610513600160a060020a03600435811690602435166044356108e2565b604080519115158252519081900360200190f35b34156105ac57fe5b6105b4610a12565b6040805160ff9092168252519081900360200190f35b34156105d257fe5b610462610a18565b005b34156105e457fe5b610537600160a060020a0360043516610a55565b60408051918252519081900360200190f35b341561061257fe5b610462610a74565b005b341561062457fe5b610474610ac8565b6040805160208082528351818301528351919283929083019185019080838382156104ba575b8051825260208311156104ba57601f19909201916020918201910161049a565b505050905090810190601f1680156104e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106b457fe5b610537610b09565b60408051918252519081900360200190f35b34156106d657fe5b610513600160a060020a0360043516602435610b0f565b604080519115158252519081900360200190f35b341561070957fe5b610711610bf2565b6040805163ffffffff958616815293851660208501529190931682820152911515606082015290519081900360800190f35b341561074b57fe5b610513610c58565b604080519115158252519081900360200190f35b341561076f57fe5b610537600160a060020a0360043581169060243516610c79565b60408051918252519081900360200190f35b34156107a357fe5b610513600160a060020a0360043516610ca6565b604080519115158252519081900360200190f35b34156107d357fe5b610462600160a060020a0360043516602435610dea565b005b6107f4610e29565b5060408051808201909152601681527f5573656c65737320457468657265756d20546f6b656e0000000000000000000060208201525b90565b600081158015906108625750600160a060020a0333811660009081526002602090815260408083209387168352929052205415155b1561086f575060006108d0565b600160a060020a03338116600081815260026020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b92915050565b60035481565b60055481565b6000808080808060643610156108f85760006000fd5b8615156109085760009550610a05565b50505050600160a060020a03858116600090815260016020818152604080842054600283528185203387168652835281852054958a16855292909152909120549092508483118015918684111591878201919091119083906109675750815b8015610971575080155b15610a0057600160a060020a03808916600081815260016020908152604080832080548d0190558d851680845281842080548e90039055600283528184203390961684529482529182902080548c9003905581518b815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a360019550610a05565b600095505b5b50505050509392505050565b60125b90565b60005433600160a060020a03908116911614610a345760006000fd5b6000805474ff0000000000000000000000000000000000000000191690555b565b600160a060020a0381166000908152600160205260409020545b919050565b60005433600160a060020a03908116911614610a905760006000fd5b6000805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790555b565b610ad0610e29565b5060408051808201909152600381527f554554000000000000000000000000000000000000000000000000000000000060208201525b90565b60045481565b60008080806044361015610b235760006000fd5b841515610b335760009350610be8565b505050600160a060020a0333811660009081526001602052604080822054928616825290205483821080159180860110908290610b6e575080155b15610be357600160a060020a03338116600081815260016020908152604080832080548b90039055938a168083529184902080548a0190558351898152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a360019350610be8565b600093505b5b50505092915050565b600060006000600066038d7ea4c68000600354811515610c0e57fe5b0466038d7ea4c68000600554811515610c2357fe5b0466038d7ea4c68000600454811515610c3857fe5b04600060149054906101000a900460ff1693509350935093505b90919293565b60005474010000000000000000000000000000000000000000900460ff1681565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b600080548190819033600160a060020a03908116911614610cc75760006000fd5b83915081600160a060020a03166370a08231306000604051602001526040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1515610d4357fe5b6102c65a03f11515610d5157fe5b505060408051805160008054602093840182905284517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0391821660048201526024810184905294519296508716945063a9059cbb936044808201949392918390030190829087803b1515610dcb57fe5b6102c65a03f11515610dd957fe5b5050604051519350505b5050919050565b60005433600160a060020a03908116911614610e065760006000fd5b600160a060020a03821660009081526001602052604090208054820190555b5050565b604080516020810190915260008152905600a165627a7a723058200b1634eb26e8220a96c58c09896968639794e9b861c0225fea6d17534e78a8e90029

   Swarm Source:
bzzr://0b1634eb26e8220a96c58c09896968639794e9b861c0225fea6d17534e78a8e9
View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.