Skip to content

Instantly share code, notes, and snippets.

@MaryKuz
Created March 27, 2019 13:29
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 MaryKuz/63bfedd6f0c4356a65b5741f3f9816b7 to your computer and use it in GitHub Desktop.
Save MaryKuz/63bfedd6f0c4356a65b5741f3f9816b7 to your computer and use it in GitHub Desktop.
Stop a contract from executing
function transfer(address _to, uint256 _value) {
/* Check if sender has balance and for overflows */
require(balanceOf[msg.sender] >= _value && balanceOf[_to] + _value >= balanceOf[_to]);
/* Add and subtract new balances */
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment