Created
September 17, 2020 17:04
-
-
Save hydai/60c3ffdf4e91c67032a50979e24db8d5 to your computer and use it in GitHub Desktop.
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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.4.22 <0.8.0; | |
contract Calc { | |
int private result; | |
function add(int a, int b) public returns (int c) { | |
result = a + b; | |
c = result; | |
} | |
function min(int a, int b) public returns (int) { | |
result = a - b; | |
return result; | |
} | |
function mul(int a, int b) public returns (int) { | |
result = a * b; | |
return result; | |
} | |
function div(int a, int b) public returns (int) { | |
result = a / b; | |
return result; | |
} | |
function getResult() public view returns (int) { | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment