Created
January 30, 2022 09:07
-
-
Save kennethhutw/72787a51fca5187cdc24263b9eb1ed32 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.8.0; | |
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; | |
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; | |
contract Params is Initializable,OwnableUpgradeable { | |
function initialize()public initializer{ | |
__Context_init_unchained(); | |
__Ownable_init_unchained(); | |
} | |
mapping(string => uint256) private uint256Params; | |
event Uint256ParamSetted(string indexed _key,uint256 _value); | |
function SetUint256Param(string memory _key,uint256 _value) external onlyOwner{ | |
uint256Params[_key] = _value; | |
emit Uint256ParamSetted(_key,_value); | |
} | |
function GetUint256Param(string memory _key)public view returns(uint256){ | |
return uint256Params[_key]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment