Last active
October 1, 2023 13:10
-
-
Save svanas/104bc3757dedb8f3c8ad70d747f7b620 to your computer and use it in GitHub Desktop.
Increment and decrement operations using Solidity
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: GPL-3.0 | |
pragma solidity ^0.8.0; | |
contract ArithValue { | |
uint number; | |
constructor () { | |
number = 100; | |
} | |
function setNumber(uint value) public { | |
number = value; | |
} | |
function getNumber() public view returns (uint) { | |
return number; | |
} | |
function incrementNumber() public { | |
number = number + 1; | |
} | |
function decrementNumber() public { | |
number = number - 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment