Skip to content

Commit

Permalink
feat: deprecate chainGasAmount
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Nov 11, 2024
1 parent 4962a96 commit 87723a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
11 changes: 3 additions & 8 deletions packages/contracts-rfq/contracts/AdminV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ contract AdminV2 is AccessControlEnumerable, IAdminV2, IAdminV2Errors {
/// @notice Delay for a transaction after which it could be permisionlessly cancelled
uint256 public cancelDelay;

/// @notice Chain gas amount to forward as rebate if requested
uint256 public chainGasAmount;
/// @notice This is deprecated and should not be used.
/// @dev Use ZapNative V2 requests instead.
uint256 public immutable chainGasAmount = 0;

constructor(address _owner) {
_grantRole(DEFAULT_ADMIN_ROLE, _owner);
Expand All @@ -57,12 +58,6 @@ contract AdminV2 is AccessControlEnumerable, IAdminV2, IAdminV2Errors {
emit FeesSwept(token, recipient, feeAmount);
}

Check notice

Code scanning / Slither

Reentrancy vulnerabilities Low


function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {
uint256 oldChainGasAmount = chainGasAmount;
chainGasAmount = newChainGasAmount;
emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);
}

/// @notice Internal function to set the cancel delay. Security checks are performed outside of this function.
function _setCancelDelay(uint256 newCancelDelay) private {
if (newCancelDelay < MIN_CANCEL_DELAY) revert CancelDelayBelowMin();
Expand Down
4 changes: 0 additions & 4 deletions packages/contracts-rfq/contracts/interfaces/IAdminV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ interface IAdminV2 {
event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);
event FeesSwept(address token, address recipient, uint256 amount);

event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);

function setCancelDelay(uint256 newCancelDelay) external;

function setProtocolFeeRate(uint256 newFeeRate) external;

function sweepProtocolFees(address token, address recipient) external;

function setChainGasAmount(uint256 newChainGasAmount) external;
}

0 comments on commit 87723a5

Please sign in to comment.