-
-
Save CinnamonGrrrl/3a293a278e8ed0e31fc6547dd7d0eecd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// contracts/Funding.sol | |
pragma solidity ^0.4.17; | |
contract Funding { | |
uint public raised; | |
uint public finishesAt; | |
address public owner; | |
mapping(address => uint) public balances; | |
function Funding(uint _duration) public { | |
owner = msg.sender; | |
finishesAt = now + _duration; | |
} | |
function isFinished() public view returns (bool) { | |
return finishesAt <= now; | |
} | |
function donate() public payable { | |
balances[msg.sender] += msg.value; | |
raised += msg.value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment