简体   繁体   中英

Quickswap Uniswap smartcontracts using

I am trying to integrate Quickswap/Uniswap into my smart contract and would like to make use of the swapTokensForExactTokens .

There is a path parameter which is an array of addresses as to how the tokens will be exchanged prior to the final conversion. However, from my understanding Uniswap auto-generates the path and passes it to the function. All tutorials that I have found so far have the developer hardcoding the path. Can you give me some insight as to how to auto-generate the path as Uniswap does for pairs that don't exist?

Thank you!

Liquidity path is an array with 2 token addresses: ["0xa1afffe3f4d611d252010e3eaf6f4d77088b0cd7", "0xdcb01cc464238396e213a6fdd933e36796eaff9f"] . It will automatically check if there is a path or not.

If there isn't a path, you can create it by usingfunction createPair(address tokenA, address tokenB) external returns (address pair);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM