Skip to content
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

Implement MirrorNodeContractQuery #2076

Closed
0xivanov opened this issue Nov 12, 2024 · 0 comments · Fixed by #2073
Closed

Implement MirrorNodeContractQuery #2076

0xivanov opened this issue Nov 12, 2024 · 0 comments · Fixed by #2073
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@0xivanov
Copy link
Contributor

0xivanov commented Nov 12, 2024

Description

A new MirrorNodeContractQuery class needs to be introduces in order to support EVM gas estimation and simulation. This query class provides two distinct types of queries:

  1. MirrorNodeContractCallQuery – Executes a contract call and returns the result, simulating the execution of the contract.
  2. MirrorNodeContractEstimateGasQuery – Estimates the gas usage for a contract call, allowing developers to understand the cost of executing a transaction.

The inputs for these queries match those of ContractExecuteTransaction, making it easy for developers to calculate the cost of a follow-up transaction.

The MirrorNodeContractQuery issues an HTTP request to the api/v1/contracts/call endpoint of the Mirror Node Web3 module, which supports both gas estimation and transient simulation of state-changing transactions. This enables accurate cost predictions and helps developers optimize their contract interactions before executing them on the network.

Alternatives

No response

@0xivanov 0xivanov added the enhancement New feature or request label Nov 12, 2024
@0xivanov 0xivanov added this to the v2.45.0 milestone Nov 12, 2024
@SimiHunjan SimiHunjan modified the milestones: v2.45.0, v2.46.0 Nov 26, 2024
@0xivanov 0xivanov self-assigned this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants