-
Notifications
You must be signed in to change notification settings - Fork 151
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
Example trade WETH/USDC fails with STF
error on mainnet fork
#58
Comments
To verify that the approval is correctly done, I wrote a script to check the allowance:
and I see that the swap router allowance is correctly resported:
|
Same thing, I also got an error with @vdamle did you solve the problem? |
@vdamle @69popovvlad I have the same problem. Did you guys solve? |
@animalconcerts
Here is my code below as an example for you:
|
I've been attempting to get the example trade to work using a mainnet fork setup with Anvil, as documented here
As far as I can tell, the example doesn't work with the latest version of the libraries:
The error is always:
Initially, I was seeing an error with
eth_estimateGas
:So I switched to using a pre-defined
gasLimit: 5_000_000
in the Tx.The steps for getting a quote and approving the swap router for token transfers work but the actual swap fails. As a minor detail, I'm not using the UI code but invoking the functions directly like below, so I can run the example from the command line:
I can see that the quote returns valid data:
I'd appreciate any input to troubleshoot this issue. I'd be happy to submit a PR to the docs/example code if there is any change required with the latest version of the v3 SDK.
The text was updated successfully, but these errors were encountered: