diff options
Diffstat (limited to 'examples/counter/counter.sol')
-rw-r--r-- | examples/counter/counter.sol | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/counter/counter.sol b/examples/counter/counter.sol new file mode 100644 index 0000000..c05bf23 --- /dev/null +++ b/examples/counter/counter.sol @@ -0,0 +1,14 @@ +pragma solidity ^0.5.10; + +contract Counter { + uint256 x; + + constructor() public { + x = 42; + } + + function add(uint256 y) public returns (uint256) { + x = x + y; + return x; + } +} |