Skip to content

Instantly share code, notes, and snippets.

@CinnamonGrrrl
Created March 27, 2018 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CinnamonGrrrl/bd41df495d92cc5f8c3237cf36e120a9 to your computer and use it in GitHub Desktop.
Save CinnamonGrrrl/bd41df495d92cc5f8c3237cf36e120a9 to your computer and use it in GitHub Desktop.
import "./Clock.sol";
contract Funding {
[...]
uint public finishesAt;
Clock clock;
function Funding(uint _duration, address _clockAddress) public {
owner = msg.sender;
clock = Clock(_clockAddress);
finishesAt = clock.getNow() + _duration;
}
function isFinished() public view returns (bool) {
return finishesAt <= clock.getNow();
}
[...]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment