Skip to content

Instantly share code, notes, and snippets.

@bartubozkurt
Created February 2, 2023 10:56
Show Gist options
  • Save bartubozkurt/b2bba3d2338b5321c137f5fe805659b3 to your computer and use it in GitHub Desktop.
Save bartubozkurt/b2bba3d2338b5321c137f5fe805659b3 to your computer and use it in GitHub Desktop.
/* Bad */
contract TimedCrowdsale {
event Finished();
event notFinished();
// Sale should finish exactly at January 1, 2019
function isSaleFinished() private returns (bool) {
return block.timestamp >= 1546300800;
}
function run() public {
if (isSaleFinished()) {
emit Finished();
} else {
emit notFinished();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment