Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap and Unwrap does not work for me #8

Open
davidedaji opened this issue Mar 2, 2025 · 0 comments
Open

Swap and Unwrap does not work for me #8

davidedaji opened this issue Mar 2, 2025 · 0 comments

Comments

@davidedaji
Copy link

to = router.address # router here, eoa address in unwrap
amount = 1 * 10 ** 4
slippage = 0
FEE = 10000
path = [TOKEN_ADDRESS, WETH_ADDRESS]
from_eoa = True
unwrap_calldata = encode(['address', 'uint256'], [eoa.address, slippage])
v2_calldata = encode(['address', 'uint256', 'uint256', 'address[]', 'bool'], [to, amount, slippage, path, from_eoa])
deadline = 2*10**10

approve_permit = token.functions.approve(PERMIT_ADDRESS, amount)
approve_router = permit.functions.approve(TOKEN_ADDRESS, ROUTER_ADDRESS, amount, deadline)

I don't know why
unwrap_calldata = encode(['address', 'uint256'], [eoa.address, slippage]) this one accept only slippage = 0; but it does not unwrap and I receive weth anyway

do you have any clue?
thanks a lot

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

No branches or pull requests

1 participant