Skip to content

Docs/cast estimate create flag #1599

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions vocs/docs/pages/cast/reference/cast-estimate.mdx

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import TxValueOption from "../../reference/common/tx-value-option.mdx";
import RpcOptions from "../../reference/common/rpc-options.mdx";
import EtherscanOptions from "../../reference/common/etherscan-options.mdx";
import CommonOptions from "./common-options.mdx";
import CastEstimateCreateOption from "../../reference/common/cast-estimate-create-option.mdx";

## cast estimate

Expand All @@ -23,6 +24,7 @@ The destination (_to_) can be an ENS name or an address.
<SigDescription />

### OPTIONS
<CastEstimateCreateOption />

#### Transaction Options

Expand All @@ -41,6 +43,11 @@ The destination (_to_) can be an ENS name or an address.
cast estimate 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 \
--value 0.1ether "deposit()"
```
2. Estimate the gas cost for deploying a new contract:
```sh
cast estimate --create 0x608060405234801561001057600080fd5b506040516101...
```
Replace `0x6080...` with your contract's deployment (init) bytecode.

### SEE ALSO

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#### Create Option

`--create` _init_code_
&nbsp;&nbsp;&nbsp;&nbsp;Estimate gas as if deploying a new contract, rather than calling a function on an existing contract.
&nbsp;&nbsp;&nbsp;&nbsp;_init_code_ is the contract's deployment bytecode, provided as a hexadecimal string.