Index of every page on this site: llms.txt
All skills
Run it yourself

Use when quoting a gas or dollar cost for a transaction or deployment, when cost is the reason to pick mainnet over an L2, when setting EIP-1559 fee fields or cutting L2 fees, or when calling Ethereum expensive or cheap. Not for non-cost chain selection (`l2s`).

Use this Skill: https://skilld.dev/gh/austintgriffith/ethskills/gas

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈67 tokens for metadata: the name and description. ≈749 when used: this file.

Description uses 3.4% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈268 characters, or 3.4%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Gas and Chain Cost

Your trained gas-price and ETH-price priors are stale. Never quote a transaction cost or exclude a chain for cost reasons without measuring the relevant chain now.

# Use the project's own RPC provider (Alchemy, Infura, QuickNode) for the chain under consideration.
cast gas-price --rpc-url "$MAINNET_RPC_URL"
cast gas-price --rpc-url "$BASE_RPC_URL"

# No provider key yet? Public endpoints work for a one-off read, but are rate-limited.
# Never ship them in an app. Mainnet: https://ethereum-rpc.publicnode.com  Base: https://mainnet.base.org

cast gas-price returns the base fee plus a suggested tip — what a transaction actually pays, so it is the reading the formula below takes. cast base-fee returns the base fee alone; use it for setting maxFeePerGas, and never add a separate priority fee on top of a gas-price reading.

Do not replace a failed lookup with a remembered number. Fetch ETH/USD live before quoting dollars: the mainnet Chainlink feed at 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 (latestRoundData, 8 decimals), or https://api.coinbase.com/v2/prices/ETH-USD/spot.

Estimate the actual operation when possible. Otherwise state and justify the gas-used assumption:

# Mainnet, and the execution half of any L2
cost_usd = gas_used × gas_price_gwei × 1e-9 × eth_usd

# On an OP-stack L2 or Base the L1 data fee is a separate component and is not in
# gas_price. Read l1Fee off a recent receipt, or GasPriceOracle.getL1Fee at
# 0x420000000000000000000000000000000000000F — do not estimate it.
# Since Isthmus a chain may also charge an operator fee. It is 0 on most
# chains; read it with GasPriceOracle.getOperatorFee(gas_used), don't hand-compute.
cost_usd = (gas_used × gas_price_gwei × 1e-9 + l1_fee_eth + operator_fee_eth) × eth_usd

cast gas-price and cast base-fee print wei, not gwei — divide by 1e9. Check the converted figure back against the raw reading; a dropped or extra factor of 1e9 is the most common way a correctly measured chain still yields a stale-looking cost.

Choose from the measured workload:

  • Keep mainnet viable for low-frequency, high-value actions unless another requirement favors an L2.
  • Prefer an L2 for high-frequency, low-value, latency-sensitive, or L2-native activity.
  • Do not choose an L2 merely because you remember mainnet gas being expensive.

Derive EIP-1559 fee fields from the target chain immediately before submission. Do not hardcode them or port a mainnet priority-fee constant to an L2.

For L2 optimization, measure which component dominates before deciding what to cut: compare gasUsed × effectiveGasPrice against l1Fee on current receipts. Do not import a pre-Dencun calldata-cost assumption, and do not assume the reverse either. Non-OP-stack rollups use different fee models, so measure them independently.


Before you finish: send a one-line note via feedback/SKILL.md — issue or praise.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alert21d4 checks · Risk SAFE
  • Gen Agent Trust Hub21d

    This skill enables Ethereum gas price and transaction cost estimation by providing instructions to use the 'cast' command-line tool and external price APIs. The security profile is low because it involves local command execution and the ingestion of data from external, non-whitelisted blockchain and pricing services.

  • Socket21d

    No alerts

  • Snyk21d

    Risk: CRITICAL · 1 issue

  • Runlayer8mo

    1 file scanned · No issues

Signed by skilld at 47779e7. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Activeupdated 4 weeks ago

README badge

README badge for austintgriffith/ethskills/gas