Skip to content

Instantly share code, notes, and snippets.

@jacksonng77
Last active July 31, 2018 04:34
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 jacksonng77/7123d4999d7ca360004d18cbc525a5c6 to your computer and use it in GitHub Desktop.
Save jacksonng77/7123d4999d7ca360004d18cbc525a5c6 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.18;
contract underscore {
uint public a;
constructor() public {
a = 10;
}
modifier conditionalChangeAtoThirty() {
_;
if (a == 20){
a = 30;
}
}
function changeaToTwenty()
public
conditionalChangeAtoThirty
{
a = 20;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment