-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Call a function at a specific block number #226
Comments
To do that currently you need to use the provider directly, but I will add that feature since it is quite useful. Keep in mind that a pruning node may not be able to respond correctly to blocks over 1024 blocks old. To do it manually, for now:
I will add it to the Contract object this weekend though to the v4 branch, so then it can be overridden like normal contract overrides:
Thanks! :) |
The key chosen for contract overrides is |
This feature is now available in Thanks! :) |
Hi @ricmoo - did you ever add the documentation for this? I can't see it. |
The documentation for v5 is currently only on my laptop. I’ll be working on it while on the plane to NY for ETHNewYork shortly. :) |
Oh! I think I confused this with another issue. I will check on the v4 docs too. |
Just spent 2 hours on this. Here is a detailed example for whom stumbled this issue without knowing exactly what to do next. ethers.js@5.6.9 |
@ricmoo is this behavior the same for ethers v6? |
First off, thanks for ethers, it's great!
I'm trying to do a balance snapshot and I'm wondering if there's an equivalent to Web3's ability to pass in a block number when doing a function call like they do here, e.g.
Is that something we can do with ethers? I couldn't find anything about it in the documentation, and looking through the code I'm not sure this is handled.
The text was updated successfully, but these errors were encountered: