Skip to content

Instantly share code, notes, and snippets.

@sepisoltani
Created October 6, 2021 14:56
Show Gist options
  • Save sepisoltani/035cfa13bb60f6b58c6a4e35f2fb4cdc to your computer and use it in GitHub Desktop.
Save sepisoltani/035cfa13bb60f6b58c6a4e35f2fb4cdc to your computer and use it in GitHub Desktop.
contract Example{
// declare the event
event IntegersAdded(uint x, uint y, uint result);
function add(uint _x, uint _y) public returns (uint) {
uint result = _x + _y;
// fire an event to let the app know the function was called:
emit IntegersAdded(_x, _y, result);
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment