Sponsored:   Ubex.com: Top ratings from all agencies. Big partnerships. 70% hard cap reached. Join us!
 Latest 25 txns from a total Of 3566 transactions

TxHash Age From To Value [TxFee]
0x9a385f96b2a855a9ed66347bca498f818fd22496c32af7260cdcef61303638118 hrs 4 mins ago0x5ff875e5747f2160d6337a8f58c253e7272f7b13  IN   MoxyOneCrowdsale0 Ether0.000686856
0x1fef78833df51a373ac9091f79d0a92952995046232b1e08e361caa1e200ea1c2 days 41 mins ago0xe7e1f5ff41335e83d7599cf3f7767bbd04441405  IN   MoxyOneCrowdsale0 Ether0.000867806
0x135c6cbb30eb4aff7e7d9105f7257e601b3cdb6436fad7bbe994b24a361449dc3 days 16 hrs ago0x1d05c039aee087ff1d2460a03b2b08c128b744a6  IN   MoxyOneCrowdsale0 Ether0.000444486
0x77c068fa9cb6c7f6680404bee45d039dcf8f7edbecebfefa6423b6b14ed89a724 days 19 hrs ago0x47425060502b256cede3b5b34cf791b13196f618  IN   MoxyOneCrowdsale0 Ether0.000126996
0xaaf47e0a93fa89b90d50bab7cc1d804407af4b384626493b549dabc71716f1ed5 days 9 hrs ago0x3d5a30440d244aeb537b8b6d5c9e72dd691d1bbc  IN   MoxyOneCrowdsale0 Ether0.000867806
0x8553e0cdb4f39b1824e03c41a7e193518ec23fc2d83bd032f7a946fc6a6e7a227 days 7 hrs ago0xeffe712bf9ecd84b150f4f1afc5af8d4ff5fc5e7  IN   MoxyOneCrowdsale0 Ether0.000867806
0x189f149a8f69dd47f6c455913720098d3b6d85a6752c2117756b2b73f050038b10 days 20 hrs ago0x81e4cecd6fd815ef95dc11e5a821db50b5709efd  IN   MoxyOneCrowdsale0 Ether0.00042332
0x78c532aa64f54bd4cbbfece52323ccb7df0031807fbe4e21e0b4063615a1abce11 days 12 hrs ago0xd58c2f971311b1dac498598714bf4fb2a22d7171  IN   MoxyOneCrowdsale0 Ether0.000867806
0x0c4d28c193d465967c8ed93d3d5f7e272115639159face46969c4396cad8288c12 days 11 hrs ago0xc833d1dc070d87542419a9420f268908c83a3fd1  IN   MoxyOneCrowdsale0 Ether0.000169328
0xc37365701907c61d2a8464972c922e4eae42b5c3a6239126b1c50cb09423cad312 days 23 hrs ago0x8acf0e0f617b9c476c5f87fa89ce50373c97c2d9  IN   MoxyOneCrowdsale0 Ether0.001173379
0x2cfd49132204445a7e1ccb9184fbd0ad2eb7db64d91afd0a0b90ec537f219bbe13 days 2 hrs ago0xdd61df6b640814a285cbe3e317f7524d232d67d2  IN   MoxyOneCrowdsale0 Ether0.000867806
0xa8f81fcdc2952ea56740d1de2050139528bd0068d376b09a36848413a8f0f3d513 days 22 hrs ago0x18776cf87d053a7b507cc3daafc17c4e5bf3fea5  IN   MoxyOneCrowdsale0 Ether0.000867806
0x2972cfb1d25b1c8532df5509adfe69273ef485186b5e55121788b7c5f105b53314 days 9 hrs ago0x9a7814cac7141e54570f44f3cfa69c817be520a4  IN   MoxyOneCrowdsale0 Ether0.000867806
0x24abf41c944e9750d5db9702a7db5786e19d5f83f2de5a182b77ef8505803d7114 days 13 hrs ago0x304264e5dc2e2b1a1aedaa0d0701baeb24253a1b  IN   MoxyOneCrowdsale0 Ether0.000867806
0xebecee876cd6a4421e3388f1eae31374594e82be6ddc358356181424aba1dbb217 days 3 hrs ago0x1627239d35635dc310ec7c2d02941a56dde3dc23  IN   MoxyOneCrowdsale0 Ether0.000867806
0x83620bab28581c334f3051cbcc78a8876cbbfab3aff58e658d34d2a651ecaf6517 days 8 hrs ago0x1627239d35635dc310ec7c2d02941a56dde3dc23  IN   MoxyOneCrowdsale0 Ether0.000900606
0xe9ba4de5c1c8cf54844dd845c7aabc96666317f70a3ecbed83d41275528106aa18 days 2 hrs ago0xcf5a0f4a49cc438bb347ab460bbbb7f93f02cd3c  IN   MoxyOneCrowdsale0 Ether0.000867806
0xe188fe63b98101d026131b7f15b6036a9cc81867cb7e5ed0bf9ac792b8bc56ce20 days 6 hrs ago0xc599255546d208bd6d3b729ecc6b9369f52e49b8  IN   MoxyOneCrowdsale0 Ether0.000867806
0xd09c80607c5b8b15f707fef0c9286f693be7dfb7ef024a369653f63b87fb3b8620 days 7 hrs ago0xd53df5a5eb296162d6ae4172622ca0d25ef1db1a  IN   MoxyOneCrowdsale0 Ether0.000867806
0xabb7c83a113ff8c6d382d518f7f6b4911809db69bf8e5af41540a8e3c428aa0021 days 10 hrs ago0x67037a400660212ef4c63b267ba9a15fa51d0a40  IN   MoxyOneCrowdsale0 Ether0.001217208
0x31b18ce72b869ff7300fe7caf82a7a713095e8bc4f31bfb268e7a0804215e95521 days 20 hrs ago0x2bae4f76b48a5a7304bd2299822cb20156730416  IN   MoxyOneCrowdsale0 Ether0.000867806
0x83c52c1f09f48755795061e3291291266b5efcce63a1dc9e40efb8d37567815a22 days 3 hrs ago0xed2715d4cb6a67d506b1a9f8c392afeb45015693  IN   MoxyOneCrowdsale0 Ether0.001173379
0x5984f2005994c991b6ba5122ba449fbf77b7405f5af8c0218dd251d265cbed1f22 days 7 hrs ago0x55bfd3e1e1b7ec1ac8a43f5d10ce8ef24c8dbe06  IN   MoxyOneCrowdsale0 Ether0.000867806
0x9072024668c522e6995de9ee05b8dbc3f9e0d6a0f17e8aee685201f9fec77a4f23 days 10 hrs ago0xed2715d4cb6a67d506b1a9f8c392afeb45015693  IN   MoxyOneCrowdsale0 Ether0.001173379
0x08119841fd72928d6dc6fb795e9e2f842584ed343783887c6a93101a36d4165224 days 16 hrs ago0x3741c741448ab0a2f86b5831f61639eaef6af15a  IN   MoxyOneCrowdsale0 Ether0.001173379
[ 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
0x1fef78833df51a373ac9091f79d0a92952995046232b1e08e361caa1e200ea1c60006382 days 41 mins ago0x6b609d9095d069c805650234ab67595b3a6ab9340xe7e1f5ff41335e83d7599cf3f7767bbd044414050.102854646 Ether
0x135c6cbb30eb4aff7e7d9105f7257e601b3cdb6436fad7bbe994b24a361449dc59908743 days 16 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x1d05c039aee087ff1d2460a03b2b08c128b744a61 Ether
0x77c068fa9cb6c7f6680404bee45d039dcf8f7edbecebfefa6423b6b14ed89a7259843674 days 19 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x47425060502b256cede3b5b34cf791b13196f6182 Ether
0xaaf47e0a93fa89b90d50bab7cc1d804407af4b384626493b549dabc71716f1ed59811455 days 9 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x3d5a30440d244aeb537b8b6d5c9e72dd691d1bbc1.35 Ether
0x8553e0cdb4f39b1824e03c41a7e193518ec23fc2d83bd032f7a946fc6a6e7a2259698167 days 7 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xeffe712bf9ecd84b150f4f1afc5af8d4ff5fc5e70.011 Ether
0x189f149a8f69dd47f6c455913720098d3b6d85a6752c2117756b2b73f050038b594861010 days 20 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x81e4cecd6fd815ef95dc11e5a821db50b5709efd0.21 Ether
0x78c532aa64f54bd4cbbfece52323ccb7df0031807fbe4e21e0b4063615a1abce594445511 days 12 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xd58c2f971311b1dac498598714bf4fb2a22d71710.104725 Ether
0x0c4d28c193d465967c8ed93d3d5f7e272115639159face46969c4396cad8288c593893912 days 11 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xc833d1dc070d87542419a9420f268908c83a3fd10.03 Ether
0x2cfd49132204445a7e1ccb9184fbd0ad2eb7db64d91afd0a0b90ec537f219bbe593540813 days 2 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xdd61df6b640814a285cbe3e317f7524d232d67d20.76863041 Ether
0xa8f81fcdc2952ea56740d1de2050139528bd0068d376b09a36848413a8f0f3d5593054813 days 22 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x18776cf87d053a7b507cc3daafc17c4e5bf3fea50.03 Ether
0x2972cfb1d25b1c8532df5509adfe69273ef485186b5e55121788b7c5f105b533592788414 days 9 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x9a7814cac7141e54570f44f3cfa69c817be520a40.3 Ether
0x24abf41c944e9750d5db9702a7db5786e19d5f83f2de5a182b77ef8505803d71592681814 days 13 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x304264e5dc2e2b1a1aedaa0d0701baeb24253a1b0.095 Ether
0xebecee876cd6a4421e3388f1eae31374594e82be6ddc358356181424aba1dbb2591184317 days 3 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x1627239d35635dc310ec7c2d02941a56dde3dc230.15 Ether
0xe9ba4de5c1c8cf54844dd845c7aabc96666317f70a3ecbed83d41275528106aa590626318 days 2 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xcf5a0f4a49cc438bb347ab460bbbb7f93f02cd3c0.08589615 Ether
0xe188fe63b98101d026131b7f15b6036a9cc81867cb7e5ed0bf9ac792b8bc56ce589368020 days 6 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xc599255546d208bd6d3b729ecc6b9369f52e49b80.102 Ether
0xd09c80607c5b8b15f707fef0c9286f693be7dfb7ef024a369653f63b87fb3b86589342020 days 7 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xd53df5a5eb296162d6ae4172622ca0d25ef1db1a0.5 Ether
0x31b18ce72b869ff7300fe7caf82a7a713095e8bc4f31bfb268e7a0804215e955588436321 days 20 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x2bae4f76b48a5a7304bd2299822cb201567304160.02762294 Ether
0x5984f2005994c991b6ba5122ba449fbf77b7405f5af8c0218dd251d265cbed1f588175522 days 7 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x55bfd3e1e1b7ec1ac8a43f5d10ce8ef24c8dbe060.4 Ether
0x2b6e89f8e485fb6e6641b6eef2df41e181084091b40070309fb04ef8835f1c1c585859626 days 6 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x590cc87598ce7ce88bf7ce4508595c3cfcc09a5a1 Ether
0x77fc8d205ff2edb8ea2737a9ee19825bf4d80ee6a3cf5b3de7b451a0b7650a07585205327 days 10 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xcd8b33e748f8e563eddae81d22a3c1fc79d8bae90.1 Ether
0xda541efda655ed4bfea7f26dc0473489e0bb8f378f5b9c01985d5a558e3a0e99585172427 days 11 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x996b73e8f43f96f7e9e7270c91d4a4e69160fa019.5 Ether
0xc7ea0dcbfc9ceaf1e990f89e09f1e89d9c7e75cb1d697b2dba8ff2c4140f16bc585087227 days 15 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xc6f75f4b0ce6ecbea58d790b002e899f2f0720b71.75 Ether
0x39024aa010803116e95186553d7c0e58eb0ca215a28ba87d7948e418303bcd1f584605528 days 11 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xaecbc3ab6b658e62d3c9e2bb8c28bba2acef94bc1 Ether
0xbbb0361e395b1b5ddcbd6b0d84c0e935f56a7423e97cee739f77b1b1e21f4129584569628 days 12 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340x735e8cd9195aaa090dccd0e3e2a3b03f4add79ef32 Ether
0x9465b282eddab39e96da245b47798c33a7cbdf91a836f07bc9910b360538ce98583841829 days 18 hrs ago0x6b609d9095d069c805650234ab67595b3a6ab9340xba981fcbd94611c5acc61ed3a119b8efb877e7901.570874945 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact match)
Contract Name: MoxyOneCrowdsale
Compiler Version: v0.4.18+commit.9cf6e910
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.18;

/**
 * IPausable
 *
 * Simple interface to pause and resume 
 *
 * #created 11/10/2017
 * #author Frank Bonnet
 */
interface IPausable {


    /**
     * Returns whether the implementing contract is 
     * currently paused or not
     *
     * @return Whether the paused state is active
     */
    function isPaused() public view returns (bool);


    /**
     * Change the state to paused
     */
    function pause() public;


    /**
     * Change the state to resume, undo the effects 
     * of calling pause
     */
    function resume() public;
}


/**
 * IOwnership
 *
 * Perminent ownership
 *
 * #created 01/10/2017
 * #author Frank Bonnet
 */
interface IOwnership {

    /**
     * Returns true if `_account` is the current owner
     *
     * @param _account The address to test against
     */
    function isOwner(address _account) public view returns (bool);


    /**
     * Gets the current owner
     *
     * @return address The current owner
     */
    function getOwner() public view returns (address);
}


/**
 * Ownership
 *
 * Perminent ownership
 *
 * #created 01/10/2017
 * #author Frank Bonnet
 */
contract Ownership is IOwnership {

    // Owner
    address internal owner;


    /**
     * Access is restricted to the current owner
     */
    modifier only_owner() {
        require(msg.sender == owner);
        _;
    }


    /**
     * The publisher is the inital owner
     */
    function Ownership() public {
        owner = msg.sender;
    }


    /**
     * Returns true if `_account` is the current owner
     *
     * @param _account The address to test against
     */
    function isOwner(address _account) public view returns (bool) {
        return _account == owner;
    }


    /**
     * Gets the current owner
     *
     * @return address The current owner
     */
    function getOwner() public view returns (address) {
        return owner;
    }
}


/**
 * ERC20 compatible token interface
 *
 * - Implements ERC 20 Token standard
 * - Implements short address attack fix
 *
 * #created 29/09/2017
 * #author Frank Bonnet
 */
interface IToken { 

    /** 
     * Get the total supply of tokens
     * 
     * @return The total supply
     */
    function totalSupply() public view returns (uint);


    /** 
     * Get balance of `_owner` 
     * 
     * @param _owner The address from which the balance will be retrieved
     * @return The balance
     */
    function balanceOf(address _owner) public view returns (uint);


    /** 
     * 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, uint _value) public returns (bool);


    /** 
     * 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, uint _value) public returns (bool);


    /** 
     * `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
     */
    function approve(address _spender, uint _value) public returns (bool);


    /** 
     * Get the amount of remaining tokens that `_spender` is allowed to spend from `_owner`
     * 
     * @param _owner The address of the account owning tokens
     * @param _spender The address of the account able to transfer the tokens
     * @return Amount of remaining tokens allowed to spent
     */
    function allowance(address _owner, address _spender) public view returns (uint);
}


/**
 * IManagedToken
 *
 * Adds the following functionality to the basic ERC20 token
 * - Locking
 * - Issuing
 * - Burning 
 *
 * #created 29/09/2017
 * #author Frank Bonnet
 */
interface IManagedToken { 

    /** 
     * Returns true if the token is locked
     * 
     * @return Whether the token is locked
     */
    function isLocked() public view returns (bool);


    /**
     * Locks the token so that the transfering of value is disabled 
     *
     * @return Whether the unlocking was successful or not
     */
    function lock() public returns (bool);


    /**
     * Unlocks the token so that the transfering of value is enabled 
     *
     * @return Whether the unlocking was successful or not
     */
    function unlock() public returns (bool);


    /**
     * Issues `_value` new tokens to `_to`
     *
     * @param _to The address to which the tokens will be issued
     * @param _value The amount of new tokens to issue
     * @return Whether the tokens where sucessfully issued or not
     */
    function issue(address _to, uint _value) public returns (bool);


    /**
     * Burns `_value` tokens of `_from`
     *
     * @param _from The address that owns the tokens to be burned
     * @param _value The amount of tokens to be burned
     * @return Whether the tokens where sucessfully burned or not 
     */
    function burn(address _from, uint _value) public returns (bool);
}


/**
 * ITokenRetriever
 *
 * Allows tokens to be retrieved from a contract
 *
 * #created 29/09/2017
 * #author Frank Bonnet
 */
interface ITokenRetriever {

    /**
     * Extracts tokens from the contract
     *
     * @param _tokenContract The address of ERC20 compatible token
     */
    function retrieveTokens(address _tokenContract) public;
}


/**
 * TokenRetriever
 *
 * Allows tokens to be retrieved from a contract
 *
 * #created 18/10/2017
 * #author Frank Bonnet
 */
contract TokenRetriever is ITokenRetriever {

    /**
     * Extracts tokens from the contract
     *
     * @param _tokenContract The address of ERC20 compatible token
     */
    function retrieveTokens(address _tokenContract) public {
        IToken tokenInstance = IToken(_tokenContract);
        uint tokenBalance = tokenInstance.balanceOf(this);
        if (tokenBalance > 0) {
            tokenInstance.transfer(msg.sender, tokenBalance);
        }
    }
}


/**
 * IAuthenticator 
 *
 * Authenticator interface
 *
 * #created 15/10/2017
 * #author Frank Bonnet
 */
interface IAuthenticator {
    

    /**
     * Authenticate 
     *
     * Returns whether `_account` is authenticated or not
     *
     * @param _account The account to authenticate
     * @return whether `_account` is successfully authenticated
     */
    function authenticate(address _account) public view returns (bool);
}


/**
 * IAuthenticationManager 
 *
 * Allows the authentication process to be enabled and disabled
 *
 * #created 15/10/2017
 * #author Frank Bonnet
 */
interface IAuthenticationManager {
    

    /**
     * Returns true if authentication is enabled and false 
     * otherwise
     *
     * @return Whether the converter is currently authenticating or not
     */
    function isAuthenticating() public view returns (bool);


    /**
     * Enable authentication
     */
    function enableAuthentication() public;


    /**
     * Disable authentication
     */
    function disableAuthentication() public;
}


/**
 * IWingsAdapter
 * 
 * WINGS DAO Price Discovery & Promotion Pre-Beta https://www.wings.ai
 *
 * #created 04/10/2017
 * #author Frank Bonnet
 */
interface IWingsAdapter {

    /**
     * Get the total raised amount of Ether
     *
     * Can only increase, meaning if you withdraw ETH from the wallet, it should be not modified (you can use two fields 
     * to keep one with a total accumulated amount) amount of ETH in contract and totalCollected for total amount of ETH collected
     *
     * @return Total raised Ether amount
     */
    function totalCollected() public view returns (uint);
}


/**
 * IPersonalCrowdsaleProxy
 *
 * #created 22/11/2017
 * #author Frank Bonnet
 */
interface IPersonalCrowdsaleProxy {

    /**
     * Receive ether and issue tokens
     * 
     * This function requires that msg.sender is not a contract. This is required because it's 
     * not possible for a contract to specify a gas amount when calling the (internal) send() 
     * function. Solidity imposes a maximum amount of gas (2300 gas at the time of writing)
     * 
     * Contracts can call the contribute() function instead
     */
    function () public payable;
}


/**
 * PersonalCrowdsaleProxy
 *
 * #created 22/11/2017
 * #author Frank Bonnet
 */
contract PersonalCrowdsaleProxy is IPersonalCrowdsaleProxy {

    address public owner;
    ICrowdsale public target;
    

    /**
     * Deploy proxy
     *
     * @param _owner Owner of the proxy
     * @param _target Target crowdsale
     */
    function PersonalCrowdsaleProxy(address _owner, address _target) public {
        target = ICrowdsale(_target);
        owner = _owner;
    }


    /**
     * Receive contribution and forward to the target crowdsale
     * 
     * This function requires that msg.sender is not a contract. This is required because it's 
     * not possible for a contract to specify a gas amount when calling the (internal) send() 
     * function. Solidity imposes a maximum amount of gas (2300 gas at the time of writing)
     */
    function () public payable {
        target.contributeFor.value(msg.value)(owner);
    }
}


/**
 * ICrowdsaleProxy
 *
 * #created 23/11/2017
 * #author Frank Bonnet
 */
interface ICrowdsaleProxy {

    /**
     * Receive ether and issue tokens to the sender
     * 
     * This function requires that msg.sender is not a contract. This is required because it's 
     * not possible for a contract to specify a gas amount when calling the (internal) send() 
     * function. Solidity imposes a maximum amount of gas (2300 gas at the time of writing)
     * 
     * Contracts can call the contribute() function instead
     */
    function () public payable;


    /**
     * Receive ether and issue tokens to the sender
     *
     * @return The accepted ether amount
     */
    function contribute() public payable returns (uint);


    /**
     * Receive ether and issue tokens to `_beneficiary`
     *
     * @param _beneficiary The account that receives the tokens
     * @return The accepted ether amount
     */
    function contributeFor(address _beneficiary) public payable returns (uint);
}


/**
 * CrowdsaleProxy
 *
 * #created 22/11/2017
 * #author Frank Bonnet
 */
contract CrowdsaleProxy is ICrowdsaleProxy {

    address public owner;
    ICrowdsale public target;
    

    /**
     * Deploy proxy
     *
     * @param _owner Owner of the proxy
     * @param _target Target crowdsale
     */
    function CrowdsaleProxy(address _owner, address _target) public {
        target = ICrowdsale(_target);
        owner = _owner;
    }


    /**
     * Receive contribution and forward to the crowdsale
     * 
     * This function requires that msg.sender is not a contract. This is required because it's 
     * not possible for a contract to specify a gas amount when calling the (internal) send() 
     * function. Solidity imposes a maximum amount of gas (2300 gas at the time of writing)
     */
    function () public payable {
        target.contributeFor.value(msg.value)(msg.sender);
    }


    /**
     * Receive ether and issue tokens to the sender
     *
     * @return The accepted ether amount
     */
    function contribute() public payable returns (uint) {
        target.contributeFor.value(msg.value)(msg.sender);
    }


    /**
     * Receive ether and issue tokens to `_beneficiary`
     *
     * @param _beneficiary The account that receives the tokens
     * @return The accepted ether amount
     */
    function contributeFor(address _beneficiary) public payable returns (uint) {
        target.contributeFor.value(msg.value)(_beneficiary);
    }
}


/**
 * ICrowdsale
 *
 * Base crowdsale interface to manage the sale of 
 * an ERC20 token
 *
 * #created 09/09/2017
 * #author Frank Bonnet
 */
interface ICrowdsale {

    /**
     * Returns true if the contract is currently in the presale phase
     *
     * @return True if in presale phase
     */
    function isInPresalePhase() public view returns (bool);


    /**
     * Returns true if the contract is currently in the ended stage
     *
     * @return True if ended
     */
    function isEnded() public view returns (bool);


    /**
     * Returns true if `_beneficiary` has a balance allocated
     *
     * @param _beneficiary The account that the balance is allocated for
     * @param _releaseDate The date after which the balance can be withdrawn
     * @return True if there is a balance that belongs to `_beneficiary`
     */
    function hasBalance(address _beneficiary, uint _releaseDate) public view returns (bool);


    /** 
     * Get the allocated token balance of `_owner`
     * 
     * @param _owner The address from which the allocated token balance will be retrieved
     * @return The allocated token balance
     */
    function balanceOf(address _owner) public view returns (uint);


    /** 
     * Get the allocated eth balance of `_owner`
     * 
     * @param _owner The address from which the allocated eth balance will be retrieved
     * @return The allocated eth balance
     */
    function ethBalanceOf(address _owner) public view returns (uint);


    /** 
     * Get invested and refundable balance of `_owner` (only contributions during the ICO phase are registered)
     * 
     * @param _owner The address from which the refundable balance will be retrieved
     * @return The invested refundable balance
     */
    function refundableEthBalanceOf(address _owner) public view returns (uint);


    /**
     * Returns the rate and bonus release date
     *
     * @param _phase The phase to use while determining the rate
     * @param _volume The amount wei used to determine what volume multiplier to use
     * @return The rate used in `_phase` multiplied by the corresponding volume multiplier
     */
    function getRate(uint _phase, uint _volume) public view returns (uint);


    /**
     * Convert `_wei` to an amount in tokens using 
     * the `_rate`
     *
     * @param _wei amount of wei to convert
     * @param _rate rate to use for the conversion
     * @return Amount in tokens
     */
    function toTokens(uint _wei, uint _rate) public view returns (uint);


    /**
     * Receive ether and issue tokens to the sender
     * 
     * This function requires that msg.sender is not a contract. This is required because it's 
     * not possible for a contract to specify a gas amount when calling the (internal) send() 
     * function. Solidity imposes a maximum amount of gas (2300 gas at the time of writing)
     * 
     * Contracts can call the contribute() function instead
     */
    function () public payable;


    /**
     * Receive ether and issue tokens to the sender
     *
     * @return The accepted ether amount
     */
    function contribute() public payable returns (uint);


    /**
     * Receive ether and issue tokens to `_beneficiary`
     *
     * @param _beneficiary The account that receives the tokens
     * @return The accepted ether amount
     */
    function contributeFor(address _beneficiary) public payable returns (uint);


    /**
     * Withdraw allocated tokens
     */
    function withdrawTokens() public;


    /**
     * Withdraw allocated ether
     */
    function withdrawEther() public;


    /**
     * Refund in the case of an unsuccessful crowdsale. The 
     * crowdsale is considered unsuccessful if minAmount was 
     * not raised before end of the crowdsale
     */
    function refund() public;
}


/**
 * Crowdsale
 *
 * Abstract base crowdsale contract that manages the sale of 
 * an ERC20 token
 *
 * #created 29/09/2017
 * #author Frank Bonnet
 */
contract Crowdsale is ICrowdsale, Ownership {

    enum Stages {
        Deploying,
        Deployed,
        InProgress,
        Ended
    }

    struct Balance {
        uint eth;
        uint tokens;
        uint index;
    }

    struct Percentage {
        uint eth;
        uint tokens;
        bool overwriteReleaseDate;
        uint fixedReleaseDate;
        uint index; 
    }

    struct Payout {
        uint percentage;
        uint vestingPeriod;
    }

    struct Phase {
        uint rate;
        uint end;
        uint bonusReleaseDate;
        bool useVolumeMultiplier;
    }

    struct VolumeMultiplier {
        uint rateMultiplier;
        uint bonusReleaseDateMultiplier;
    }

    // Crowdsale details
    uint public baseRate;
    uint public minAmount; 
    uint public maxAmount; 
    uint public minAcceptedAmount;
    uint public minAmountPresale; 
    uint public maxAmountPresale;
    uint public minAcceptedAmountPresale;

    // Company address
    address public beneficiary; 

    // Denominators
    uint internal percentageDenominator;
    uint internal tokenDenominator;

    // Crowdsale state
    uint public start;
    uint public presaleEnd;
    uint public crowdsaleEnd;
    uint public raised;
    uint public allocatedEth;
    uint public allocatedTokens;
    Stages public stage;

    // Token contract
    IManagedToken public token;

    // Invested balances
    mapping (address => uint) private balances;

    // Alocated balances
    mapping (address => mapping(uint => Balance)) private allocated;
    mapping(address => uint[]) private allocatedIndex;

    // Stakeholders
    mapping (address => Percentage) private stakeholderPercentages;
    address[] private stakeholderPercentagesIndex;
    Payout[] private stakeholdersPayouts;

    // Crowdsale phases
    Phase[] private phases;

    // Volume multipliers
    mapping (uint => VolumeMultiplier) private volumeMultipliers;
    uint[] private volumeMultiplierThresholds;

    
    /**
     * Throw if at stage other than current stage
     * 
     * @param _stage expected stage to test for
     */
    modifier at_stage(Stages _stage) {
        require(stage == _stage);
        _;
    }


    /**
     * Only after crowdsaleEnd plus `_time`
     * 
     * @param _time Time to pass
     */
    modifier only_after(uint _time) {
        require(now > crowdsaleEnd + _time);
        _;
    }


    /**
     * Only after crowdsale
     */
    modifier only_after_crowdsale() {
        require(now > crowdsaleEnd);
        _;
    }


    /**
     * Throw if sender is not beneficiary
     */
    modifier only_beneficiary() {
        require(beneficiary == msg.sender);
        _;
    }


    /**
     * Start in the deploying stage
     */
    function Crowdsale() public {
        stage = Stages.Deploying;
    }


    /**
     * Setup the crowdsale
     *
     * @param _start The timestamp of the start date
     * @param _token The token that is sold
     * @param _tokenDenominator The token amount of decimals that the token uses
     * @param _percentageDenominator The percision of percentages
     * @param _minAmountPresale The min cap for the presale
     * @param _maxAmountPresale The max cap for the presale
     * @param _minAcceptedAmountPresale The lowest accepted amount during the presale phase
     * @param _minAmount The min cap for the ICO
     * @param _maxAmount The max cap for the ICO
     * @param _minAcceptedAmount The lowest accepted amount during the ICO phase
     */
    function setup(uint _start, address _token, uint _tokenDenominator, uint _percentageDenominator, uint _minAmountPresale, uint _maxAmountPresale, uint _minAcceptedAmountPresale, uint _minAmount, uint _maxAmount, uint _minAcceptedAmount) public only_owner at_stage(Stages.Deploying) {
        token = IManagedToken(_token);
        tokenDenominator = _tokenDenominator;
        percentageDenominator = _percentageDenominator;
        start = _start;
        minAmountPresale = _minAmountPresale;
        maxAmountPresale = _maxAmountPresale;
        minAcceptedAmountPresale = _minAcceptedAmountPresale;
        minAmount = _minAmount;
        maxAmount = _maxAmount;
        minAcceptedAmount = _minAcceptedAmount;
    }


    /**
     * Setup rates and phases
     *
     * @param _baseRate The rate without bonus
     * @param _phaseRates The rates for each phase
     * @param _phasePeriods The periods that each phase lasts (first phase is the presale phase)
     * @param _phaseBonusLockupPeriods The lockup period that each phase lasts
     * @param _phaseUsesVolumeMultiplier Wheter or not volume bonusses are used in the respective phase
     */
    function setupPhases(uint _baseRate, uint[] _phaseRates, uint[] _phasePeriods, uint[] _phaseBonusLockupPeriods, bool[] _phaseUsesVolumeMultiplier) public only_owner at_stage(Stages.Deploying) {
        baseRate = _baseRate;
        presaleEnd = start + _phasePeriods[0]; // First phase is expected to be the presale phase
        crowdsaleEnd = start; // Plus the sum of the rate phases

        for (uint i = 0; i < _phaseRates.length; i++) {
            crowdsaleEnd += _phasePeriods[i];
            phases.push(Phase(_phaseRates[i], crowdsaleEnd, 0, _phaseUsesVolumeMultiplier[i]));
        }

        for (uint ii = 0; ii < _phaseRates.length; ii++) {
            if (_phaseBonusLockupPeriods[ii] > 0) {
                phases[ii].bonusReleaseDate = crowdsaleEnd + _phaseBonusLockupPeriods[ii];
            }
        }
    }


    /**
     * Setup stakeholders
     *
     * @param _stakeholders The addresses of the stakeholders (first stakeholder is the beneficiary)
     * @param _stakeholderEthPercentages The eth percentages of the stakeholders
     * @param _stakeholderTokenPercentages The token percentages of the stakeholders
     * @param _stakeholderTokenPayoutOverwriteReleaseDates Wheter the vesting period is overwritten for the respective stakeholder
     * @param _stakeholderTokenPayoutFixedReleaseDates The vesting period after which the whole percentage of the tokens is released to the respective stakeholder
     * @param _stakeholderTokenPayoutPercentages The percentage of the tokens that is released at the respective date
     * @param _stakeholderTokenPayoutVestingPeriods The vesting period after which the respective percentage of the tokens is released
     */
    function setupStakeholders(address[] _stakeholders, uint[] _stakeholderEthPercentages, uint[] _stakeholderTokenPercentages, bool[] _stakeholderTokenPayoutOverwriteReleaseDates, uint[] _stakeholderTokenPayoutFixedReleaseDates, uint[] _stakeholderTokenPayoutPercentages, uint[] _stakeholderTokenPayoutVestingPeriods) public only_owner at_stage(Stages.Deploying) {
        beneficiary = _stakeholders[0]; // First stakeholder is expected to be the beneficiary
        for (uint i = 0; i < _stakeholders.length; i++) {
            stakeholderPercentagesIndex.push(_stakeholders[i]);
            stakeholderPercentages[_stakeholders[i]] = Percentage(
                _stakeholderEthPercentages[i], 
                _stakeholderTokenPercentages[i], 
                _stakeholderTokenPayoutOverwriteReleaseDates[i],
                _stakeholderTokenPayoutFixedReleaseDates[i], i);
        }

        // Percentages add up to 100
        for (uint ii = 0; ii < _stakeholderTokenPayoutPercentages.length; ii++) {
            stakeholdersPayouts.push(Payout(_stakeholderTokenPayoutPercentages[ii], _stakeholderTokenPayoutVestingPeriods[ii]));
        }
    }

    
    /**
     * Setup volume multipliers
     *
     * @param _volumeMultiplierRates The rates will be multiplied by this value (denominated by 4)
     * @param _volumeMultiplierLockupPeriods The lockup periods will be multiplied by this value (denominated by 4)
     * @param _volumeMultiplierThresholds The volume thresholds for each respective multiplier
     */
    function setupVolumeMultipliers(uint[] _volumeMultiplierRates, uint[] _volumeMultiplierLockupPeriods, uint[] _volumeMultiplierThresholds) public only_owner at_stage(Stages.Deploying) {
        require(phases.length > 0);
        volumeMultiplierThresholds = _volumeMultiplierThresholds;
        for (uint i = 0; i < volumeMultiplierThresholds.length; i++) {
            volumeMultipliers[volumeMultiplierThresholds[i]] = VolumeMultiplier(_volumeMultiplierRates[i], _volumeMultiplierLockupPeriods[i]);
        }
    }
    

    /**
     * After calling the deploy function the crowdsale
     * rules become immutable 
     */
    function deploy() public only_owner at_stage(Stages.Deploying) {
        require(phases.length > 0);
        require(stakeholderPercentagesIndex.length > 0);
        stage = Stages.Deployed;
    }


    /**
     * Prove that beneficiary is able to sign transactions 
     * and start the crowdsale
     */
    function confirmBeneficiary() public only_beneficiary at_stage(Stages.Deployed) {
        stage = Stages.InProgress;
    }


    /**
     * Returns true if the contract is currently in the presale phase
     *
     * @return True if in presale phase
     */
    function isInPresalePhase() public view returns (bool) {
        return stage == Stages.InProgress && now >= start && now <= presaleEnd;
    }


    /**
     * Returns true if the contract is currently in the ended stage
     *
     * @return True if ended
     */
    function isEnded() public view returns (bool) {
        return stage == Stages.Ended;
    }


    /**
     * Returns true if `_beneficiary` has a balance allocated
     *
     * @param _beneficiary The account that the balance is allocated for
     * @param _releaseDate The date after which the balance can be withdrawn
     * @return True if there is a balance that belongs to `_beneficiary`
     */
    function hasBalance(address _beneficiary, uint _releaseDate) public view returns (bool) {
        return allocatedIndex[_beneficiary].length > 0 && _releaseDate == allocatedIndex[_beneficiary][allocated[_beneficiary][_releaseDate].index];
    }


    /** 
     * Get the allocated token balance of `_owner`
     * 
     * @param _owner The address from which the allocated token balance will be retrieved
     * @return The allocated token balance
     */
    function balanceOf(address _owner) public view returns (uint) {
        uint sum = 0;
        for (uint i = 0; i < allocatedIndex[_owner].length; i++) {
            sum += allocated[_owner][allocatedIndex[_owner][i]].tokens;
        }

        return sum;
    }


    /** 
     * Get the allocated eth balance of `_owner`
     * 
     * @param _owner The address from which the allocated eth balance will be retrieved
     * @return The allocated eth balance
     */
    function ethBalanceOf(address _owner) public view returns (uint) {
        uint sum = 0;
        for (uint i = 0; i < allocatedIndex[_owner].length; i++) {
            sum += allocated[_owner][allocatedIndex[_owner][i]].eth;
        }

        return sum;
    }


    /** 
     * Get invested and refundable balance of `_owner` (only contributions during the ICO phase are registered)
     * 
     * @param _owner The address from which the refundable balance will be retrieved
     * @return The invested refundable balance
     */
    function refundableEthBalanceOf(address _owner) public view returns (uint) {
        return now > crowdsaleEnd && raised < minAmount ? balances[_owner] : 0;
    }


    /**
     * Returns the current phase based on the current time
     *
     * @return The index of the current phase
     */
    function getCurrentPhase() public view returns (uint) {
        for (uint i = 0; i < phases.length; i++) {
            if (now <= phases[i].end) {
                return i;
                break;
            }
        }

        return uint(-1); // Does not exist (underflow)
    }


    /**
     * Returns the rate and bonus release date
     *
     * @param _phase The phase to use while determining the rate
     * @param _volume The amount wei used to determin what volume multiplier to use
     * @return The rate used in `_phase` multiplied by the corresponding volume multiplier
     */
    function getRate(uint _phase, uint _volume) public view returns (uint) {
        uint rate = 0;
        if (stage == Stages.InProgress && now >= start) {
            Phase storage phase = phases[_phase];
            rate = phase.rate;

            // Find volume multiplier
            if (phase.useVolumeMultiplier && volumeMultiplierThresholds.length > 0 && _volume >= volumeMultiplierThresholds[0]) {
                for (uint i = volumeMultiplierThresholds.length; i > 0; i--) {
                    if (_volume >= volumeMultiplierThresholds[i - 1]) {
                        VolumeMultiplier storage multiplier = volumeMultipliers[volumeMultiplierThresholds[i - 1]];
                        rate += phase.rate * multiplier.rateMultiplier / percentageDenominator;
                        break;
                    }
                }
            }
        }
        
        return rate;
    }


    /**
     * Get distribution data based on the current phase and 
     * the volume in wei that is being distributed
     * 
     * @param _phase The current crowdsale phase
     * @param _volume The amount wei used to determine what volume multiplier to use
     * @return Volumes and corresponding release dates
     */
    function getDistributionData(uint _phase, uint _volume) internal view returns (uint[], uint[]) {
        Phase storage phase = phases[_phase];
        uint remainingVolume = _volume;

        bool usingMultiplier = false;
        uint[] memory volumes = new uint[](1);
        uint[] memory releaseDates = new uint[](1);

        // Find volume multipliers
        if (phase.useVolumeMultiplier && volumeMultiplierThresholds.length > 0 && _volume >= volumeMultiplierThresholds[0]) {
            uint phaseReleasePeriod = phase.bonusReleaseDate - crowdsaleEnd;
            for (uint i = volumeMultiplierThresholds.length; i > 0; i--) {
                if (_volume >= volumeMultiplierThresholds[i - 1]) {
                    if (!usingMultiplier) {
                        volumes = new uint[](i + 1);
                        releaseDates = new uint[](i + 1);
                        usingMultiplier = true;
                    }

                    VolumeMultiplier storage multiplier = volumeMultipliers[volumeMultiplierThresholds[i - 1]];
                    uint releaseDate = phase.bonusReleaseDate + phaseReleasePeriod * multiplier.bonusReleaseDateMultiplier / percentageDenominator;
                    uint volume = remainingVolume - volumeMultiplierThresholds[i - 1];

                    // Store increment
                    volumes[i] = volume;
                    releaseDates[i] = releaseDate;

                    remainingVolume -= volume;
                }
            }
        }

        // Store increment
        volumes[0] = remainingVolume;
        releaseDates[0] = phase.bonusReleaseDate;

        return (volumes, releaseDates);
    }


    /**
     * Convert `_wei` to an amount in tokens using 
     * the `_rate`
     *
     * @param _wei amount of wei to convert
     * @param _rate rate to use for the conversion
     * @return Amount in tokens
     */
    function toTokens(uint _wei, uint _rate) public view returns (uint) {
        return _wei * _rate * tokenDenominator / 1 ether;
    }


    /**
     * Receive Eth and issue tokens to the sender
     * 
     * This function requires that msg.sender is not a contract. This is required because it's 
     * not possible for a contract to specify a gas amount when calling the (internal) send() 
     * function. Solidity imposes a maximum amount of gas (2300 gas at the time of writing)
     * 
     * Contracts can call the contribute() function instead
     */
    function () public payable {
        require(msg.sender == tx.origin);
        _handleTransaction(msg.sender, msg.value);
    }


    /**
     * Receive ether and issue tokens to the sender
     *
     * @return The accepted ether amount
     */
    function contribute() public payable returns (uint) {
        return _handleTransaction(msg.sender, msg.value);
    }


    /**
     * Receive ether and issue tokens to `_beneficiary`
     *
     * @param _beneficiary The account that receives the tokens
     * @return The accepted ether amount
     */
    function contributeFor(address _beneficiary) public payable returns (uint) {
        return _handleTransaction(_beneficiary, msg.value);
    }


    /**
     * Function to end the crowdsale by setting 
     * the stage to Ended
     */
    function endCrowdsale() public at_stage(Stages.InProgress) {
        require(now > crowdsaleEnd || raised >= maxAmount);
        require(raised >= minAmount);
        stage = Stages.Ended;

        // Unlock token
        if (!token.unlock()) {
            revert();
        }

        // Allocate tokens (no allocation can be done after this period)
        uint totalTokenSupply = IToken(token).totalSupply() + allocatedTokens;
        for (uint i = 0; i < stakeholdersPayouts.length; i++) {
            Payout storage p = stakeholdersPayouts[i];
            _allocateStakeholdersTokens(totalTokenSupply * p.percentage / percentageDenominator, now + p.vestingPeriod);
        }

        // Allocate remaining ETH
        _allocateStakeholdersEth(this.balance - allocatedEth, 0);
    }


    /**
     * Withdraw allocated tokens
     */
    function withdrawTokens() public {
        withdrawTokensTo(msg.sender);
    }


    /**
     * Withdraw allocated tokens
     *
     * @param _beneficiary Address to send to
     */
    function withdrawTokensTo(address _beneficiary) public {
        uint tokensToSend = 0;
        for (uint i = 0; i < allocatedIndex[msg.sender].length; i++) {
            uint releaseDate = allocatedIndex[msg.sender][i];
            if (releaseDate <= now) {
                Balance storage b = allocated[msg.sender][releaseDate];
                tokensToSend += b.tokens;
                b.tokens = 0;
            }
        }

        if (tokensToSend > 0) {
            allocatedTokens -= tokensToSend;
            if (!token.issue(_beneficiary, tokensToSend)) {
                revert();
            }
        }
    }


    /**
     * Withdraw allocated ether
     */
    function withdrawEther() public {
        withdrawEtherTo(msg.sender);
    }


    /**
     * Withdraw allocated ether
     *
     * @param _beneficiary Address to send to
     */
    function withdrawEtherTo(address _beneficiary) public {
        uint ethToSend = 0;
        for (uint i = 0; i < allocatedIndex[msg.sender].length; i++) {
            uint releaseDate = allocatedIndex[msg.sender][i];
            if (releaseDate <= now) {
                Balance storage b = allocated[msg.sender][releaseDate];
                ethToSend += b.eth;
                b.eth = 0;
            }
        }

        if (ethToSend > 0) {
            allocatedEth -= ethToSend;
            if (!_beneficiary.send(ethToSend)) {
                revert();
            }
        }
    }


    /**
     * Refund in the case of an unsuccessful crowdsale. The 
     * crowdsale is considered unsuccessful if minAmount was 
     * not raised before end of the crowdsale
     */
    function refund() public only_after_crowdsale at_stage(Stages.InProgress) {
        refundTo(msg.sender);
    }


    /**
     * Refund in the case of an unsuccessful crowdsale. The 
     * crowdsale is considered unsuccessful if minAmount was 
     * not raised before end of the crowdsale
     *
     * @param _beneficiary Address to send to
     */
    function refundTo(address _beneficiary) public only_after_crowdsale at_stage(Stages.InProgress) {
        require(raised < minAmount);

        uint receivedAmount = balances[msg.sender];
        balances[msg.sender] = 0;

        if (receivedAmount > 0 && !_beneficiary.send(receivedAmount)) {
            balances[msg.sender] = receivedAmount;
        }
    }


    /**
     * Failsafe and clean-up mechanism
     */
    function destroy() public only_beneficiary only_after(2 years) {
        selfdestruct(beneficiary);
    }


    /**
     * Handle incoming transaction
     * 
     * @param _beneficiary Tokens are issued to this account
     * @param _received The amount that was received
     * @return The accepted ether amount
     */
    function _handleTransaction(address _beneficiary, uint _received) internal at_stage(Stages.InProgress) returns (uint) {
        require(now >= start && now <= crowdsaleEnd);
        require(isAcceptingContributions());
        require(isAcceptedContributor(_beneficiary));

        if (isInPresalePhase()) {
            return _handlePresaleTransaction(
                _beneficiary, _received);
        } else {
            return _handlePublicsaleTransaction(
                _beneficiary, _received);
        }
    }


    /**
     * Handle incoming transaction during the presale phase
     * 
     * @param _beneficiary Tokens are issued to this account
     * @param _received The amount that was received
     * @return The accepted ether amount
     */
    function _handlePresaleTransaction(address _beneficiary, uint _received) private returns (uint) {
        require(_received >= minAcceptedAmountPresale);
        require(raised < maxAmountPresale);

        uint acceptedAmount;
        if (raised + _received > maxAmountPresale) {
            acceptedAmount = maxAmountPresale - raised;
        } else {
            acceptedAmount = _received;
        }

        raised += acceptedAmount;

        // During the presale phase - Non refundable
        _allocateStakeholdersEth(acceptedAmount, 0); 

        // Issue tokens
        _distributeTokens(_beneficiary, _received, acceptedAmount);
        return acceptedAmount;
    }


    /**
     * Handle incoming transaction during the publicsale phase
     * 
     * @param _beneficiary Tokens are issued to this account
     * @param _received The amount that was received
     * @return The accepted ether amount
     */
    function _handlePublicsaleTransaction(address _beneficiary, uint _received) private returns (uint) {
        require(_received >= minAcceptedAmount);
        require(raised >= minAmountPresale);
        require(raised < maxAmount);

        uint acceptedAmount;
        if (raised + _received > maxAmount) {
            acceptedAmount = maxAmount - raised;
        } else {
            acceptedAmount = _received;
        }

        raised += acceptedAmount;
        
        // During the ICO phase - 100% refundable
        balances[_beneficiary] += acceptedAmount; 

        // Issue tokens
        _distributeTokens(_beneficiary, _received, acceptedAmount);
        return acceptedAmount;
    }


    /**
     * Distribute tokens 
     *
     * Tokens can be issued by instructing the token contract to create new tokens or by 
     * allocating tokens and instructing the token contract to create the tokens later
     * 
     * @param _beneficiary Tokens are issued to this account
     * @param _received The amount that was received
     * @param _acceptedAmount The amount that was accepted
     */
    function _distributeTokens(address _beneficiary, uint _received, uint _acceptedAmount) private {
        uint tokensToIssue = 0;
        uint phase = getCurrentPhase();
        var rate = getRate(phase, _acceptedAmount);
        if (rate == 0) {
            revert(); // Paused phase
        }

        // Volume multipliers
        var (volumes, releaseDates) = getDistributionData(
            phase, _acceptedAmount);
        
        // Allocate tokens
        for (uint i = 0; i < volumes.length; i++) {
            var tokensAtCurrentRate = toTokens(volumes[i], rate);
            if (rate > baseRate && releaseDates[i] > now) {
                uint bonusTokens = tokensAtCurrentRate * (rate - baseRate) / rate;
                _allocateTokens(_beneficiary, bonusTokens, releaseDates[i]);

                tokensToIssue += tokensAtCurrentRate - bonusTokens;
            } else {
                tokensToIssue += tokensAtCurrentRate;
            }
        }

        // Issue tokens
        if (tokensToIssue > 0 && !token.issue(_beneficiary, tokensToIssue)) {
            revert();
        }

        // Refund due to max cap hit
        if (_received - _acceptedAmount > 0 && !_beneficiary.send(_received - _acceptedAmount)) {
            revert();
        }
    }


    /**
     * Allocate ETH
     *
     * @param _beneficiary The account to alocate the eth for
     * @param _amount The amount of ETH to allocate
     * @param _releaseDate The date after which the eth can be withdrawn
     */    
    function _allocateEth(address _beneficiary, uint _amount, uint _releaseDate) internal {
        if (hasBalance(_beneficiary, _releaseDate)) {
            allocated[_beneficiary][_releaseDate].eth += _amount;
        } else {
            allocated[_beneficiary][_releaseDate] = Balance(
                _amount, 0, allocatedIndex[_beneficiary].push(_releaseDate) - 1);
        }

        allocatedEth += _amount;
    }


    /**
     * Allocate Tokens
     *
     * @param _beneficiary The account to allocate the tokens for
     * @param _amount The amount of tokens to allocate
     * @param _releaseDate The date after which the tokens can be withdrawn
     */    
    function _allocateTokens(address _beneficiary, uint _amount, uint _releaseDate) internal {
        if (hasBalance(_beneficiary, _releaseDate)) {
            allocated[_beneficiary][_releaseDate].tokens += _amount;
        } else {
            allocated[_beneficiary][_releaseDate] = Balance(
                0, _amount, allocatedIndex[_beneficiary].push(_releaseDate) - 1);
        }

        allocatedTokens += _amount;
    }


    /**
     * Allocate ETH for stakeholders
     *
     * @param _amount The amount of ETH to allocate
     * @param _releaseDate The date after which the eth can be withdrawn
     */    
    function _allocateStakeholdersEth(uint _amount, uint _releaseDate) internal {
        for (uint i = 0; i < stakeholderPercentagesIndex.length; i++) {
            Percentage storage p = stakeholderPercentages[stakeholderPercentagesIndex[i]];
            if (p.eth > 0) {
                _allocateEth(stakeholderPercentagesIndex[i], _amount * p.eth / percentageDenominator, _releaseDate);
            }
        }
    }


    /**
     * Allocate Tokens for stakeholders
     *
     * @param _amount The amount of tokens created
     * @param _releaseDate The date after which the tokens can be withdrawn (unless overwitten)
     */    
    function _allocateStakeholdersTokens(uint _amount, uint _releaseDate) internal {
        for (uint i = 0; i < stakeholderPercentagesIndex.length; i++) {
            Percentage storage p = stakeholderPercentages[stakeholderPercentagesIndex[i]];
            if (p.tokens > 0) {
                _allocateTokens(
                    stakeholderPercentagesIndex[i], 
                    _amount * p.tokens / percentageDenominator, 
                    p.overwriteReleaseDate ? p.fixedReleaseDate : _releaseDate);
            }
        }
    }


    /**
     * Allows the implementing contract to validate a 
     * contributing account
     *
     * @param _contributor Address that is being validated
     * @return Wheter the contributor is accepted or not
     */
    function isAcceptedContributor(address _contributor) internal view returns (bool);


    /**
     * Allows the implementing contract to prevent the accepting 
     * of contributions
     *
     * @return Wheter contributions are accepted or not
     */
    function isAcceptingContributions() internal view returns (bool);
}


/**
 * MoxyOne Crowdsale
 *
 * Advancing the blockchain industry by creating seamless and secure debit card 
 * and payment infrastructure for every company, project and ICO that issues cryptocurrency tokens. 
 *
 * #created 06/01/2018
 * #author Frank Bonnet
 */
contract MoxyOneCrowdsale is Crowdsale, TokenRetriever, IPausable, IAuthenticationManager, IWingsAdapter {

    // State
    bool private paused;

    // Authentication
    IAuthenticator private authenticator;
    bool private requireAuthentication;


    /**
     * Returns whether the implementing contract is 
     * currently paused or not
     *
     * @return Whether the paused state is active
     */
    function isPaused() public view returns (bool) {
        return paused;
    }


    /**
     * Change the state to paused
     */
    function pause() public only_owner {
        paused = true;
    }


    /**
     * Change the state to resume, undo the effects 
     * of calling pause
     */
    function resume() public only_owner {
        paused = false;
    }


    /**
     * Setup authentication
     *
     * @param _authenticator The address of the authenticator (whitelist)
     * @param _requireAuthentication Wether the crowdale requires contributors to be authenticated
     */
    function setupAuthentication(address _authenticator, bool _requireAuthentication) public only_owner at_stage(Stages.Deploying) {
        authenticator = IAuthenticator(_authenticator);
        requireAuthentication = _requireAuthentication;
    }


    /**
     * Returns true if authentication is enabled and false 
     * otherwise
     *
     * @return Whether the converter is currently authenticating or not
     */
    function isAuthenticating() public view returns (bool) {
        return requireAuthentication;
    }


    /**
     * Enable authentication
     */
    function enableAuthentication() public only_owner {
        requireAuthentication = true;
    }


    /**
     * Disable authentication
     */
    function disableAuthentication() public only_owner {
        requireAuthentication = false;
    }


    /**
     * Validate a contributing account
     *
     * @param _contributor Address that is being validated
     * @return Wheter the contributor is accepted or not
     */
    function isAcceptedContributor(address _contributor) internal view returns (bool) {
        return !requireAuthentication || authenticator.authenticate(_contributor);
    }


    /**
     * Indicate if contributions are currently accepted
     *
     * @return Wheter contributions are accepted or not
     */
    function isAcceptingContributions() internal view returns (bool) {
        return !paused;
    }


    /**
     * Wings integration - Get the total raised amount of Ether
     *
     * Can only increased, means if you withdraw ETH from the wallet, should be not modified (you can use two fields 
     * to keep one with a total accumulated amount) amount of ETH in contract and totalCollected for total amount of ETH collected
     *
     * @return Total raised Ether amount
     */
    function totalCollected() public view returns (uint) {
        return raised;
    }


    /**
     * Failsafe mechanism
     * 
     * Allows the owner to retrieve tokens from the contract that 
     * might have been send there by accident
     *
     * @param _tokenContract The address of ERC20 compatible token
     */
    function retrieveTokens(address _tokenContract) public only_owner {
        super.retrieveTokens(_tokenContract);

        // Retrieve tokens from our token contract
        ITokenRetriever(token).retrieveTokens(_tokenContract);
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"allocatedTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"resume","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"withdrawEtherTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"minAmountPresale","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_phase","type":"uint256"},{"name":"_volume","type":"uint256"}],"name":"getRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"contributeFor","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"baseRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"endCrowdsale","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"presaleEnd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_baseRate","type":"uint256"},{"name":"_phaseRates","type":"uint256[]"},{"name":"_phasePeriods","type":"uint256[]"},{"name":"_phaseBonusLockupPeriods","type":"uint256[]"},{"name":"_phaseUsesVolumeMultiplier","type":"bool[]"}],"name":"setupPhases","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_account","type":"address"}],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_wei","type":"uint256"},{"name":"_rate","type":"uint256"}],"name":"toTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"crowdsaleEnd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_start","type":"uint256"},{"name":"_token","type":"address"},{"name":"_tokenDenominator","type":"uint256"},{"name":"_percentageDenominator","type":"uint256"},{"name":"_minAmountPresale","type":"uint256"},{"name":"_maxAmountPresale","type":"uint256"},{"name":"_minAcceptedAmountPresale","type":"uint256"},{"name":"_minAmount","type":"uint256"},{"name":"_maxAmount","type":"uint256"},{"name":"_minAcceptedAmount","type":"uint256"}],"name":"setup","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"refund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_authenticator","type":"address"},{"name":"_requireAuthentication","type":"bool"}],"name":"setupAuthentication","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"refundTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"ethBalanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"minAcceptedAmountPresale","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"deploy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_stakeholders","type":"address[]"},{"name":"_stakeholderEthPercentages","type":"uint256[]"},{"name":"_stakeholderTokenPercentages","type":"uint256[]"},{"name":"_stakeholderTokenPayoutOverwriteReleaseDates","type":"bool[]"},{"name":"_stakeholderTokenPayoutFixedReleaseDates","type":"uint256[]"},{"name":"_stakeholderTokenPayoutPercentages","type":"uint256[]"},{"name":"_stakeholderTokenPayoutVestingPeriods","type":"uint256[]"}],"name":"setupStakeholders","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isAuthenticating","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"enableAuthentication","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"refundableEthBalanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_volumeMultiplierRates","type":"uint256[]"},{"name":"_volumeMultiplierLockupPeriods","type":"uint256[]"},{"name":"_volumeMultiplierThresholds","type":"uint256[]"}],"name":"setupVolumeMultipliers","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"minAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"confirmBeneficiary","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentPhase","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isEnded","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"disableAuthentication","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenContract","type":"address"}],"name":"retrieveTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isPaused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"allocatedEth","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxAmountPresale","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_beneficiary","type":"address"},{"name":"_releaseDate","type":"uint256"}],"name":"hasBalance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"start","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stage","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"withdrawTokensTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"contribute","outputs":[{"name":"","type":"uint256"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"totalCollected","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"raised","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minAcceptedAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isInPresalePhase","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"}]

  Contract Creation Code Switch To Opcodes View
606060405260008054600160a060020a03191633600160a060020a03161781556011805460ff191690556128d390819061003990396000f3006060604052600436106102575763ffffffff60e060020a6000350416622f95698114610284578063046f7da2146102a957806307fa40e4146102be5780630d6f849b146102dd5780630d70e7e3146102f057806310718655146103095780631f68f20a1461031d5780632095f2d414610330578063229f3e29146103435780632d92b1c0146103565780632f54bf6e1461046a57806338af3eed1461049d5780634942edf9146104cc5780634d9aa424146104e5578063582ab0b4146104f8578063590e1ae3146105345780635f48f393146105475780636b54821f1461055a57806370a082311461057e57806371ed46641461059d5780637252bbf2146105bc5780637362377b146105db57806376c82e92146105ee578063775c300c1461060157806383197ef0146106145780638456cb5914610627578063893d20e81461063a5780638d8f2adb1461064d5780638ec521a814610660578063903f2c481461082f57806390be0bd91461084257806392099fdb14610855578063984c14ac146108745780639b2cb5d8146109435780639c5e902314610956578063a3a40ea514610969578063a4fd6f561461097c578063a92d6a481461098f578063ac4ddd9f146109a2578063b187bd26146109c1578063b19a4540146109d4578063b946fab1146109e7578063bd51d5d0146109fa578063be9a655514610a1c578063c040e6b814610a2f578063c3c1d4c714610a66578063d7bb99ba14610a85578063e29eb83614610a8d578063f0ea4bfc14610aa0578063f1d841f114610ab3578063f96c166c14610ac6578063fc0c546a14610ad9575b32600160a060020a031633600160a060020a031614151561027757600080fd5b6102813334610aec565b50005b341561028f57600080fd5b610297610b81565b60405190815260200160405180910390f35b34156102b457600080fd5b6102bc610b87565b005b34156102c957600080fd5b6102bc600160a060020a0360043516610bae565b34156102e857600080fd5b610297610c8f565b34156102fb57600080fd5b610297600435602435610c95565b610297600160a060020a0360043516610dc7565b341561032857600080fd5b610297610dd9565b341561033b57600080fd5b6102bc610ddf565b341561034e57600080fd5b610297610f99565b341561036157600080fd5b6102bc60048035906044602480359081019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610f9f95505050505050565b341561047557600080fd5b610489600160a060020a0360043516611165565b604051901515815260200160405180910390f35b34156104a857600080fd5b6104b0611179565b604051600160a060020a03909116815260200160405180910390f35b34156104d757600080fd5b610297600435602435611188565b34156104f057600080fd5b61029761119d565b341561050357600080fd5b6102bc600435600160a060020a036024351660443560643560843560a43560c43560e43561010435610124356111a3565b341561053f57600080fd5b6102bc611243565b341561055257600080fd5b61029761127b565b341561056557600080fd5b6102bc600160a060020a03600435166024351515611281565b341561058957600080fd5b610297600160a060020a0360043516611316565b34156105a857600080fd5b6102bc600160a060020a036004351661139b565b34156105c757600080fd5b610297600160a060020a0360043516611451565b34156105e657600080fd5b6102bc6114d0565b34156105f957600080fd5b6102976114db565b341561060c57600080fd5b6102bc6114e1565b341561061f57600080fd5b6102bc611551565b341561063257600080fd5b6102bc611590565b341561064557600080fd5b6104b06115ba565b341561065857600080fd5b6102bc6115ca565b341561066b57600080fd5b6102bc60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506115d395505050505050565b341561083a57600080fd5b61048961184d565b341561084d57600080fd5b6102bc61185d565b341561086057600080fd5b610297600160a060020a036004351661189f565b341561087f57600080fd5b6102bc600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118dc95505050505050565b341561094e57600080fd5b6102976119d2565b341561096157600080fd5b6102bc6119d8565b341561097457600080fd5b610297611a25565b341561098757600080fd5b610489611a75565b341561099a57600080fd5b6102bc611a90565b34156109ad57600080fd5b6102bc600160a060020a0360043516611acc565b34156109cc57600080fd5b610489611b56565b34156109df57600080fd5b610297611b5f565b34156109f257600080fd5b610297611b65565b3415610a0557600080fd5b610489600160a060020a0360043516602435611b6b565b3415610a2757600080fd5b610297611bdd565b3415610a3a57600080fd5b610a42611be3565b60405180826003811115610a5257fe5b60ff16815260200191505060405180910390f35b3415610a7157600080fd5b6102bc600160a060020a0360043516611bec565b610297611d23565b3415610a9857600080fd5b610297611d34565b3415610aab57600080fd5b610297611d3a565b3415610abe57600080fd5b610297611d40565b3415610ad157600080fd5b610489611d46565b3415610ae457600080fd5b6104b0611d7b565b600060028060115460ff166003811115610b0257fe5b14610b0c57600080fd5b600b544210158015610b205750600d544211155b1515610b2b57600080fd5b610b33611d8f565b1515610b3e57600080fd5b610b4784611d99565b1515610b5257600080fd5b610b5a611d46565b15610b7057610b698484611e2e565b9150610b7a565b610b698484611e8e565b5092915050565b60105481565b60005433600160a060020a03908116911614610ba257600080fd5b601b805460ff19169055565b60008080805b600160a060020a033316600090815260146020526040902054831015610c4557600160a060020a0333166000908152601460205260409020805484908110610bf857fe5b6000918252602090912001549150428211610c3a5750600160a060020a0333166000908152601360209081526040808320848452909152812080549181559301925b600190920191610bb4565b6000841115610c8857600f80548590039055600160a060020a03851684156108fc0285604051600060405180830381858888f193505050501515610c8857600080fd5b5050505050565b60055481565b600080808080600260115460ff166003811115610cae57fe5b148015610cbd5750600b544210155b15610dbc576018805488908110610cd057fe5b600091825260209091206004909102018054600382015490955090935060ff168015610cff5750601a54600090115b8015610d255750601a80546000908110610d1557fe5b9060005260206000209001548610155b15610dbc57601a5491505b6000821115610dbc57601a80546000198401908110610d4b57fe5b6000918252602090912001548610610db05760196000601a60018503815481101515610d7357fe5b906000526020600020900154815260200190815260200160002090506009548160000154846000015402811515610da657fe5b0484019350610dbc565b60001990910190610d30565b509195945050505050565b6000610dd38234610aec565b92915050565b60015481565b6000808060028060115460ff166003811115610df757fe5b14610e0157600080fd5b600d54421180610e155750600354600e5410155b1515610e2057600080fd5b600254600e541015610e3157600080fd5b6011805460ff191660031790819055600160a060020a036101009091041663a69df4b56000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610e8b57600080fd5b6102c65a03f11515610e9c57600080fd5b505050604051805190501515610eb157600080fd5b6010546011546101009004600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610f0157600080fd5b6102c65a03f11515610f1257600080fd5b50505060405180519050019350600092505b601754831015610f7a576017805484908110610f3c57fe5b90600052602060002090600202019150610f6f60095483600001548602811515610f6257fe5b0483600101544201611f12565b600190920191610f24565b610f93600f5430600160a060020a031631036000611fce565b50505050565b600c5481565b60008054819033600160a060020a03908116911614610fbd57600080fd5b60008060115460ff166003811115610fd157fe5b14610fdb57600080fd5b600188905585600081518110610fed57fe5b90602001906020020151600b54908101600c55600d55600092505b86518310156110e55785838151811061101d57fe5b90602001906020020151600d8054909101905560188054600181016110428382612765565b916000526020600020906004020160006080604051908101604052808b888151811061106a57fe5b906020019060200201518152602001600d5481526020016000815260200188888151811061109457fe5b90602001906020020151151590529190508151815560208201518160010155604082015181600201556060820151600391909101805460ff1916911515919091179055505060019290920191611008565b600091505b865182101561115b57600085838151811061110157fe5b9060200190602002015111156111505784828151811061111d57fe5b90602001906020020151600d540160188381548110151561113a57fe5b9060005260206000209060040201600201819055505b6001909101906110ea565b5050505050505050565b600054600160a060020a0390811691161490565b600854600160a060020a031681565b600a54670de0b6b3a764000092909102020490565b600d5481565b60005433600160a060020a039081169116146111be57600080fd5b60008060115460ff1660038111156111d257fe5b146111dc57600080fd5b5060118054600160a060020a03909a166101000274ffffffffffffffffffffffffffffffffffffffff0019909a1699909917909855600a96909655600994909455600b96909655600591909155600655600793909355600292909255600391909155600455565b600d54421161125157600080fd5b60028060115460ff16600381111561126557fe5b1461126f57600080fd5b6112783361139b565b50565b60035481565b60005433600160a060020a0390811691161461129c57600080fd5b60008060115460ff1660038111156112b057fe5b146112ba57600080fd5b50601b805491151560a860020a0275ff00000000000000000000000000000000000000000019600160a060020a039094166101000274ffffffffffffffffffffffffffffffffffffffff00199093169290921792909216179055565b600080805b600160a060020a038416600090815260146020526040902054811015610b7a57600160a060020a03841660009081526013602090815260408083206014909252822080549192918490811061136c57fe5b90600052602060002090015481526020019081526020016000206001015482019150808060010191505061131b565b600d5460009042116113ac57600080fd5b60028060115460ff1660038111156113c057fe5b146113ca57600080fd5b600254600e54106113da57600080fd5b600160a060020a033316600090815260126020526040812080549082905592508211801561142b5750600160a060020a03831682156108fc0283604051600060405180830381858888f19350505050155b1561144c57600160a060020a03331660009081526012602052604090208290555b505050565b600080805b600160a060020a038416600090815260146020526040902054811015610b7a57600160a060020a0384166000908152601360209081526040808320601490925282208054919291849081106114a757fe5b600091825260208083209091015483528201929092526040019020549190910190600101611456565b6114d933610bae565b565b60075481565b60005433600160a060020a039081169116146114fc57600080fd5b60008060115460ff16600381111561151057fe5b1461151a57600080fd5b6018546000901161152a57600080fd5b6016546000901161153a57600080fd5b601180546001919060ff191682805b021790555050565b60085433600160a060020a0390811691161461156c57600080fd5b600d546303c26700908101421161158257600080fd5b600854600160a060020a0316ff5b60005433600160a060020a039081169116146115ab57600080fd5b601b805460ff19166001179055565b600054600160a060020a03165b90565b6114d933611bec565b60008054819033600160a060020a039081169116146115f157600080fd5b60008060115460ff16600381111561160557fe5b1461160f57600080fd5b8960008151811061161c57fe5b906020019060200201516008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055600092505b89518310156117b45760168054600181016116738382612791565b916000526020600020900160008c868151811061168c57fe5b90602001906020020151909190916101000a815481600160a060020a030219169083600160a060020a031602179055505060a0604051908101604052808a85815181106116d557fe5b9060200190602002015181526020018985815181106116f057fe5b90602001906020020151815260200188858151811061170b57fe5b906020019060200201511515815260200187858151811061172857fe5b906020019060200201518152602001849052601560008c868151811061174a57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000208151815560208201518160010155604082015160028201805460ff191691151591909117905560608201518160030155608082015160049091015550600190920191611658565b600091505b84518210156118415760178054600181016117d483826127b5565b9160005260206000209060020201600060408051908101604052808987815181106117fb57fe5b90602001906020020151815260200188878151811061181657fe5b9060200190602002015190529190508151815560208201516001918201559390930192506117b99050565b50505050505050505050565b601b5460a860020a900460ff1690565b60005433600160a060020a0390811691161461187857600080fd5b601b805475ff000000000000000000000000000000000000000000191660a860020a179055565b6000600d54421180156118b55750600254600e54105b6118c0576000610dd3565b50600160a060020a031660009081526012602052604090205490565b6000805433600160a060020a039081169116146118f857600080fd5b60008060115460ff16600381111561190c57fe5b1461191657600080fd5b6018546000901161192657600080fd5b601a8380516119399291602001906127e1565b50600091505b601a54821015610c8857604080519081016040528086848151811061196057fe5b90602001906020020151815260200185848151811061197b57fe5b9060200190602002015181525060196000601a8581548110151561199b57fe5b906000526020600020900154815260200190815260200160002060008201518155602082015160019182015592909201915061193f565b60025481565b60085433600160a060020a039081169116146119f357600080fd5b60018060115460ff166003811115611a0757fe5b14611a1157600080fd5b601180546002919060ff1916600183611549565b6000805b601854811015611a6b576018805482908110611a4157fe5b90600052602060002090600402016001015442111515611a6357809150611a71565b600101611a29565b60001991505b5090565b6000600360115460ff166003811115611a8a57fe5b14905090565b60005433600160a060020a03908116911614611aab57600080fd5b601b805475ff00000000000000000000000000000000000000000019169055565b60005433600160a060020a03908116911614611ae757600080fd5b611af08161206a565b6011546101009004600160a060020a031663ac4ddd9f8260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515611b4557600080fd5b6102c65a03f11515610f9357600080fd5b601b5460ff1690565b600f5481565b60065481565b600160a060020a0382166000908152601460205260408120548190118015611bd65750600160a060020a0383166000908152601460209081526040808320601383528184208685529092529091206002015481548110611bc757fe5b90600052602060002090015482145b9392505050565b600b5481565b60115460ff1681565b60008080805b600160a060020a033316600090815260146020526040902054831015611c8757600160a060020a0333166000908152601460205260409020805484908110611c3657fe5b6000918252602090912001549150428211611c7c5750600160a060020a033316600090815260136020908152604080832084845290915281206001810180549290559301925b600190920191611bf2565b6000841115610c88576010805485900390556011546101009004600160a060020a031663867904b4868660006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611cfd57600080fd5b6102c65a03f11515611d0e57600080fd5b505050604051805190501515610c8857600080fd5b6000611d2f3334610aec565b905090565b600e5490565b600e5481565b60045481565b6000600260115460ff166003811115611d5b57fe5b148015611d6a5750600b544210155b8015611d2f575050600c5442111590565b6011546101009004600160a060020a031681565b601b5460ff161590565b601b5460009060a860020a900460ff161580610dd35750601b546101009004600160a060020a03166308e0d29d8360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515611e0e57600080fd5b6102c65a03f11515611e1f57600080fd5b50505060405180519392505050565b6000806007548310151515611e4257600080fd5b600654600e5410611e5257600080fd5b60065483600e54011115611e6d5750600e5460065403611e70565b50815b600e805482019055611e83816000611fce565b611bd6848483612165565b6000806004548310151515611ea257600080fd5b600554600e541015611eb357600080fd5b600354600e5410611ec357600080fd5b60035483600e54011115611ede5750600e5460035403611ee1565b50815b600e805482019055600160a060020a0384166000908152601260205260409020805482019055611bd6848483612165565b6000805b601654821015610f935760156000601684815481101515611f3357fe5b6000918252602080832090910154600160a060020a03168352820192909252604001812060018101549092501115611fc357611fc3601683815481101515611f7757fe5b6000918252602090912001546009546001840154600160a060020a03909216918702811515611fa257fe5b60028501549190049060ff16611fb85785611fbe565b83600301545b612340565b600190910190611f16565b6000805b601654821015610f935760156000601684815481101515611fef57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400181208054909250111561205f5761205f60168381548110151561203057fe5b6000918252602090912001546009548354600160a060020a0390921691870281151561205857fe5b0485612421565b600190910190611fd2565b806000600160a060020a0382166370a0823130836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156120c357600080fd5b6102c65a03f115156120d457600080fd5b5050506040518051915050600081111561144c5781600160a060020a031663a9059cbb338360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561214557600080fd5b6102c65a03f1151561215657600080fd5b50505060405180515050505050565b6000806000612172612828565b61217a612828565b600080600080975061218a611a25565b9650612196878a610c95565b95508515156121a457600080fd5b6121ae878a6124ff565b94509450600092505b845183101561225b576121df8584815181106121cf57fe5b9060200190602002015187611188565b9150600154861180156122065750428484815181106121fa57fe5b90602001906020020151115b1561224b57856001548703830281151561221c57fe5b04905061223f8b8286868151811061223057fe5b90602001906020020151612340565b80820388019750612250565b968101965b6001909201916121b7565b6000881180156122e757506011546101009004600160a060020a031663867904b48c8a60006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156122ca57600080fd5b6102c65a03f115156122db57600080fd5b50505060405180519050155b156122f157600080fd5b6000898b031180156123295750600160a060020a038b16898b0380156108fc0290604051600060405180830381858888f19350505050155b1561233357600080fd5b5050505050505050505050565b61234a8382611b6b565b1561238057600160a060020a03831660009081526013602090815260408083208484529091529020600101805483019055612414565b6060604051908101604090815260008083526020808401869052600160a060020a038716825260149052819020805491830191600191908083016123c48382612791565b600092835260208084209290920187905592909203909252600160a060020a0386168252601381526040808320858452909152902081518155602082015181600101556040820151600290910155505b5060108054909101905550565b61242b8382611b6b565b1561245e57600160a060020a038316600090815260136020908152604080832084845290915290208054830190556124f2565b6060604051908101604090815283825260006020808401829052600160a060020a038716825260149052819020805491830191600191908083016124a28382612791565b600092835260208084209290920187905592909203909252600160a060020a0386168252601381526040808320858452909152902081518155602082015181600101556040820151600290910155505b50600f8054909101905550565b612507612828565b61250f612828565b600080600061251c612828565b612524612828565b600080600080600060188e81548110151561253b57fe5b906000526020600020906004020199508c98506000975060016040518059106125615750595b9080825280602002602001820160405250965060016040518059106125835750595b908082528060200260200182016040525060038b015490965060ff1680156125ae5750601a54600090115b80156125d45750601a805460009081106125c457fe5b9060005260206000209001548d10155b1561271d57600d5460028b0154601a54919003955093505b600084111561271d57601a8054600019860190811061260757fe5b6000918252602090912001548d106127115787151561266d57836001016040518059106126315750595b90808252806020026020018201604052509650836001016040518059106126555750595b90808252806020026020018201604052509550600197505b60196000601a6001870381548110151561268357fe5b90600052602060002090015481526020019081526020016000209250600954836001015486028115156126b257fe5b048a60020154019150601a600185038154811015156126cd57fe5b90600052602060002090015489039050808785815181106126ea57fe5b602090810290910101528186858151811061270157fe5b6020908102909101015297889003975b600019909301926125ec565b888760008151811061272b57fe5b6020908102909101015260028a01548660008151811061274757fe5b6020908102909101015250949c939b50929950505050505050505050565b81548183558181151161144c5760040281600402836000526020600020918201910161144c919061283a565b81548183558181151161144c5760008381526020902061144c91810190830161286d565b81548183558181151161144c5760020281600202836000526020600020918201910161144c9190612887565b82805482825590600052602060002090810192821561281c579160200282015b8281111561281c578251825591602001919060010190612801565b50611a7192915061286d565b60206040519081016040526000815290565b6115c791905b80821115611a7157600080825560018201819055600282015560038101805460ff19169055600401612840565b6115c791905b80821115611a715760008155600101612873565b6115c791905b80821115611a71576000808255600182015560020161288d5600a165627a7a7230582013db2a51afc6b90418441279219bd95a35f2c2abd0d063eb492d9839a984c1d80029

   Swarm Source:
bzzr://13db2a51afc6b90418441279219bd95a35f2c2abd0d063eb492d9839a984c1d8

 

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.