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

Support for cast estimate and cast estimate --create Command #618

Open
Tracked by #630
dutterbutter opened this issue Oct 21, 2024 · 0 comments
Open
Tracked by #630

Support for cast estimate and cast estimate --create Command #618

dutterbutter opened this issue Oct 21, 2024 · 0 comments
Assignees
Labels
Internal ⚙️ medium 🚩 Indicates moderately difficult item p1 🟠 Indicates high priority item upstream-parity 🟰 Needed for upstream feature parity
Milestone

Comments

@dutterbutter
Copy link
Collaborator

Title: Support for cast estimate Command

Description:

The cast estimate command is currently not supported in foundry-zksync. This command estimates the gas cost of executing a transaction.

Feature Request:

Implement the cast estimate command to enable gas estimation within the foundry-zksync environment.


Purpose of cast estimate:

The cast estimate command calculates the amount of gas required to execute a transaction or contract call, helping users anticipate costs and set appropriate gas limits.

Key Features:

  • Estimates gas usage for transactions.
  • Supports contract deployments and function calls.
  • Considers current network state and conditions.

Common Options:

  • See common options via cast estimate --help

Example Usage:

  • Estimate gas for a transfer transaction from WETH contract on ZKsync mainnet:

    cast estimate 0xf00DAD97284D0c6F06dc4Db3c32454D4292c6813 "transfer(address,uint256)" 
    0x7182fA7dF76406ffFc0289f36239aC1bE134f305 1000000000000000000 --rpc-url https://mainnet.era.zksync.io
  • Estimate gas for a contract deployment:

    cast estimate --create --data 0xContractBytecode

References:

@dutterbutter dutterbutter added p1 🟠 Indicates high priority item upstream-parity 🟰 Needed for upstream feature parity medium 🚩 Indicates moderately difficult item labels Oct 21, 2024
@dutterbutter dutterbutter moved this to Todo in DevEx squad Oct 21, 2024
@dutterbutter dutterbutter changed the title Support for cast estimate Command Support for cast estimate and cast estimate --create Command Oct 22, 2024
@Jrigada Jrigada added this to the O.R Q1 milestone Jan 21, 2025
@elfedy elfedy self-assigned this Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal ⚙️ medium 🚩 Indicates moderately difficult item p1 🟠 Indicates high priority item upstream-parity 🟰 Needed for upstream feature parity
Projects
Status: Todo
Development

No branches or pull requests

3 participants