In web3 object, the default value of web3.eth.Contract.defaultBlock is always "latest". But what could be the case to modify defaultBlock value?


1 Answer 1

  • A block number: If you are making queries at certain height it might be useful to set the default to a block number. So all function will be consistent.

  • 'pending': Perhaps you need to consider transactions that weren't mined yet, you set the default block to 'pending'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.