Created
January 28, 2022 20:20
-
-
Save mjtbkh/fc08563ca5233e43b50a98751e0b9029 to your computer and use it in GitHub Desktop.
A simple smart-contract with 2 methods to read and write a private variable.
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.8.2; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract SimpleStorage is Ownable { | |
uint64 private _storage; | |
function set(uint64 input) public onlyOwner { | |
_storage = input; | |
} | |
function get() public view returns (uint64) { | |
return _storage; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment