Sponsored Link:   BubbleTone - Blockchain in Telecom, directly connecting mobile operators and users globally, launches its unique ICO!
Contract Overview
ETH Balance: 0 Ether
ETH USD Value: $0
No Of Transactions: 11 txns
  Latest 11 txns

TxHash Age From To Value [TxFee]
0x4cef3ef90e983b421fe4cd9be00e7b2670ea22c33ffa76ad212dcf95dec8c5d983 days 18 hrs ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.002 Ether0.0000042092
0xf17b4bfa40d83a637f70a178e8178ceac375d416902cd997db5b15dfcf0437a183 days 18 hrs ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.001 Ether0.000004204
0x043c71f36b74de6674e47fe4dc68bf02e153520e3230a1089d8d3e934b2d7ecd86 days 23 hrs ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.001 Ether0.000021046
0x8df6b4b51b9e40cba4782cc7358844ce80fd128b07e493e3ad21aca1fa4b5e3588 days 1 hr ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.0003 Ether0.000021046
0x4f8fb1e5abd07d7f7053e5379dca2c187b6868e96f3a5a90f870d169fce7021189 days 1 hr ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.0003 Ether0.000021046
0xa5646acb0c5ccd003b3deba09509b03d084210c04f6804a5610f0499198799b290 days 14 mins ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.001 Ether0.000021046
0x63f252e51dcfdf15850d1b27ada5ae26a2f141d19416b3cf92fc8918b4f7197c92 days 1 hr ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.0004 Ether0.000021046
0x7239615371d5f5406758379d40aeb86de96499a82b5f64ae29c0972800398c8093 days 1 hr ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.001 Ether0.000021046
0x08294d39a2e3287ca5ea2a930c6f63098a7d11cf2d440b43521ad791bb7cacd393 days 3 hrs ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.0001 Ether0.00003177946
0xf35cab1ea089d91355cbbddc7624de6b517c54065cfb878326d3ef26417d61e493 days 3 hrs ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN   0xefe2481c6801ae124925db7fabcba71dc6da4cba0.00002 Ether0.00000231506
0xbb094f3ff5548e127da8028375d24cb474a932d442cdd4f4caac9c36014341bd112 days 13 hrs ago0xb490c8668f563f9d393203f47a7c2ccdd415f069  IN    Contract Creation0 Ether0.006060747
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Contract Source Code Verified (Exact match)
Contract Name: XG4KCrowdFunding
Compiler Version: v0.4.19+commit.c4cbbb05
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.4;
contract XG4KCrowdFunding {
    // data structure to hold information about campaign contributors
    struct Funder {
        address addr;
        uint amount;
    }
    // Campaign data structure
    struct Campaign {
        address beneficiary;
        uint fundingGoal;
        uint numFunders;
        uint amount;
        uint deadline;
        mapping (uint => Funder) funders;
    }
    //Declares a state variable 'numCampaigns'
    uint numCampaigns;
    //Creates a mapping of Campaign datatypes
    mapping (uint => Campaign) campaigns;
    //first function sets up a new campaign
    function newCampaign(address beneficiary, uint goal, uint deadline) returns (uint campaignID) {
        campaignID = numCampaigns++; // campaignID is return variable
        Campaign c = campaigns[campaignID]; // assigns reference
        c.beneficiary = beneficiary;
        c.fundingGoal = goal;
        c.deadline = block.number + deadline;
    }
    //function to contributes to the campaign
    function contribute(uint campaignID) {
        Campaign c = campaigns[campaignID];
        Funder f = c.funders[c.numFunders++];
        f.addr = msg.sender;
        f.amount = msg.value;
        c.amount += f.amount;
    }
    // checks if the goal or time limit has been reached and ends the campaign
    function checkGoalReached(uint campaignID) returns (bool reached) {
        Campaign c = campaigns[campaignID];
        if (c.amount >= c.fundingGoal){
            c.beneficiary.send(c.amount);
            clean(campaignID);
        	return true;
        }
        if (c.deadline <= block.number){
            uint j = 0;
            uint n = c.numFunders;
            while (j <= n){
                c.funders[j].addr.send(c.funders[j].amount);
                j++;
            }
            clean(campaignID);
            return true;
        }
        return false;
    }
    function clean(uint id) private{
    	Campaign c = campaigns[id];
    	uint i = 0;
    	uint n = c.numFunders;
    	c.amount = 0;
        c.beneficiary = 0;
        c.fundingGoal = 0;
        c.deadline = 0;
        c.numFunders = 0;
        while (i <= n){
            c.funders[i].addr = 0;
            c.funders[i].amount = 0;
            i++;
        }
    }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"campaignID","type":"uint256"}],"name":"checkGoalReached","outputs":[{"name":"reached","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"campaignID","type":"uint256"}],"name":"contribute","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"beneficiary","type":"address"},{"name":"goal","type":"uint256"},{"name":"deadline","type":"uint256"}],"name":"newCampaign","outputs":[{"name":"campaignID","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"}]

  Contract Creation Code Switch To Opcodes View
6060604052341561000f57600080fd5b6103768061001e6000396000f3006060604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416635b2329d4811461005b578063c1cbbca714610085578063df175e9b1461009d575b600080fd5b341561006657600080fd5b6100716004356100e1565b604051901515815260200160405180910390f35b341561009057600080fd5b61009b6004356101e0565b005b34156100a857600080fd5b6100cf73ffffffffffffffffffffffffffffffffffffffff60043516602435604435610250565b60405190815260200160405180910390f35b600081815260016020819052604082209081015460038201548391829110610152578254600384015473ffffffffffffffffffffffffffffffffffffffff9091169080156108fc0290604051600060405180830381858888f1935050505050610149856102b5565b600193506101d8565b60048301544390116101d357505060028101546000905b8082116101ca57600082815260058401602052604090819020805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169181156108fc02919051600060405180830381858888f1505060019094019350610169915050565b610149856102b5565b600093505b505050919050565b6000908152600160208181526040808420600281018054808601909155855260058101909252909220805473ffffffffffffffffffffffffffffffffffffffff19163373ffffffffffffffffffffffffffffffffffffffff16178155349101819055600390910180549091019055565b600080546001808201835581835260208190526040909220805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff9690961695909517855590840192909255430160049092019190915590565b6000818152600160208190526040822060028101805460038301859055825473ffffffffffffffffffffffffffffffffffffffff191683559282018490556004820184905583905591905b8082116103445760008281526005840160205260408120805473ffffffffffffffffffffffffffffffffffffffff1916815560019081019190915590910190610300565b505050505600a165627a7a72305820950cf94f46e6c688a77ac798163b11d2b477adf67af1061185ca8fd50929fcb60029

   Swarm Source:
bzzr://950cf94f46e6c688a77ac798163b11d2b477adf67af1061185ca8fd50929fcb6

 

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.