olekon / justsmartcontracts

justsmartcontracts.dev source code
MIT License
62 stars 47 forks source link

Feature Request: Support for Reading Contract State at Specific Block Number #21

Open mshakeg opened 6 months ago

mshakeg commented 6 months ago

Description

Summary: This feature request proposes the addition of a functionality to JustSmartContracts that allows users to read the state of a smart contract at a specific block number. Currently, users can interact with smart contracts to read their state, but this is limited to the latest block. Ethereum's eth_call method supports specifying a block number for state reading, and integrating this feature into JustSmartContracts would significantly enhance its utility.

Detailed Explanation: Ethereum smart contracts are dynamic, with their state changing at every block. In many cases, especially for development, testing, or auditing purposes, there's a need to understand the state of a contract at a particular point in its history. The Ethereum JSON RPC API provides the eth_call method, which allows users to specify a block number for executing a call. This feature enables users to query the state of the contract as it was at that specific block.

Incorporating this functionality into JustSmartContracts would allow users to specify a block number when reading the state of a contract. This addition would be immensely beneficial for:

Proposed Implementation:
The feature could be implemented as an additional input field in the UI where users can specify the block number for the contract state query. This would augment the existing functionality, offering both "latest" state reading and historical state reading options.

Benefits:

olekon commented 6 months ago

Thanks for the proposal. Will definitely add this to my todo-list

mshakeg commented 2 weeks ago

Hi @olekon just wanted to ask if you think you'll be able to ship this soon? neptunemutual seems to have taken down their tool which worked for the network of the connected wallet provider.

olekon commented 2 weeks ago

I am aftaid not. Unfortunately I don't have much time for maintaining those project now