Files
dodo-contractV2/contracts/lib/ExternalValue.sol

36 lines
755 B
Solidity
Raw Normal View History

2020-11-18 17:51:50 +08:00
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
2020-11-22 18:20:09 +08:00
import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
2020-11-18 17:51:50 +08:00
interface IExternalValue {
2020-11-22 18:20:09 +08:00
function init(address owner, uint256 value) external;
function set(uint256 value) external;
2020-11-18 17:51:50 +08:00
function get() external view returns (uint256);
}
2020-11-22 18:20:09 +08:00
contract ExternalValue is InitializableOwnable {
2020-11-18 17:51:50 +08:00
uint256 public _VALUE_;
2020-11-22 18:20:09 +08:00
function init(address owner, uint256 value) external {
initOwner(owner);
_VALUE_ = value;
}
function set(uint256 value) external onlyOwner {
2020-11-18 17:51:50 +08:00
_VALUE_ = value;
}
2020-11-22 18:20:09 +08:00
function get() external view returns (uint256) {
2020-11-18 17:51:50 +08:00
return _VALUE_;
}
}