Created
February 28, 2019 19:36
-
-
Save vsaraph/42a75d6d18f35331368f414ea76fde39 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.1; | |
contract Stack { | |
int256[] stack; | |
function push(int256 data) public { | |
stack.push(data); | |
} | |
function pop() public returns (int256 data) { | |
data = stack[stack.length - 1]; | |
stack.length -= 1; | |
} | |
function incTop() public { | |
int256 data = pop(); | |
data += 28; | |
push(data); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment