Created
February 2, 2023 10:56
-
-
Save bartubozkurt/b2bba3d2338b5321c137f5fe805659b3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* 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