Skip to content

Commit

Permalink
docs: update dispatcher comments, remove unused permit2payments impor…
Browse files Browse the repository at this point in the history
…ts (#7)

* docs: issue 51 - dispatcher decodes routes instead of bytes

* chore: issue 41 - remove unused permit2payments imports

* docs: issue 40 - update placeholder area comment
  • Loading branch information
airtoonricardo authored Jan 2, 2024
1 parent 44ca157 commit d90976a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions contracts/base/Dispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ abstract contract Dispatcher is Payments, V2SwapRouter, V3SwapRouter, Callbacks,
// 0x08 <= command < 0x10
} else {
if (command == Commands.V2_SWAP_EXACT_IN) {
// equivalent: abi.decode(inputs, (address, uint256, uint256, bytes, bool))
// equivalent: abi.decode(inputs, (address, uint256, uint256, Route[], bool))
address recipient;
uint256 amountIn;
uint256 amountOutMin;
Expand All @@ -140,7 +140,7 @@ abstract contract Dispatcher is Payments, V2SwapRouter, V3SwapRouter, Callbacks,
address payer = payerIsUser ? lockedBy : address(this);
v2SwapExactInput(map(recipient), amountIn, amountOutMin, routes, payer);
} else if (command == Commands.V2_SWAP_EXACT_OUT) {
// equivalent: abi.decode(inputs, (address, uint256, uint256, bytes, bool))
// equivalent: abi.decode(inputs, (address, uint256, uint256, Route[], bool))
address recipient;
uint256 amountOut;
uint256 amountInMax;
Expand Down Expand Up @@ -341,7 +341,7 @@ abstract contract Dispatcher is Payments, V2SwapRouter, V3SwapRouter, Callbacks,
}
Payments.approveERC20(token, spender);
} else {
// placeholder area for commands 0x22-0x3f
// placeholder area for commands 0x23-0x3f
revert InvalidCommandType(command);
}
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/modules/Permit2Payments.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ pragma solidity ^0.8.17;
import {IAllowanceTransfer} from 'permit2/src/interfaces/IAllowanceTransfer.sol';
import {SafeCast160} from 'permit2/src/libraries/SafeCast160.sol';
import {Payments} from './Payments.sol';
import {Constants} from '../libraries/Constants.sol';
import {RouterImmutables} from '../base/RouterImmutables.sol';

/// @title Payments through Permit2
/// @notice Performs interactions with Permit2 to transfer tokens
Expand Down

0 comments on commit d90976a

Please sign in to comment.