Sponsored Link:   SHIFT.cash - 1st ever car title loan platform on blockchain. Join NOW.
Contract Overview
ETH Balance: 0 Ether
ETH USD Value: $0
No Of Transactions: 4 txns
  Latest 4 txns

TxHash Age From To Value [TxFee]
0xfd3142cda5148043585239e0bb6816b07b45d555fd64a5545fee7851e29e4a0f305 days 17 hrs ago0x5de92686587b10cd47e03b71f2e2350606fcaf14  IN   0xa9a8108994bb704261567e53b49607a73876ddf10 Ether0.000415096679
0x24665c9dd36362bd8e283a62b8921763ce66ad8e1a9d28a85181c5f77909b178305 days 17 hrs ago0x5de92686587b10cd47e03b71f2e2350606fcaf14  IN   0xa9a8108994bb704261567e53b49607a73876ddf10 Ether0.002295021639
0x73c60ee1e58c1fe1945af624a0dbac6d605e24d915933794f6ca3e061005c906305 days 17 hrs ago0x5de92686587b10cd47e03b71f2e2350606fcaf14  IN   0xa9a8108994bb704261567e53b49607a73876ddf10.2 Ether0.001635326917
0x40ce47c452ef69cbdbfb0d083a7986742db7c320b98618ea5f1dc00c9b0b5f92305 days 17 hrs ago0x5de92686587b10cd47e03b71f2e2350606fcaf14  IN    Contract Creation0 Ether0.018356433147
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 2 Internal Transactions

ParentTxHash Block Age From To Value
0x24665c9dd36362bd8e283a62b8921763ce66ad8e1a9d28a85181c5f77909b1783173634305 days 17 hrs ago0xa9a8108994bb704261567e53b49607a73876ddf10xa86a60d53e6f474e049be54824551bb99f05adee0.04 Ether
0x24665c9dd36362bd8e283a62b8921763ce66ad8e1a9d28a85181c5f77909b1783173634305 days 17 hrs ago0xa9a8108994bb704261567e53b49607a73876ddf10x24c3235558572cff8054b5a419251d3b0d43e91b0.16 Ether
[ Download CSV Export  ] 
Contract Name: EtherollCrowdfund
Compiler Version: v0.4.8+commit.60cc1668
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.2;

/*
*  @notice the token contract used as reward 
*/
contract token {

    /*
    *  @notice exposes the transfer method of the token contract
    *  @param _receiver address receiving tokens
    *  @param _amount number of tokens being transferred       
    */    
    function transfer(address _receiver, uint _amount) returns (bool success) { }

    /*
    *  @notice exposes the priviledgedAddressBurnUnsoldCoins method of the token contract
    *  burns all unsold coins  
    */     
    function priviledgedAddressBurnUnsoldCoins(){ }

}

/*
`* is owned
*/
contract owned {

    address public owner;

    function owned() {
        owner = msg.sender;
    }

    modifier onlyOwner {
        if (msg.sender != owner) throw;
        _;
    }

    function ownerTransferOwnership(address newOwner)
        onlyOwner
    {
        owner = newOwner;
    }

}

/*
* safe math
*/
contract DSSafeAddSub {

    function safeToAdd(uint a, uint b) internal returns (bool) {
        return (a + b >= a);
    }

    function safeAdd(uint a, uint b) internal returns (uint) {
        if (!safeToAdd(a, b)) throw;
        return a + b;
    }

    function safeToSubtract(uint a, uint b) internal returns (bool) {
        return (b <= a);
    }

    function safeSub(uint a, uint b) internal returns (uint) {
        if (!safeToSubtract(a, b)) throw;
        return a - b;
    } 

}

/* 
*  EtherollCrowdfund contract
*  Funds sent to this address transfer a customized ERC20 token to msg.sender for the duration of the crowdfund
*  Deployment order:
*  EtherollToken, EtherollCrowdfund
*  1) Send tokens to this
*  2) Assign this as priviledgedAddress in EtherollToken
*  3) Call updateTokenStatus in EtherollToken 
*  -- crowdfund is open --
*  4) safeWithdraw onlyAfterDeadline in this
*  5) ownerBurnUnsoldTokens onlyAfterDeadline in this
*  6) updateTokenStatus in EtherollToken freezes/thaws tokens
*/
contract EtherollCrowdfund is owned, DSSafeAddSub {

    /*
    *  checks only after crowdfund deadline
    */    
    modifier onlyAfterDeadline() { 
        if (now < deadline) throw;
        _; 
    }

    /*
    *  checks only in emergency
    */    
    modifier isEmergency() { 
        if (!emergency) throw;
        _; 
    } 

    /* the crowdfund goal */
    uint public fundingGoal;
    /* 1 week countdown to price increase */
    uint public weekTwoPriceRiseBegin = now + 10080 * 1 minutes;    
    /* 80% to standard multi-sig wallet contract is house bankroll  */
    address public bankRollBeneficiary;      
    /* 20% to etheroll wallet*/
    address public etherollBeneficiary;         
    /* total amount of ether raised */
    uint public amountRaised;
    /* two weeks */
    uint public deadline;
    /* 0.01 ETH per token base price */
    uint public price = 10000000000000000;
    /* address of token used as reward */
    token public tokenReward;
    /* crowdsale is open */
    bool public crowdsaleClosed = false;  
    /* 80% of funds raised */
    uint public bankrollBeneficiaryAmount;
    /* 20% of funds raised */    
    uint public etherollBeneficiaryAmount;
    /* map balance of address */
    mapping (address => uint) public balanceOf; 
    /* funding goal has not been reached */ 
    bool public fundingGoalReached = false;   
    /* escape hatch for all in emergency */
    bool public emergency = false; 

    /* log events */
    event LogFundTransfer(address indexed Backer, uint indexed Amount, bool indexed IsContribution);  
    event LogGoalReached(address indexed Beneficiary, uint indexed AmountRaised);       

    /*
    *  @param _ifSuccessfulSendToBeneficiary receives 80% of ether raised end of crowdfund
    *  @param _ifSuccessfulSendToEtheroll receives 20% of ether raised end of crowdfund
    *  @param _fundingGoalInEthers the funding goal of the crowdfund
    *  @param _durationInMinutes the length of the crowdfund in minutes
    *  @param _addressOfTokenUsedAsReward the token address   
    */  
    function EtherollCrowdfund(
        /* multi-sig address to send 80% */        
        address _ifSuccessfulSendToBeneficiary,
        /* address to send 20% */
        address _ifSuccessfulSendToEtheroll,
        /* funding goal */
        uint _fundingGoalInEthers,
        /* two weeks: 20160 minutes*/
        uint _durationInMinutes,
        /* token */
        token _addressOfTokenUsedAsReward
    ) {
        bankRollBeneficiary = _ifSuccessfulSendToBeneficiary;
        etherollBeneficiary = _ifSuccessfulSendToEtheroll;
        fundingGoal = _fundingGoalInEthers * 1 ether;
        deadline = now + _durationInMinutes * 1 minutes;
        tokenReward = token(_addressOfTokenUsedAsReward);
    }
  
    /*
    *  @notice public function
    *  default function is payable
    *  responsible for transfer of tokens based on price, msg.sender and msg.value
    *  tracks investment total of msg.sender 
    *  refunds any spare change
    */      
    function ()
        payable
    {

        /* crowdfund period is over */
        if(now > deadline) crowdsaleClosed = true;  

        /* crowdsale is closed */
        if (crowdsaleClosed) throw;

        /* do not allow creating 0 */        
        if (msg.value == 0) throw;      

        /* 
        *  transfer tokens
        *  check/set week two price rise
        */
        if(now < weekTwoPriceRiseBegin) {
                      
            /* week 1 power token conversion * 2: 1 ETH = 200 tokens */
            if(tokenReward.transfer(msg.sender, ((msg.value*price)/price)*2)) {
                LogFundTransfer(msg.sender, msg.value, true); 
            } else {
                throw;
            }

        }else{
            /* week 2 conversion: 1 ETH = 100 tokens */
            if(tokenReward.transfer(msg.sender, (msg.value*price)/price)) {
                LogFundTransfer(msg.sender, msg.value, true); 
            } else {
                throw;
            }            

        } 

        /* add to amountRaised */
        amountRaised = safeAdd(amountRaised, msg.value);          

        /* track ETH balanceOf address in case emergency refund is required */  
        balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], msg.value);

    }    

    /*
    *  @notice public function
    *  onlyAfterDeadline
    *  moves ether to beneficiary contracts if goal reached
    *  if goal not reached msg.sender can withdraw their deposit
    */     
    function safeWithdraw() public
        onlyAfterDeadline
    {

        if (amountRaised >= fundingGoal){
            /* allows funds to be moved to beneficiary */
            fundingGoalReached = true;
            /* log event */            
            LogGoalReached(bankRollBeneficiary, amountRaised);           
        }    
            
        /* close crowdsale */
        crowdsaleClosed = true;  
                        
        /* 
        *  public 
        *  funding goal not reached 
        *  manual refunds
        */
        if (!fundingGoalReached) {
            calcRefund(msg.sender);
        }
        
        /* 
        *  onlyOwner can call
        *  funding goal reached 
        *  move funds to beneficiary addresses
        */        
        if (msg.sender == owner && fundingGoalReached) {

            /* multi-sig bankrollBeneficiary receives 80% */
            bankrollBeneficiaryAmount = (this.balance*80)/100;   

            /* send to trusted address bankRollBeneficiary 80% */      
            if (bankRollBeneficiary.send(bankrollBeneficiaryAmount)) {  

                /* log event */              
                LogFundTransfer(bankRollBeneficiary, bankrollBeneficiaryAmount, false);
            
                /* etherollBeneficiary receives remainder */
                etherollBeneficiaryAmount = this.balance;                  

                /* send to trusted address etherollBeneficiary the remainder */
                if(!etherollBeneficiary.send(etherollBeneficiaryAmount)) throw;

                /* log event */        
                LogFundTransfer(etherollBeneficiary, etherollBeneficiaryAmount, false);                 

            } else {

                /* allow manual refunds via safeWithdrawal */
                fundingGoalReached = false;

            }
        }
    }  

    /*
    *  @notice internal function
    *  @param _addressToRefund the address being refunded
    *  accessed via public functions emergencyWithdraw and safeWithdraw
    *  calculates refund amount available for an address  
    */     
    function calcRefund(address _addressToRefund) internal
    {
        /* assigns var amount to balance of _addressToRefund */
        uint amount = balanceOf[_addressToRefund];
        /* sets balance to 0 */
        balanceOf[_addressToRefund] = 0;
        /* is there any balance? */
        if (amount > 0) {
            /* call to untrusted address */
            if (_addressToRefund.call.value(amount)()) {
                /* log event */
                LogFundTransfer(_addressToRefund, amount, false);
            } else {
                /* unsuccessful send so reset the balance */
                balanceOf[_addressToRefund] = amount;
            }
        } 
    }     
   

    /*
    *  @notice public function
    *  emergency manual refunds
    */     
    function emergencyWithdraw() public
        isEmergency    
    {
        /* manual refunds */
        calcRefund(msg.sender);
    }        

    /*
    *  @notice owner restricted function   
    *  @param _newEmergencyStatus boolean
    *  sets contract mode to emergency status to allow individual withdraw via emergencyWithdraw()
    */    
    function ownerSetEmergencyStatus(bool _newEmergencyStatus) public
        onlyOwner 
    {        
        /* close crowdsale */
        crowdsaleClosed = _newEmergencyStatus;
        /* allow manual refunds via emergencyWithdraw */
        emergency = _newEmergencyStatus;        
    } 

    /*
    *  @notice  owner restricted function 
    *  burns any unsold tokens at end of crowdfund
    */      
    function ownerBurnUnsoldTokens()
        onlyOwner
        onlyAfterDeadline
    {
        tokenReward.priviledgedAddressBurnUnsoldCoins();
    }         


}

    Contract ABI  
[{"constant":false,"inputs":[],"name":"ownerBurnUnsoldTokens","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"etherollBeneficiaryAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"deadline","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"tokenReward","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"fundingGoal","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"amountRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"safeWithdraw","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"bankRollBeneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newEmergencyStatus","type":"bool"}],"name":"ownerSetEmergencyStatus","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"price","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"ownerTransferOwnership","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"weekTwoPriceRiseBegin","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"emergency","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"crowdsaleClosed","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"bankrollBeneficiaryAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"fundingGoalReached","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"etherollBeneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"emergencyWithdraw","outputs":[],"payable":false,"type":"function"},{"inputs":[{"name":"_ifSuccessfulSendToBeneficiary","type":"address"},{"name":"_ifSuccessfulSendToEtheroll","type":"address"},{"name":"_fundingGoalInEthers","type":"uint256"},{"name":"_durationInMinutes","type":"uint256"},{"name":"_addressOfTokenUsedAsReward","type":"address"}],"payable":false,"type":"constructor"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"Backer","type":"address"},{"indexed":true,"name":"Amount","type":"uint256"},{"indexed":true,"name":"IsContribution","type":"bool"}],"name":"LogFundTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"Beneficiary","type":"address"},{"indexed":true,"name":"AmountRaised","type":"uint256"}],"name":"LogGoalReached","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405262093a804201600255662386f26fc100006007556008805460a060020a60ff0219169055600c805461ffff19169055346100005760405160a080610b1683398101604090815281516020830151918301516060840151608090940151919390915b5b60008054600160a060020a03191633600160a060020a03161790555b60038054600160a060020a03808816600160a060020a03199283161790925560048054878416908316179055670de0b6b3a7640000850260015542603c85020160065560088054928416929091169190911790555b50505050505b610a2a806100ec6000396000f300606060405236156100f65763ffffffff60e060020a6000350416630860a90281146103215780631671055d1461033057806329dcb0cf1461034f5780636e66f6e91461036e57806370a08231146103975780637a3a0e84146103c25780637b3e5e7b146103e15780637fd42617146104005780638da5cb5b1461040f5780638e72a92614610438578063972afc8014610461578063a035b1fe14610475578063a09cca9314610494578063a3666d23146104af578063caa6fea4146104ce578063ccb07cef146104ef578063ccbd515214610510578063d424f6281461052f578063d4c72e7f14610550578063db2e21bc14610579575b61031f5b60065442111561011b576008805460a060020a60ff02191660a060020a1790555b60085460a060020a900460ff161561013257610000565b34151561013e57610000565b60025442101561021057600854600754600160a060020a039091169063a9059cbb903390348102811561000057046002026000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b156100005760325a03f11561000057505060405151159050610206576040516001903490600160a060020a033316906000805160206109df83398151915290600090a461020b565b610000565b6102d0565b600854600754600160a060020a039091169063a9059cbb903390348102811561000057046000604051602001526040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b156100005760325a03f11561000057505060405151159050610206576040516001903490600160a060020a033316906000805160206109df83398151915290600090a46102d0565b610000565b5b6102dd60055434610588565b600555600160a060020a0333166000908152600b60205260409020546103039034610588565b600160a060020a0333166000908152600b60205260409020555b565b005b346100005761031f6105aa565b005b346100005761033d61063e565b60408051918252519081900360200190f35b346100005761033d610644565b60408051918252519081900360200190f35b346100005761037b61064a565b60408051600160a060020a039092168252519081900360200190f35b346100005761033d600160a060020a0360043516610659565b60408051918252519081900360200190f35b346100005761033d61066b565b60408051918252519081900360200190f35b346100005761033d610671565b60408051918252519081900360200190f35b346100005761031f610677565b005b346100005761037b610811565b60408051600160a060020a039092168252519081900360200190f35b346100005761037b610820565b60408051600160a060020a039092168252519081900360200190f35b346100005761031f600435151561082f565b005b346100005761033d610884565b60408051918252519081900360200190f35b346100005761031f600160a060020a036004351661088a565b005b346100005761033d6108d2565b60408051918252519081900360200190f35b34610000576104db6108d8565b604080519115158252519081900360200190f35b34610000576104db6108e6565b604080519115158252519081900360200190f35b346100005761033d6108f6565b60408051918252519081900360200190f35b34610000576104db6108fc565b604080519115158252519081900360200190f35b346100005761037b610905565b60408051600160a060020a039092168252519081900360200190f35b346100005761031f610914565b005b60006105948383610937565b151561059f57610000565b508181015b92915050565b60005433600160a060020a039081169116146105c557610000565b6006544210156105d457610000565b600854604080517f6410c41a0000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921691636410c41a9160048082019260009290919082900301818387803b156100005760325a03f115610000575050505b5b5b565b600a5481565b60065481565b600854600160a060020a031681565b600b6020526000908152604090205481565b60015481565b60055481565b60065442101561068657610000565b600154600554106106da57600c805460ff19166001179055600554600354604051600160a060020a03909116907f655cc366c2a16e8b3fe61a1d71b77613e15ab137cd4e476fc18ce3b2c4e8471190600090a35b6008805460a060020a60ff02191660a060020a179055600c5460ff1615156107055761070533610945565b5b60005433600160a060020a0390811691161480156107265750600c5460ff165b1561031d5760646050600160a060020a0330163102046009819055600354604051600160a060020a039091169180156108fc02916000818181858888f19350505050156108015760095460035460405160009291600160a060020a0316906000805160206109df833981519152908490a4600160a060020a0330811631600a81905560045460405192169181156108fc0291906000818181858888f1935050505015156107d257610000565b600a5460045460405160009291600160a060020a0316906000805160206109df833981519152908490a461031d565b600c805460ff191690555b5b5b5b565b600054600160a060020a031681565b600354600160a060020a031681565b60005433600160a060020a0390811691161461084a57610000565b6008805460a060020a60ff02191660a060020a83151590810291909117909155600c805461ff0019166101009092029190911790555b5b50565b60075481565b60005433600160a060020a039081169116146108a557610000565b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60025481565b600c54610100900460ff1681565b60085460a060020a900460ff1681565b60095481565b600c5460ff1681565b600454600160a060020a031681565b600c54610100900460ff16151561092a57610000565b61031d33610945565b5b5b565b808201829010155b92915050565b600160a060020a0381166000908152600b60205260408120805490829055908111156109d857604051600160a060020a038316908290600081818185876185025a03f192505050156109bc576040516000908290600160a060020a038516906000805160206109df833981519152908490a46109d8565b600160a060020a0382166000908152600b602052604090208190555b5b5b50505600c6c8cdc73e475586adbde0de9cf617d7015acc6e38598292ea9033a73dbc868ca165627a7a72305820840db9a355204fd8e6b3a2d0eb20d46031e2bf0e99f97799478d259bee6882210029

    Constructor Arguments (ABI-encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000024c3235558572cff8054b5a419251d3b0d43e91b000000000000000000000000a86a60d53e6f474e049be54824551bb99f05adee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000c5a1443d41ea9a694a8ebd999b9bced08cf4ca90

-----Decoded View---------------
Found 5 constructor arguments :
Arg [0] : 00000000000000000000000024c3235558572cff8054b5a419251d3b0d43e91b
Arg [1] : 000000000000000000000000a86a60d53e6f474e049be54824551bb99f05adee
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [4] : 000000000000000000000000c5a1443d41ea9a694a8ebd999b9bced08cf4ca90


   Swarm Source:
bzzr://840db9a355204fd8e6b3a2d0eb20d46031e2bf0e99f97799478d259bee688221

 

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.