2020-11-02 10:51:49 +00:00
|
|
|
// SPDX-License-Identifier: UNLICENSED
|
|
|
|
pragma solidity 0.7.4;
|
|
|
|
|
|
|
|
import {GELATO_GAS_PRICE_ORACLE} from "../../constants/CGelato.sol";
|
|
|
|
import {mul} from "../../vendor/DSMath.sol";
|
|
|
|
|
|
|
|
function _getGelatoGasPrice() view returns (uint256) {
|
2020-11-26 14:31:14 +00:00
|
|
|
int256 oracleGasPrice = GELATO_GAS_PRICE_ORACLE.latestAnswer();
|
|
|
|
if (oracleGasPrice <= 0) revert("_getGelatoGasPrice:0orBelow");
|
|
|
|
return uint256(oracleGasPrice);
|
2020-11-02 10:51:49 +00:00
|
|
|
}
|
|
|
|
|
2020-11-27 12:38:13 +00:00
|
|
|
function _getGelatoExecutorFees(uint256 _gas) view returns (uint256) {
|
2020-11-02 10:51:49 +00:00
|
|
|
return mul(_gas, _getGelatoGasPrice());
|
|
|
|
}
|