diff --git a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol index 83b42bee66..20d993c645 100644 --- a/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol +++ b/auxiliary/OpGasPriceOracle/contracts/OpGasPriceOracle.sol @@ -43,6 +43,11 @@ contract OpGasPriceOracle is IExternalNode { uint256 executionKind; } + /** + * @notice thrown when the execution kind is invalid + */ + error OpGasPriceOracleInvalidExecutionKind(); + constructor(address _ovmGasPriceOracleAddress) { // Addresses configuration ovmGasPriceOracleAddress = _ovmGasPriceOracleAddress; @@ -213,7 +218,7 @@ contract OpGasPriceOracle is IExternalNode { gasUnitsL2 = runtimeParams.l2LiquidateGasUnits; unsignedTxSize = runtimeParams.liquidateTxSize; } else { - revert("Invalid execution kind"); + revert OpGasPriceOracleInvalidExecutionKind(); } } diff --git a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol index b06e92f3e4..f68048466d 100644 --- a/markets/perps-market/contracts/mocks/MockGasPriceNode.sol +++ b/markets/perps-market/contracts/mocks/MockGasPriceNode.sol @@ -14,7 +14,7 @@ contract MockGasPriceNode is IExternalNode { uint256 public flagCost; uint256 public liquidateCost; - constructor() {} + error InvalidExecutionKind(); function setCosts(uint256 _settlementCost, uint256 _flagCost, uint256 _liquidateCost) external { settlementCost = _settlementCost; @@ -50,7 +50,7 @@ contract MockGasPriceNode is IExternalNode { } else if (executionKind == KIND_LIQUIDATE) { theOutput.price = int256(liquidateCost); } else { - revert("Invalid execution kind"); + revert InvalidExecutionKind(); } return theOutput; diff --git a/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol b/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol index 569b6d2c92..158d71c0b9 100644 --- a/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol +++ b/markets/perps-market/contracts/modules/AsyncOrderCancelModule.sol @@ -60,7 +60,7 @@ contract AsyncOrderCancelModule is IAsyncOrderCancelModule, IMarketEvents, IAcco runtime.accountId = asyncOrder.request.accountId; runtime.marketId = asyncOrder.request.marketId; runtime.acceptablePrice = asyncOrder.request.acceptablePrice; - runtime.settlementReward = settlementStrategy.settlementReward; + runtime.settlementReward = AsyncOrder.settlementRewardCost(settlementStrategy); runtime.sizeDelta = asyncOrder.request.sizeDelta; // check if account is flagged