From 32098fb3a4bba23f8727875e12eec4c63d5cd0fa Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Tue, 14 Jun 2022 10:42:52 -0500 Subject: [PATCH] feat(estimate-gas): Added warning about having to have ETH --- sdk-estimate-gas/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk-estimate-gas/README.md b/sdk-estimate-gas/README.md index 55f0f008..bb7c76c4 100644 --- a/sdk-estimate-gas/README.md +++ b/sdk-estimate-gas/README.md @@ -164,6 +164,9 @@ We can't use the `{a: b(), c: d()}` syntax because the `L2Provider` functions co [Estimate the total cost (L1+L2) of running the transaction](https://sdk.optimism.io/modules.html#estimateTotalGasCost). +> :warning: This function calls `eth_estimateGas`, which runs the transaction in the node (without changing the blockchain state). +> This means that the account in `l2Provider` has to have enough ETH to pay for the gas cost of the transaction. + ```js retVal.l1Cost = await provider.estimateL1GasCost(tx) retVal.l2Cost = await provider.estimateL2GasCost(tx)