Contract Overview | EthHodler
Balance: 4.323639709497283734 Ether
Ether Value: $388.52 (@ $89.86/ETH)
Transactions: 100 txns
Token Tracker: EthHodler (EHDL)
 Latest 25 transactions from a total of 100 transactions

TxHash Age From To Value [TxFee]
0x81dbdb4d53f086c1cc1785f542addb59907aa2ed3f478835f633056cb12dcca325 days 6 hrs ago0x50e6682a9195774b60b23262875068e69b967e48  IN   EthHodler0 Ether0.000258048
0x5d126c806d74cabf0011baa33e673e40e51f86c958ee38f54d5468b120f6d7a0157 days 12 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler0.0101 Ether0.00128124
0x415d9d8fe77c6b833075e5a13179adb0dd21624a06c551bd57389fd8953ccdca171 days 16 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler1.01 Ether0.00005039
0x19cfd726b1ff411dc2b9c65d23448ebc6b15d99373c2ae627513f515a6ab293b189 days 22 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler0 Ether0.000187008
0xd4cca934d896777e44a67fbe6e98afc6c01b6344743b1ec78d635338ac2f8f8d220 days 3 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler0 Ether0.000129024
0x3ba3972fb55ca61c3eec20033386a82ad18f4bbd12d5ec8bf12593a767b62477220 days 3 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler1 Ether0.00010078
0xedeb17bf9b3d3cf516d8a63a271d4539851e9f8cb24bcad014925a833c9fdb0e272 days 12 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler0.02 Ether0.00021354
0xa5867618fcaa873d04cc5e69957b0b904352c20b068a079299a0f7bfeb12bf6f272 days 12 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler2 Ether0.00020156
0x0abd1726031a7103b1eeaa70f7571b23c846dbd29a47d80bc5df1818e4bce02c279 days 19 hrs ago0x6595393e47abba4eb57b394c5856ac2b525cf923  IN   EthHodler0 Ether0.000093504
0x05ee0745314d201961ff302ebe884d0d269974d8e4079305dedee08a5992c867297 days 15 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler0 Ether0.00015584
0x02d399881e9ab0c16813c994997b928bd64740163ce10869699a9d564cd90efd298 days 15 hrs ago0xa63d78c962d73c8d10f4c9c0092501d5c3704e45  IN   EthHodler0.001 Ether0.00005039
0x4dae55b73ee8f1967859973abf1c6f006a3c1ba48a5579c0f9b2ada3d3da86db298 days 15 hrs ago0xa63d78c962d73c8d10f4c9c0092501d5c3704e45  IN   EthHodler0.00001 Ether0.00007118
0x48f47956e652100a882357a8d2ecb1e38c8f754c148a7aebfa9bcafde7bba980298 days 15 hrs ago0xa63d78c962d73c8d10f4c9c0092501d5c3704e45  IN   EthHodler0.001 Ether0.00005039
0xcef557bdb1bf5d6622a56ed95f68de415dd2695a97c445076a8fb0cb973ec03d309 days 21 hrs ago0x6595393e47abba4eb57b394c5856ac2b525cf923  IN   EthHodler0 Ether0.000129024
0xe9b85bbe5591caf5ba6cd9ec31f3fe29a86aa2ea305d547266e20b23b53f6f8c309 days 21 hrs ago0x6595393e47abba4eb57b394c5856ac2b525cf923  IN   EthHodler4 Ether0.00010078
0xb18aeb6caecd402d5ef8242c8dffbfc317536e2d25d2cdd73acc3734b2ee4728316 days 3 hrs ago0x1b68c2fb70d9cf27530f2da54a80753af73e0da5  IN   EthHodler0 Ether0.000258048
0xf198f9ae06ec26defdf8c260df1b0eec31e2bcccdffe795a5e32df19798d8561327 days 15 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler0 Ether0.002451456
0xbfc2982d615620927d17cb3ac0a8c92ebbbb4e2a6a11062bf6b0885922ddbc80327 days 15 hrs ago0xfcb503e67696365b5a4e9c59b8c0bac08f92b76b  IN   EthHodler13 Ether0.0010078
0xe1faff483c4a98eb4b3797b5e529f639d0a5707445e3eb958ed1e94d44a55b4f350 days 11 hrs ago0x2575b02bd9d14c75e4e3347c7ff6d50e9cd8ea30  IN   EthHodler0 Ether0.000654528
0x20323b361102979da4f37dfde4a9b2bcdb947b3933c8808f3bf0f0f0edd0165e359 days 18 hrs ago0x6595393e47abba4eb57b394c5856ac2b525cf923  IN   EthHodler0 Ether0.00011049
0x2885f28065555b7891ba4c45ae704593271751362af32556650bdbf8d245ec40359 days 19 hrs ago0x6595393e47abba4eb57b394c5856ac2b525cf923  IN   EthHodler0 Ether0.000685696
0xf36b0198b44185dcc57918e4ac79e19b0b1b707a550e55d4af76792524c0eedf365 days 4 hrs ago0x1b68c2fb70d9cf27530f2da54a80753af73e0da5  IN   EthHodler0.005 Ether0.00125975
0x749b8cca322b25b90025c0242b52676e975dc0be397b31eb5601874525b6902b366 days 10 hrs ago0x0ab991497116f7f5532a4c2f4f7b1784488628e1  IN   EthHodler0 Ether0.0015584
0xbf71554af1283ea5e4294a1c984eae95cf279f8b4dbdb63c3b86654edea0e5d1366 days 17 hrs ago0x0ab991497116f7f5532a4c2f4f7b1784488628e1  IN   EthHodler0 Ether0.00122725
0x41d3bc95e477a8fd17cbba634c46a1dce9c0286485c66d310390afed6ef0a3dd370 days 14 hrs ago0xc85df2ab0e639741b3691010091ed1b2d14b6c96  IN   EthHodler0 Ether0.001309056
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here To View More View All
ParentTxHash Block Age From To Value
0x5d126c806d74cabf0011baa33e673e40e51f86c958ee38f54d5468b120f6d7a05923654157 days 12 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xfcb503e67696365b5a4e9c59b8c0bac08f92b76b1.01 Ether
0x19cfd726b1ff411dc2b9c65d23448ebc6b15d99373c2ae627513f515a6ab293b5736123189 days 22 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xfcb503e67696365b5a4e9c59b8c0bac08f92b76b1.003849129508327608 Ether
0xedeb17bf9b3d3cf516d8a63a271d4539851e9f8cb24bcad014925a833c9fdb0e5255922272 days 12 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xfcb503e67696365b5a4e9c59b8c0bac08f92b76b2 Ether
0x0abd1726031a7103b1eeaa70f7571b23c846dbd29a47d80bc5df1818e4bce02c5213105279 days 19 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x6595393e47abba4eb57b394c5856ac2b525cf9234.000361963235384073 Ether
0x05ee0745314d201961ff302ebe884d0d269974d8e4079305dedee08a5992c8675108076297 days 15 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xfcb503e67696365b5a4e9c59b8c0bac08f92b76b13.001176380514998238 Ether
0x4dae55b73ee8f1967859973abf1c6f006a3c1ba48a5579c0f9b2ada3d3da86db5102059298 days 15 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xa63d78c962d73c8d10f4c9c0092501d5c3704e450.001 Ether
0xe1faff483c4a98eb4b3797b5e529f639d0a5707445e3eb958ed1e94d44a55b4f4802967350 days 11 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x2575b02bd9d14c75e4e3347c7ff6d50e9cd8ea301.000446271591246194 Ether
0x2885f28065555b7891ba4c45ae704593271751362af32556650bdbf8d245ec404748967359 days 19 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x6595393e47abba4eb57b394c5856ac2b525cf9232.541133529841765334 Ether
0x749b8cca322b25b90025c0242b52676e975dc0be397b31eb5601874525b6902b4710827366 days 10 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x0ab991497116f7f5532a4c2f4f7b1784488628e140.017862261213153775 Ether
0x41d3bc95e477a8fd17cbba634c46a1dce9c0286485c66d310390afed6ef0a3dd4686681370 days 14 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xc85df2ab0e639741b3691010091ed1b2d14b6c960.100044655653032884 Ether
0xdf6c71072caa4721f8a1bf9540ad3bfe017657381d9e9771451ad2cb689c49a04575917388 days 20 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x74485a3a2cbead9f56f1e9fc0b94ab718cfd524c0.670599326842279424 Ether
0xb72b00bb96f31d6ae4dbaee6869b20fad302c0af3f26dd721c5dc0e5f3fc92c64545522393 days 18 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x6595393e47abba4eb57b394c5856ac2b525cf9231.500706772102528736 Ether
0xd36200ea2507728b18c40a7e4e750c6d647aca254b37821689f6b6dbcbdccf144526753396 days 18 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xfcb503e67696365b5a4e9c59b8c0bac08f92b76b2.241 Ether
0x6aa78ceaae331766673fc01dd2e78325eabe6185fac5eb6587825d01431590d94342501431 days 16 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xe5f2605d85d93d8d1e4a33dea1b9d2968a8af2390.001 Ether
0xda230be3d0c17b6ad813d3e22757ebc592743b9a44144137997582a2221ff1fd4313677441 days 17 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x0d035a5405f0fbb66c3860b49d94f6122470937010.87 Ether
0x19971e9a6b0357f96cd3acc032f8d5594eda7398f9a9b5e86350e2447d8121d94262944456 days 17 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xd8594e6c494c7c301b759f4b952b968080e8f4184.155 Ether
0x6efb72a0ad03774c8d00ee5581fba3a668e0ec6fcd4330235058341409d2056f4241284462 days 19 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x1f4498e783950a10da55572bcb583659f7eef0571.18 Ether
0x3449663cbf2f1256e82807d754caa653fad03e1e3b7608d96b14ff53de5643f24220239468 days 18 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x4f803d1863defa11fc8faed474e97cba1c33b61b1.69 Ether
0xa79ecb1af426b98a75dc28f0882f0cdedcfeab91d9a7dfe287bed4bf2df1d5774199308474 days 16 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x0d035a5405f0fbb66c3860b49d94f612247093704.56 Ether
0xa39a61c9780409fb3bcb6938fe632550cb30426f56bb229b25e71e65a27ceb7e4190431476 days 18 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x74485a3a2cbead9f56f1e9fc0b94ab718cfd524c3.09 Ether
0x02044ef45e702db82e8becac7b7ed5e32964b073c9d5b80da2794af6f29a7bbc4132619490 days 18 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xd8594e6c494c7c301b759f4b952b968080e8f4185.74 Ether
0x76e6af0fd28b2c1652360ebd7ccd4228a30e1e6b9729d31ef2bd0f8fd288241b4127967491 days 21 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xb73a9d6eec627ef31d2221f7a1d662788b926cb20.1337 Ether
0x097da72903f7927ac5db7b613a087526c99773fb3399de8e32208daa056b9dbf4091533500 days 14 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x2ee3b293a1b187f1efbc8bfd45b13a9e0a05554e50 Ether
0x8e2bb48b026eb4debf56b714962931ad13521162ac6abafc4951b420820ab1c43930851534 days 6 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610x7906430a575c736a1737bcf1ef766d7ef5b9cf941.84752 Ether
0x9134c4c8e6e06575b04bcf8854aceabd3675ac5501bfd021c9d0313666c8431a3902896539 days 22 hrs ago0x47f383f5acbacc18a3d9ff6f7af8b49bfed27c610xf1c2e041ab05d5330c43d974a1278d17f15d46fb0.02 Ether
[ Download CSV Export  ] 
Contract Name: EthHodler
Compiler Text: v0.4.11+commit.68ef5810
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.11;
/**
* Eth Hodler (f.k.a. Hodl DAO) and ERC20 token
* Author: CurrencyTycoon on GitHub
* License: MIT
* Date: 2017
*
* Deploy with the following args:
* "Eth Hodler", 18, "EHDL"
*
*/
contract EthHodler {
    /* ERC20 Public variables of the token */
    string public constant version = 'HDAO 0.7';
    string public name;
    string public symbol;
    uint8 public decimals;
    uint256 public totalSupply;

    /* ERC20 This creates an array with all balances */
    mapping (address => uint256) public balanceOf;
    mapping (address => mapping (address => uint256)) public allowance;


    /* store the block number when a withdrawal has been requested*/
    mapping (address => withdrawalRequest) public withdrawalRequests;
    struct withdrawalRequest {
    uint sinceTime;
    uint256 amount;
    }

    /**
     * feePot collects fees from quick withdrawals. This gets re-distributed to slow-withdrawals
    */
    uint256 public feePot;

    uint public timeWait = 30 days;
    //uint public timeWait = 1 minutes; // uncomment for TestNet

    uint256 public constant initialSupply = 0;

    /**
     * ERC20 events these generate a public event on the blockchain that will notify clients
    */
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed _owner, address indexed _spender, uint256 _value);

    event WithdrawalQuick(address indexed by, uint256 amount, uint256 fee); // quick withdrawal done
    event IncorrectFee(address indexed by, uint256 feeRequired);  // incorrect fee paid for quick withdrawal
    event WithdrawalStarted(address indexed by, uint256 amount);
    event WithdrawalDone(address indexed by, uint256 amount, uint256 reward); // amount is the amount that was used to calculate reward
    event WithdrawalPremature(address indexed by, uint timeToWait); // Needs to wait timeToWait before withdrawal unlocked
    event Deposited(address indexed by, uint256 amount);

    /**
     * Initializes contract with initial supply tokens to the creator of the contract
     * In our case, there's no initial supply. Tokens will be created as ether is sent
     * to the fall-back function. Then tokens are burned when ether is withdrawn.
     */
    function EthHodler(
    string tokenName,
    uint8 decimalUnits,
    string tokenSymbol
    ) {

        balanceOf[msg.sender] = initialSupply;              // Give the creator all initial tokens (0 in this case)
        totalSupply = initialSupply;                        // Update total supply (0 in this case)
        name = tokenName;                                   // Set the name for display purposes
        symbol = tokenSymbol;                               // Set the symbol for display purposes
        decimals = decimalUnits;                            // Amount of decimals for display purposes
    }

    /**
     * notPendingWithdrawal modifier guards the function from executing when a
     * withdrawal has been requested and is currently pending
     */
    modifier notPendingWithdrawal {
        if (withdrawalRequests[msg.sender].sinceTime > 0) throw;
        _;
    }

    /** ERC20 - transfer sends tokens
     * @notice send `_value` token to `_to` from `msg.sender`
     * @param _to The address of the recipient
     * @param _value The amount of token to be transferred
     * @return Whether the transfer was successful or not
     */
    function transfer(address _to, uint256 _value) notPendingWithdrawal {
        if (balanceOf[msg.sender] < _value) throw;           // Check if the sender has enough
        if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
        if (withdrawalRequests[_to].sinceTime > 0) throw;    // can't move tokens when _to is pending withdrawal
        balanceOf[msg.sender] -= _value;                     // Subtract from the sender
        balanceOf[_to] += _value;                            // Add the same to the recipient
        Transfer(msg.sender, _to, _value);                   // Notify anyone listening that this transfer took place
    }

    /** ERC20 approve allows another contract to spend some tokens in your behalf
     * @notice `msg.sender` approves `_spender` to spend `_value` tokens
     * @param _spender The address of the account able to transfer the tokens
     * @param _value The amount of tokens to be approved for transfer
     * @return Whether the approval was successful or not
     *
     *
     * Note, there are some edge-cases with the ERC-20 approve mechanism. In this case a 'bounds check'
     * was added to make sure Alice cant' approve Bob for more tokens than she has.
     * The assumptions are that these scenarios could still happen if not mitigated by Alice:
     *
     * Scenario 1:
     *
     * The following scenario could be the expected outcome by Alice, but if not, Alice would need to set
     * her approval to Bob to 0 before Alice purchases more tokens.
     *
     *  1. Alice has 100 tokens.
     *  2. Alice approves 50 tokens for Bob.
     *  3. Alice approves 100 tokens for Charles
     *  4. Bob calls transferFrom and receives his 50 tokens.
     *  5. Charles calls transferFrom and receives the remaining 50 tokens
     *  6. Charles still has an approval for 50 more tokens from Alice, even though she now owns 0 tokens.
     *  7. Alice purchases 50 more tokens
     *  8. Charles sees this, and immediately calls transferFrom and receives those 50 tokens.
     *
     * Scenario 2:
     *
     * This is a race condition. To mitigate this problem, Alice should set the allowance to 0 in step 2,
     * then wait until it's mined, then if Bob didn't take the 100 she can set to 50. (Otherwise Bob may
     * potentially get 150 tokens)
     *
     *
     *  1. Alice approves Bob for 100,
     *  2. Alice changes it to 50
     *  3. Bob sees the change in the mempool before it's mined, and sends a new transaction
     *     that will hopefully win the race and withdraw the 100 first, meanwhile the 50 will
     *     be mined after and allow Bob to withdraw another 50.
     *
     *
     */
    function approve(address _spender, uint256 _value) notPendingWithdrawal
    returns (bool success) {

        // The following line has been commented out after peer review #2
        // It may be possible that Alice can pre-approve the recipient in advance, before she has a balance.
        // eg. Alice may approve a total lifetime amount for her child to spend, but only fund her account monthly.
        // It also allows her to have multiple equal approvees

        //if (balanceOf[msg.sender] < _value) return false; // Don't allow more than they currently have (bounds check)

        // To change the approve amount you first have to reduce the addresses´
        //  allowance to zero by calling `approve(_spender,0)` if it is not
        //  already 0 to mitigate the race condition described here:
        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
        if ((_value != 0) && (allowance[msg.sender][_spender] != 0)) throw;
        allowance[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _value);
        return true;                                      // we must return a bool as part of the ERC20
    }


    /**
     * ERC-20 Approves and then calls the receiving contract
    */
    function approveAndCall(address _spender, uint256 _value, bytes _extraData) notPendingWithdrawal
    returns (bool success) {

        if (!approve(_spender, _value)) return false;

        //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.
        //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData)
        //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead.
        if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) {
            throw;
        }
        return true;
    }

    /**
     * ERC20 A contract attempts to get the coins. Note: We are not allowing a transfer if
     * either the from or to address is pending withdrawal
     * @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
     * @param _from The address of the sender
     * @param _to The address of the recipient
     * @param _value The amount of token to be transferred
     * @return Whether the transfer was successful or not
     */
    function transferFrom(address _from, address _to, uint256 _value)
    returns (bool success) {
        // note that we can't use notPendingWithdrawal modifier here since this function does a transfer
        // on the behalf of _from
        if (withdrawalRequests[_from].sinceTime > 0) throw;   // can't move tokens when _from is pending withdrawal
        if (withdrawalRequests[_to].sinceTime > 0) throw;     // can't move tokens when _to is pending withdrawal
        if (balanceOf[_from] < _value) throw;                 // Check if the sender has enough
        if (balanceOf[_to] + _value < balanceOf[_to]) throw;  // Check for overflows
        if (_value > allowance[_from][msg.sender]) throw;     // Check allowance
        balanceOf[_from] -= _value;                           // Subtract from the sender
        balanceOf[_to] += _value;                             // Add the same to the recipient
        allowance[_from][msg.sender] -= _value;
        Transfer(_from, _to, _value);
        return true;
    }

    /**
     * withdrawalInitiate initiates the withdrawal by going into a waiting period
     * It remembers the block number & amount held at the time of request.
     * Tokens cannot be moved out during the waiting period, locking the tokens until then.
     * After the waiting period finishes, the call withdrawalComplete
     *
     * Gas: 64490
     *
     */
    function withdrawalInitiate() notPendingWithdrawal {
        WithdrawalStarted(msg.sender, balanceOf[msg.sender]);
        withdrawalRequests[msg.sender] = withdrawalRequest(now, balanceOf[msg.sender]);
    }

    /**
     * withdrawalComplete is called after the waiting period. The ether will be
     * returned to the caller and the tokens will be burned.
     * A reward will be issued based on the current amount in the feePot, relative to the
     * amount that was requested for withdrawal when withdrawalInitiate() was called.
     *
     * Gas: 30946
     */
    function withdrawalComplete() returns (bool) {
        withdrawalRequest r = withdrawalRequests[msg.sender];
        if (r.sinceTime == 0) throw;
        if ((r.sinceTime + timeWait) > now) {
            // holder needs to wait some more blocks
            WithdrawalPremature(msg.sender, r.sinceTime + timeWait - now);
            return false;
        }
        uint256 amount = withdrawalRequests[msg.sender].amount;
        uint256 reward = calculateReward(r.amount);
        withdrawalRequests[msg.sender].sinceTime = 0;   // This will unlock the holders tokens
        withdrawalRequests[msg.sender].amount = 0;      // clear the amount that was requested

        if (reward > 0) {
            if (feePot - reward > feePot) {             // underflow check
                feePot = 0;
            } else {
                feePot -= reward;
            }
        }
        doWithdrawal(reward);                           // burn the tokens and send back the ether
        WithdrawalDone(msg.sender, amount, reward);
        return true;

    }

    /**
     * Reward is based on the amount held, relative to total supply of tokens.
     */
    function calculateReward(uint256 v) constant returns (uint256) {
        uint256 reward = 0;
        if (feePot > 0) {
            reward = feePot * v / totalSupply; // assuming that if feePot > 0 then also totalSupply > 0
        }
        return reward;
    }

    /** calculate the fee for quick withdrawal
     */
    function calculateFee(uint256 v) constant returns  (uint256) {
        uint256 feeRequired = v / 100; // 1%
        return feeRequired;
    }

    /**
     * Quick withdrawal, needs to send ether to this function for the fee.
     *
     * Gas use: ? (including call to processWithdrawal)
    */
    function quickWithdraw() payable notPendingWithdrawal returns (bool) {
        uint256 amount = balanceOf[msg.sender];
        if (amount == 0) throw;
        // calculate required fee
        uint256 feeRequired = calculateFee(amount);
        if (msg.value != feeRequired) {
            IncorrectFee(msg.sender, feeRequired);   // notify the exact fee that needs to be sent
            throw;
        }
        feePot += msg.value;                         // add fee to the feePot
        doWithdrawal(0);                             // withdraw, 0 reward
        WithdrawalDone(msg.sender, amount, 0);
        return true;
    }

    /**
     * do withdrawal
     */
    function doWithdrawal(uint256 extra) internal {
        uint256 amount = balanceOf[msg.sender];
        if (amount == 0) throw;                      // cannot withdraw
        if (amount + extra > this.balance) {
            throw;                                   // contract doesn't have enough balance
        }

        balanceOf[msg.sender] = 0;
        if (totalSupply < totalSupply - amount) {
            throw;                                   // don't let it underflow (should not happen since amount <= totalSupply)
        } else {
            totalSupply -= amount;                   // deflate the supply!
        }
        Transfer(msg.sender, 0, amount);             // burn baby burn
        if (!msg.sender.send(amount + extra)) throw; // return back the ether or rollback if failed
    }


    /**
     * Fallback function when sending ether to the contract
     * Gas use: 65051
    */
    function () payable notPendingWithdrawal {
        uint256 amount = msg.value;         // amount that was sent
        if (amount == 0) throw;             // need to send some ETH
        balanceOf[msg.sender] += amount;    // mint new tokens
        totalSupply += amount;              // track the supply
        Transfer(0, msg.sender, amount);    // notify of the event
        Deposited(msg.sender, amount);
    }
}

    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":"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":"","type":"address"}],"name":"withdrawalRequests","outputs":[{"name":"sinceTime","type":"uint256"},{"name":"amount","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"initialSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"timeWait","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"feePot","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"quickWithdraw","outputs":[{"name":"","type":"bool"}],"payable":true,"type":"function"},{"constant":false,"inputs":[],"name":"withdrawalComplete","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"v","type":"uint256"}],"name":"calculateFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"v","type":"uint256"}],"name":"calculateReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"withdrawalInitiate","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[{"name":"tokenName","type":"string"},{"name":"decimalUnits","type":"uint8"},{"name":"tokenSymbol","type":"string"}],"payable":false,"type":"constructor"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"name":"by","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"fee","type":"uint256"}],"name":"WithdrawalQuick","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"by","type":"address"},{"indexed":false,"name":"feeRequired","type":"uint256"}],"name":"IncorrectFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"by","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WithdrawalStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"by","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"reward","type":"uint256"}],"name":"WithdrawalDone","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"by","type":"address"},{"indexed":false,"name":"timeToWait","type":"uint256"}],"name":"WithdrawalPremature","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"by","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Deposited","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405262278d0060085534156200001457fe5b6040516200129138038062001291833981016040908152815160208301519183015190830192015b600160a060020a03331660009081526004602090815260408220829055600382905584516200006f92918601906200009f565b508051620000859060019060208401906200009f565b506002805460ff191660ff84161790555b50505062000149565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000e257805160ff191683800117855562000112565b8280016001018555821562000112579182015b8281111562000112578251825591602001919060010190620000f5565b5b506200012192915062000125565b5090565b6200014691905b808211156200012157600081556001016200012c565b5090565b90565b61113880620001596000396000f300606060405236156100f65763ffffffff60e060020a60003504166306fdde0381146101bf578063095ea7b31461024f57806318160ddd1461028257806323b872dd146102a457806327b380f3146102dd578063313ce56714610312578063378dc3dc14610338578063441d6a611461035a5780634c9f66c71461037c57806354fd4d501461039e57806370a082311461042e57806372a2d90c1461045c5780638dd7e44b1461047857806395d89b411461049c57806399a5d7471461052c578063a9059cbb14610551578063cae9ca5114610572578063d2d7231f146105e9578063dcc6762c1461060e578063dd62ed3e14610620575b6101bd5b600160a060020a033316600090815260066020526040812054819011156101215760006000fd5b50348015156101305760006000fd5b600160a060020a03331660008181526004602090815260408083208054860190556003805486019055805185815290516000805160206110ed833981519152929181900390910190a3604080518281529051600160a060020a033316917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b5b50565b005b34156101c757fe5b6101cf610654565b604080516020808252835181830152835191928392908301918501908083838215610215575b80518252602083111561021557601f1990920191602091820191016101f5565b505050905090810190601f1680156102415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025757fe5b61026e600160a060020a03600435166024356106e2565b604080519115158252519081900360200190f35b341561028a57fe5b6102926107af565b60408051918252519081900360200190f35b34156102ac57fe5b61026e600160a060020a03600435811690602435166044356107b5565b604080519115158252519081900360200190f35b34156102e557fe5b6102f9600160a060020a03600435166108fe565b6040805192835260208301919091528051918290030190f35b341561031a57fe5b610322610917565b6040805160ff9092168252519081900360200190f35b341561034057fe5b610292610920565b60408051918252519081900360200190f35b341561036257fe5b610292610925565b60408051918252519081900360200190f35b341561038457fe5b61029261092b565b60408051918252519081900360200190f35b34156103a657fe5b6101cf610931565b604080516020808252835181830152835191928392908301918501908083838215610215575b80518252602083111561021557601f1990920191602091820191016101f5565b505050905090810190601f1680156102415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561043657fe5b610292600160a060020a0360043516610968565b60408051918252519081900360200190f35b61026e61097a565b604080519115158252519081900360200190f35b341561048057fe5b61026e610a84565b604080519115158252519081900360200190f35b34156104a457fe5b6101cf610be1565b604080516020808252835181830152835191928392908301918501908083838215610215575b80518252602083111561021557601f1990920191602091820191016101f5565b505050905090810190601f1680156102415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561053457fe5b610292600435610c6e565b60408051918252519081900360200190f35b341561055957fe5b6101bd600160a060020a0360043516602435610c82565b005b341561057a57fe5b604080516020600460443581810135601f810184900484028501840190955284845261026e948235600160a060020a0316946024803595606494929391909201918190840183828082843750949650610d7695505050505050565b604080519115158252519081900360200190f35b34156105f157fe5b610292600435610f07565b60408051918252519081900360200190f35b341561061657fe5b6101bd610f39565b005b341561062857fe5b610292600160a060020a0360043581169060243516610ff3565b60408051918252519081900360200190f35b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106da5780601f106106af576101008083540402835291602001916106da565b820191906000526020600020905b8154815290600101906020018083116106bd57829003601f168201915b505050505081565b600160a060020a033316600090815260066020526040812054819011156107095760006000fd5b811580159061073c5750600160a060020a0333811660009081526005602090815260408083209387168352929052205415155b156107475760006000fd5b600160a060020a03338116600081815260056020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060015b5b92915050565b60035481565b600160a060020a038316600090815260066020526040812054819011156107dc5760006000fd5b600160a060020a03831660009081526006602052604081205411156108015760006000fd5b600160a060020a038416600090815260046020526040902054829010156108285760006000fd5b600160a060020a03831660009081526004602052604090205482810110156108505760006000fd5b600160a060020a03808516600090815260056020908152604080832033909416835292905220548211156108845760006000fd5b600160a060020a03808516600081815260046020908152604080832080548890039055878516808452818420805489019055848452600583528184203390961684529482529182902080548790039055815186815291516000805160206110ed8339815191529281900390910190a35060015b9392505050565b6006602052600090815260409020805460019091015482565b60025460ff1681565b600081565b60085481565b60075481565b60408051808201909152600881527f4844414f20302e37000000000000000000000000000000000000000000000000602082015281565b60046020526000908152604090205481565b600160a060020a03331660009081526006602052604081205481908190819011156109a55760006000fd5b600160a060020a03331660009081526004602052604090205491508115156109cd5760006000fd5b6109d682610c6e565b9050348114610a2457604080518281529051600160a060020a033316917f4b02e32836ab61e09520c2fa7a744654ae1105fbc64fd963db54ccaeedcb26a4919081900360200190a260006000fd5b6007805434019055610a366000611010565b60408051838152600060208201528151600160a060020a033316927f05de6288c7d47933a7195ba55a4ebbbdeb6c7ddbc12c83e70d2842254db165c2928290030190a2600192505b5b505090565b600160a060020a03331660009081526006602052604081208054829081901515610aae5760006000fd5b60085483544291011115610b105733600160a060020a03167f17a2aaa48e27a928dad797a90a80e37151e1d04dcffaa02d3d8ce8eba4342fa542600854866000015401036040518082815260200191505060405180910390a260009350610bdb565b600160a060020a033316600090815260066020526040902060019081015490840154909250610b3e90610f07565b600160a060020a0333166000908152600660205260408120818155600101819055909150811115610b89576007548181031115610b7f576000600755610b89565b6007805482900390555b5b610b9381611010565b60408051838152602081018390528151600160a060020a033316927f05de6288c7d47933a7195ba55a4ebbbdeb6c7ddbc12c83e70d2842254db165c2928290030190a2600193505b50505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106da5780601f106106af576101008083540402835291602001916106da565b820191906000526020600020905b8154815290600101906020018083116106bd57829003601f168201915b505050505081565b6000806064835b0490508091505b50919050565b600160a060020a0333166000908152600660205260408120541115610ca75760006000fd5b600160a060020a03331660009081526004602052604090205481901015610cce5760006000fd5b600160a060020a0382166000908152600460205260409020548181011015610cf65760006000fd5b600160a060020a0382166000908152600660205260408120541115610d1b5760006000fd5b600160a060020a03338116600081815260046020908152604080832080548790039055938616808352918490208054860190558351858152935191936000805160206110ed833981519152929081900390910190a35b5b5050565b600160a060020a03331660009081526006602052604081205481901115610d9d5760006000fd5b610da784846106e2565b1515610db5575060006108f7565b83600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e019050604051809103902060e060020a9004338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001828051906020019080838360008314610ea6575b805182526020831115610ea657601f199092019160209182019101610e86565b505050905090810190601f168015610ed25780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f1925050501515610efb5760006000fd5b5060015b5b9392505050565b600060006000905060006007541115610f2f576003548360075402811515610c7557fe5b0490505b8091505b50919050565b600160a060020a0333166000908152600660205260408120541115610f5e5760006000fd5b600160a060020a03331660008181526004602090815260409182902054825190815291517f731bed8bd2f1bca152ccc18462478d1d39325ffb89617c598d1b54fa34570fb09281900390910190a2604080518082018252428152600160a060020a0333166000818152600460209081528482205481850190815292825260069052929092209051815590516001909101555b5b565b600560209081526000928352604080842090915290825290205481565b600160a060020a0333166000908152600460205260409020548015156110365760006000fd5b30600160a060020a03163182820111156110505760006000fd5b600160a060020a03331660009081526004602052604081205560035481810390101561107c5760006000fd5b6003805482900390555b604080518281529051600091600160a060020a033316916000805160206110ed8339815191529181900360200190a3604051600160a060020a0333169082840180156108fc02916000818181858888f193505050501515610d715760006000fd5b5b50505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582068060ee2b57b9d45c08a453c3a644fd9a413cf4fbdb2d8d2df25f3fe980c4ec600290000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000a45746820486f646c65720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044548444c00000000000000000000000000000000000000000000000000000000

    Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000a45746820486f646c65720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044548444c00000000000000000000000000000000000000000000000000000000

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [3] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [4] : 45746820486f646c657200000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [6] : 4548444c00000000000000000000000000000000000000000000000000000000


   Swarm Source:
bzzr://68060ee2b57b9d45c08a453c3a644fd9a413cf4fbdb2d8d2df25f3fe980c4ec6

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.