-
Notifications
You must be signed in to change notification settings - Fork 253
/
Copy pathparams.sol
33 lines (24 loc) · 1.01 KB
/
params.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2018 The VeChainThor developers
// Distributed under the GNU Lesser General Public License v3.0 software license, see the accompanying
// file LICENSE or <https://www.gnu.org/licenses/lgpl-3.0.html>
pragma solidity 0.4.24;
/// @title Params to manage governance parameters.
contract Params {
function executor() public view returns(address) {
return ParamsNative(this).native_executor();
}
function set(bytes32 _key, uint256 _value) public {
require(msg.sender == executor(), "builtin: executor required");
ParamsNative(this).native_set(_key, _value);
emit Set(_key, _value);
}
function get(bytes32 _key) public view returns(uint256) {
return ParamsNative(this).native_get(_key);
}
event Set(bytes32 indexed key, uint256 value);
}
contract ParamsNative {
function native_executor() public view returns(address);
function native_set(bytes32 key, uint256 value) public;
function native_get(bytes32 key) public view returns(uint256);
}