set gas price to external contract
This commit is contained in:
29
contracts/lib/GasPriceSource.sol
Normal file
29
contracts/lib/GasPriceSource.sol
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
|
||||
Copyright 2020 DODO ZOO.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
*/
|
||||
|
||||
pragma solidity 0.6.9;
|
||||
pragma experimental ABIEncoderV2;
|
||||
|
||||
import {Ownable} from "./Ownable.sol";
|
||||
|
||||
interface IGasPriceSource {
|
||||
function setGasPrice(uint256) external;
|
||||
|
||||
function getGasPrice() external view returns (uint256);
|
||||
}
|
||||
|
||||
contract GasPriceSource is IGasPriceSource, Ownable {
|
||||
uint256 public _GAS_PRICE_;
|
||||
|
||||
function setGasPrice(uint256 gasPrice) external override {
|
||||
_GAS_PRICE_ = gasPrice;
|
||||
}
|
||||
|
||||
function getGasPrice() external override view returns (uint256) {
|
||||
return _GAS_PRICE_;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user