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

set tx gas price #12

Merged
merged 1 commit into from
Feb 2, 2024
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
9 changes: 9 additions & 0 deletions contracts/ZkLink.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ contract ZkLink is IZkLink, IMailbox, IAdmin, OwnableUpgradeable, UUPSUpgradeabl
event InitGateway(IL2Gateway gateway);
/// @notice Contract's permit status changed
event ContractAllowStatusUpdate(address contractAddress, bool isPermit);
/// @notice Tx gas price changed
event TxGasPriceUpdate(uint256 oldTxGasPrice, uint256 newTxGasPrice);
/// @notice Validator's status changed
event ValidatorStatusUpdate(address validatorAddress, bool isActive);
/// @notice Fee params for L1->L2 transactions changed
Expand Down Expand Up @@ -107,6 +109,13 @@ contract ZkLink is IZkLink, IMailbox, IAdmin, OwnableUpgradeable, UUPSUpgradeabl
emit ContractAllowStatusUpdate(_contractAddress, _permitted);
}

/// @dev Update the tx gas price
function setTxGasPrice(uint256 _newTxGasPrice) external onlyOwner {
uint256 oldTxGasPrice = txGasPrice;
txGasPrice = _newTxGasPrice;
emit TxGasPriceUpdate(oldTxGasPrice, _newTxGasPrice);
}

function setValidator(address _validator, bool _active) external onlyGateway {
validators[_validator] = _active;
emit ValidatorStatusUpdate(_validator, _active);
Expand Down
Loading