set gas price to external contract

This commit is contained in:
mingda
2020-11-11 16:42:00 +08:00
parent 4d9804b373
commit 39e21342a6
9 changed files with 59 additions and 9 deletions

View 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_;
}
}