From d90976a2357d3f1c8ae81477f97a4ef3f0299fce Mon Sep 17 00:00:00 2001 From: Ricardo Airton <58168802+airtoonricardo@users.noreply.github.com> Date: Tue, 2 Jan 2024 17:07:53 +0000 Subject: [PATCH] docs: update dispatcher comments, remove unused permit2payments imports (#7) * docs: issue 51 - dispatcher decodes routes instead of bytes * chore: issue 41 - remove unused permit2payments imports * docs: issue 40 - update placeholder area comment --- contracts/base/Dispatcher.sol | 6 +++--- contracts/modules/Permit2Payments.sol | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contracts/base/Dispatcher.sol b/contracts/base/Dispatcher.sol index c9c4950..9009ef3 100644 --- a/contracts/base/Dispatcher.sol +++ b/contracts/base/Dispatcher.sol @@ -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; @@ -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; @@ -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); } } diff --git a/contracts/modules/Permit2Payments.sol b/contracts/modules/Permit2Payments.sol index c547909..1c56424 100644 --- a/contracts/modules/Permit2Payments.sol +++ b/contracts/modules/Permit2Payments.sol @@ -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