rhinestonewtf / modulekit

Development Kit for building Smart Account Modules
https://docs.rhinestone.wtf/modulekit/
53 stars 29 forks source link

Uniswap helper lib: add swap to/from native token #75

Open kopy-kat opened 6 months ago

kopy-kat commented 6 months ago

Currently, the helper lib only easily supports ERC20-ERC20 swaps but should also support ETH-ERC20 or ERC20-ETH swaps

kanthgithub commented 5 months ago

started working on this issue, will make a PR soon with changes native <-> ERC20 swap calls

@kopy-kat @zeroknots

kanthgithub commented 5 months ago

also enhancing approveAndSwap to support

  1. swapExactInput
  2. swapExactOutput

at moment it does approve followed by swapExactInoutSingle

  1. build the execution object -> approve the spending on tokenIn to SWAPROUTER_ADDRESS
  2. build the execution object -> perform swapExactInputSingle

we can support all scenarios here:

  1. swapExactInputSingle
  2. swapExactOutputSingle