Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: emit events in constructor (0xM Q-01) #55

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions contracts/GelatoManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ contract GelatoManager is AutomateTaskCreator, Governed {
address _governor,
uint256 _maxGasPrice
) AutomateTaskCreator(_automate, _governor) Governed(_governor) {
maxGasPrice = _maxGasPrice;
_setMaxGasPrice(_maxGasPrice);
}

/**
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}
}