Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Update TODO comment with correction #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update TODO comment with correction #144

wants to merge 1 commit into from

Conversation

hensha256
Copy link
Collaborator

@hensha256 hensha256 commented Aug 17, 2023

Did a gas test to check which is cheaper between sending the WETH to the Pair at the time you wrap, or in the V2 payment. Transferring at the time of V2 function is cheapest.

You cannot wrap WETH into a specified recipient address so in either scenario it always has to go

  • user -eth-> router
  • router wraps eth into weth INTO ROUTER
  • router -weth-> pair

the only change is when the weth is sent to the pair, and this is the cheapest.

I think this is because transferring the WETH at the time of wrapping increases the number of non-0 calldata bytes dramatically.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant