aboutsummaryrefslogtreecommitdiff
path: root/examples/counter/counter.sol
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-08-15 18:49:42 -0400
committerDeterminant <[email protected]>2019-08-15 18:49:42 -0400
commitff58d84f81d584646ca3f8fe00493cdcec8239ed (patch)
tree4b061596cc4c66c814e013aa91e74a27d9d0a9eb /examples/counter/counter.sol
parent669168d32a534c1054f9df659b3199f7b6da0d21 (diff)
add smart contract example
Diffstat (limited to 'examples/counter/counter.sol')
-rw-r--r--examples/counter/counter.sol14
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;
+ }
+}