.callStatic() doesn't support Uniswap Router #2465
Unanswered
nikokonovalov
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have created a test project for the purpose of this question for testing a simple swap using Uniswap Router.
My aim is to simply test the transaction before it is actually sent, so I'm trying to use the
.callStatic()
methodFor the sake of this question I created a simple repo, you can install it with
npm i
,replace the
Infura key
and put anyrandom private key
you like and then just runnode index.js
https://github.com/niko534/callStaticTest
If you cloned the repo and tried to run it, you will see that the transaction is executing well, you will receive the recipe as you should!
My problem comes when I'm trying to replace the same transaction with
.callStatic
, on line 78 replacewith:
I'm getting an error:
this is the implementation for the router function I'm trying to interact with:
link to source code:
https://etherscan.io/address/0x7a250d5630b4cf539739df2c5dacb4c659f2488d#code
I have tried to run this code with a different contract and If I try to call a simple approve on the floki erc20 contract for example, it works!
Any ideas on what the reason could be for that error?
####Update
I run it directly with Infura and it works, so it seems like its a problem with ganache-cli fork, any suggestions are welcome
Beta Was this translation helpful? Give feedback.
All reactions