1inch AggregationRouterV5 中的 swap函数 的data参数具体是如何构造的

swap函数是这样的

/// @notice Performs a swap, delegating all calls encoded in `data` to `executor`. See tests for usage examples
    /// @dev router keeps 1 wei of every token on the contract balance for gas optimisations reasons. This affects first swap of every token by leaving 1 wei on the contract.
    /// @param executor Aggregation executor that executes calls described in `data`
    /// @param desc Swap description
    /// @param permit Should contain valid permit that can be used in `IERC20Permit.permit` calls.
    /// @param data Encoded calls that `caller` should execute in between of swaps
    /// @return returnAmount Resulting token amount
    /// @return spentAmount Source token amount
    function swap(
        IAggregationExecutor executor,
        SwapDescription calldata desc,
        bytes calldata permit,
        bytes calldata data
    )
        external
        payable
        returns (
            uint256 returnAmount,
            uint256 spentAmount
        )
    {

在它的doc和合约中都未能找到data参数的明确解释,希望大佬能帮忙解答下这个问题

请先 登录 后评论

1 个回答

Jeack
请先 登录 后评论
  • 1 关注
  • 0 收藏,2086 浏览
  • Joe 提出于 2023-03-05 10:43