Skip to content

Commit

Permalink
fix: comments (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
marktoda authored Feb 27, 2024
1 parent 476d57b commit abd7a0b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/reactors/V2DutchOrderReactor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import {SignedOrder, ResolvedOrder} from "../base/ReactorStructs.sol";
/// @dev V2 orders must be cosigned by the specified cosigner to override timings and starting values
/// @dev resolution behavior:
/// - If cosignature is invalid or not from specified cosigner, revert
/// - If inputOverride is 0, then use inner inputs
/// - If inputOverride is nonzero, then ensure it is less than specified input and replace startAmount
/// - For each DutchOutput:
/// - If override is 0, then use inner output
/// - If override is nonzero, then ensure it is greater than specified output and replace startAmount
/// - If inputAmount is 0, then use baseInput
/// - If inputAmount is nonzero, then ensure it is less than specified baseOutput and replace startAmount
/// - For each outputAmount:
/// - If amount is 0, then use baseOutput
/// - If amount is nonzero, then ensure it is greater than specified baseOutput and replace startAmount
contract V2DutchOrderReactor is BaseReactor {
using Permit2Lib for ResolvedOrder;
using V2DutchOrderLib for V2DutchOrder;
Expand All @@ -34,10 +34,10 @@ contract V2DutchOrderReactor is BaseReactor {
/// @notice thrown when an order's cosignature does not match the expected cosigner
error InvalidCosignature();

/// @notice thrown when an order's input override is greater than the specified
/// @notice thrown when an order's cosigner input is greater than the specified
error InvalidCosignerInput();

/// @notice thrown when an order's output override is less than the specified
/// @notice thrown when an order's cosigner output is less than the specified
error InvalidCosignerOutput();

constructor(IPermit2 _permit2, address _protocolFeeOwner) BaseReactor(_permit2, _protocolFeeOwner) {}
Expand Down Expand Up @@ -96,12 +96,12 @@ contract V2DutchOrderReactor is BaseReactor {
}
for (uint256 i = 0; i < order.baseOutputs.length; i++) {
DutchOutput memory output = order.baseOutputs[i];
uint256 outputOverride = order.cosignerData.outputAmounts[i];
if (outputOverride != 0) {
if (outputOverride < output.startAmount) {
uint256 outputAmount = order.cosignerData.outputAmounts[i];
if (outputAmount != 0) {
if (outputAmount < output.startAmount) {
revert InvalidCosignerOutput();
}
output.startAmount = outputOverride;
output.startAmount = outputAmount;
}
}
}
Expand Down

0 comments on commit abd7a0b

Please sign in to comment.