tokenlon-contracts icon indicating copy to clipboard operation
tokenlon-contracts copied to clipboard

Fix v6.0.1

Open alex0207s opened this issue 1 year ago • 3 comments

  • fix typo in RFQ contract
  • change handling logic for makerToken as ETH in RFQ contract
  • add two parameter to Swap event in GS contract

This PR primarily aims to adjust the handling logic for makerToken as ETH in the RFQ contract:

Prior to this PR, when makerToken is ETH, RFQ directly unwraps WETH into ETH. This isn't ideal, especially when RFQ is only a segment of the entire swap path. If RFQ unwraps WETH into ETH directly, it requires the subsequent swapping process to wrap ETH back into WETH, incurring additional steps and costs.

With this PR, we don't unwrap WETH directly. WETH is only unwrapped to ETH when the makerToken is ETH. This could avoid additional steps or costs associated with handling WETH.

alex0207s avatar Apr 30 '24 09:04 alex0207s

fix handling logic for makerToken as ETH in RFQ contract

This does not feel like a "fix". This is changing how we treat WETH as maker token:

  • before this PR: ETH == WETH
    • No ETH as maker token allowed; WETH as maker token means ETH as maker token, we converts it to ETH and send it to recipient
  • after this PR: ETH != WETH
    • WETH as maker token is the same as other ERC20 tokens, we will not convert it to ETH anymore; ETH as maker token means we will convert WETH to ETH and send it to recipient

NIC619 avatar May 02 '24 04:05 NIC619

Please add a readme or a natspec/comment for how we handle different maker tokens, to help others better understand how it works.

In RFQ,
- if maker token is ETH, ...
- if maker token is WETH, ...
- if maker token is normal ERC20, ...

NIC619 avatar May 02 '24 04:05 NIC619