diff --git a/contracts/GelatoManager.sol b/contracts/GelatoManager.sol index 574b1d4..06c85b5 100644 --- a/contracts/GelatoManager.sol +++ b/contracts/GelatoManager.sol @@ -75,7 +75,7 @@ contract GelatoManager is AutomateTaskCreator, Governed { address _governor, uint256 _maxGasPrice ) AutomateTaskCreator(_automate, _governor) Governed(_governor) { - maxGasPrice = _maxGasPrice; + _setMaxGasPrice(_maxGasPrice); } /** @@ -102,9 +102,7 @@ contract GelatoManager is AutomateTaskCreator, Governed { * @param newGasPrice The updated value for `maxGasPrice` */ function setMaxGasPrice(uint256 newGasPrice) external onlyGovernor { - if (newGasPrice == 0) revert GasPriceCannotBeZero(); - maxGasPrice = newGasPrice; - emit MaxGasPriceSet(maxGasPrice); + _setMaxGasPrice(newGasPrice); } /** @@ -149,4 +147,14 @@ contract GelatoManager is AutomateTaskCreator, Governed { _cancelTask(taskId); emit ResolverTaskCancelled(taskId); } + + /** + * @notice Sets the maximum gas price for task execution + * @param newGasPrice The updated value for `maxGasPrice` + */ + function _setMaxGasPrice(uint256 newGasPrice) internal { + if (newGasPrice == 0) revert GasPriceCannotBeZero(); + maxGasPrice = newGasPrice; + emit MaxGasPriceSet(maxGasPrice); + } }