Skip to content

Instantly share code, notes, and snippets.

@cleanunicorn
Created April 12, 2018 15:05
Show Gist options
  • Save cleanunicorn/500e53b86825c391b9d7947cf0c24d00 to your computer and use it in GitHub Desktop.
Save cleanunicorn/500e53b86825c391b9d7947cf0c24d00 to your computer and use it in GitHub Desktop.
Emit events
pragma solidity ^0.4.21;
contract ShapeCalculator{
function rectangle(uint256 w, uint256 h) public returns (uint256 s, uint256 p) {
//print value of w and h
emit Width(w);
emit Height(h);
s = w * h;
p = 2 * (w + h);
}
event Width(uint256 w);
event Height(uint256 h);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment