Skip to content

Instantly share code, notes, and snippets.

@ShoaibKakal
Created August 20, 2022 13:03
Show Gist options
  • Save ShoaibKakal/692a90a704c985a756f338867299bbb4 to your computer and use it in GitHub Desktop.
Save ShoaibKakal/692a90a704c985a756f338867299bbb4 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;
contract HelloWorld {
uint256 counter = 5;
function add() public { //increases counter by 1
counter++;
}
function subtract() public { //decreases counter by 1
counter--;
}
function getCounter() public view returns (uint256) {
return counter;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment