//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.18; contract CFunding { struct Funder { address funder; uint256 amount; } struct Project { address owner; uint256 currentFunds; uint32 fundingGoal; uint64 endTimeStamp; Funder[] funders; } mapping(uint32 => Project) data; function fund(uint32 id) public payable { if (now > data[id].endTimeStamp) revert(); data[id].currentFunds += msg.value; if (data[id].currentFunds > data[id].fundingGoal) payout(id); return; } function startProject(uint32 fundingGoal, uint64 endTime, uint32 id) public { data[id].owner = msg.sender; data[id].endTimeStamp = endTime; data[id].fundingGoal = fundingGoal; data[id].currentFunds = 0; } function payout(uint32 id) internal { data[id].currentFunds = 0; } }
0.4.18