Skip to content
Verified contractPartial

CrowdFunding

Address0x8e94b18b73e2b4c738917bb5bca969b43d66045d
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.1.3

 

Same code

1 more contract

 

Details

Compiler
solc 0.1.3+commit.028f561d
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: no, runtime code: yes
Verified on Sourcify
Created in block
258,270
Creation transaction
0x8ffc1f3bfd…0cbc08e81b

CrowdFunding.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
contract CrowdFunding {
    struct Funder {
        address addr;
        uint amount;
    }
    struct Campaign {
        address beneficiary;
        uint fundingGoal;
        uint numFunders;
        uint amount;
        mapping (uint => Funder) funders;
    }
    uint numCampaigns;
    mapping (uint => Campaign) campaigns;
    function newCampaign(address beneficiary, uint goal) returns (uint campaignID) {
        campaignID = numCampaigns++;
        campaigns[campaignID].beneficiary = beneficiary;
        campaigns[campaignID].fundingGoal = goal;
    }
    function contribute(uint campaignID) {
        Campaign c = campaigns[campaignID];
        uint x0; // unused: added so solc reproduces the deployed stack layout
        Funder f = c.funders[c.numFunders++];
        f.addr = msg.sender;
        f.amount = msg.value;
        c.amount += msg.value;
    }
    function checkGoalReached(uint campaignID) returns (bool reached) {
        Campaign c = campaigns[campaignID];
        uint x2; // unused: added so solc reproduces the deployed stack layout
        if (c.amount < c.fundingGoal)
            return false;
        c.beneficiary.send(c.amount);
        c.amount = 0;
        return true;
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.