question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation doesn't explain accepted contract method "overrides"

See original GitHub issue

The documentation for Contract interaction indicates that an optional overrides can be provided to contract method calls. There is no explanation for what these overrides are, or which ones are supported.

Digging through other issues I find reference to some of these overrides, but without a formal list, a user has no idea what is supported.

For instance I am trying to get blockNumber to work, however there is no documentation telling me how to do this.

Link to documentation that is missing explanation: https://docs.ethers.io/v5/api/contract/contract/#Contract-functionsCall

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mudgencommented, Feb 5, 2021

@ricmoo Thank you for adding the documentation!

1reaction
ricmoocommented, Jan 7, 2021

Sorry Holidays we’re far busier than I expected. I’ve been working on it, it just isn’t published yet.

I’ll give a quick overview here, but there are nuances I need to double check, so there may be some inaccuracies.

Yes, you can pass blockNumber in as an override for constant functions, and function on the callStatic bucket and the populateTransaction bucket. But, not all backends support this; Etherscan does not allow block tags to call or estimateGas, INFURA only allows it for their paid tier, on Alchemy it will chew up your compute credits faster and if you are connecting to Geth or Parity, your node must be syncing in Archive mode. For nodes in archive mode, there is also a configurable depth which is how far back in time to maintain the archive-ness; in this case your blockNumber must be within its safe range.

Does that all make sense? I’ll be experimenting today and hopefully get the new flatworm version out along with the documentation updates. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Contracts — Solidity 0.8.17 documentation
When Ether is sent directly to a contract (without a function call, i.e. sender uses send or transfer ) but the receiving contract...
Read more >
Why do I need to override the equals and hashCode methods ...
You must override hashCode() in every class that overrides equals(). Failure to do so will result in a violation of the general contract...
Read more >
Solidity override vs. virtual functions | by Kseniya Lifanova
Solidity is an object-oriented programming language that supports multiple inheritances. You can inherit from a base contract and then override ...
Read more >
Allow no phpdoc for methods that override base class
FYI, after agreement this has been decided about overridden methods: 1) no documentation IS allowed. 2) full documentation IS allowed. 3) @inheritdoc and...
Read more >
How to Write Doc Comments for the Javadoc Tool - Oracle
It does not describe implementation details, such as whether the method is ... If you add any documentation comment or tag to m()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found