Skip to content

Instantly share code, notes, and snippets.

@bartubozkurt
Created February 2, 2023 11:42
Show Gist options
  • Save bartubozkurt/0fad831a96cc0f0e769990bfebb6f21d to your computer and use it in GitHub Desktop.
Save bartubozkurt/0fad831a96cc0f0e769990bfebb6f21d to your computer and use it in GitHub Desktop.
/* Bad */
contract Bad{
function fund_reached() public returns(bool){
return this.balance == 100 ether; // strict equalities
}
}
/* Better */
contract Good{
function fund_reached() public returns(bool){
return this.balance >= 100 ether; // not strict equalities
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment