0

I am using 1inch swap aggregator smart contract to swap some amount of a token to another one.

As 1inch described here in AggregationRouterV6 contract we can use the function swap as follows:

function swap( contract IAggregationExecutor executor, contract SwapDescription calldata desc, bytes calldata permit, bytes calldata data ) external payable returns (uint256 returnAmount, uint256 spentAmount) 

The second argument desc is of type SwapDescription that describes the swap and is defined as follows:

struct SwapDescription { IERC20 srcToken; IERC20 dstToken; address payable srcReceiver; address payable dstReceiver; uint256 amount; uint256 minReturnAmount; uint256 flags; } 

The fourth parameter data is gotten from 1inch API service mentioned here.

*** The main question is about the first parameter executor. (caller in older versions)

This parameter is an IAggregationExecutor type variable that is the interface of the contract that executes the swap:

interface IAggregationExecutor { function execute(address msgSender) external payable returns(uint256); // 0x4b64e492 } 

Some sample programs uses the main AggregationRouterV6 as the address of the executor contract, but this is incorrect, because there is no function named execute in AggregationRouterV6 contract.

Where can we find the AggregationExecutoe deployed contract address?

P.S: Deployed AggregationRouterV6 contract on BNB smart chain blockchain is:

https://bscscan.com/address/0x111111125421ca6dc452d289314280a0f8842a65#code

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.