From ff58d84f81d584646ca3f8fe00493cdcec8239ed Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 15 Aug 2019 18:49:42 -0400 Subject: add smart contract example --- examples/counter/counter.sol | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 examples/counter/counter.sol (limited to 'examples/counter/counter.sol') 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; + } +} -- cgit v1.2.3