Skip to main content

Module gas

Module gas 

Source
Expand description

Gas estimate extraction from solc contract output.

Builds lookup tables from contracts[path][name].contract.evm.gasEstimates and contracts[path][name].contract.evm.methodIdentifiers so that hover, inlay hints, and code lenses can display gas costs.

Structs§

ContractGas
Gas estimates for a single contract.

Constants§

GAS_ICON
Emoji prefix for gas estimate labels (inlay hints, code lens).

Functions§

build_gas_index
Build a gas index from normalized AST output.
format_gas
Format a gas cost for display. Numbers get comma-separated (e.g. “6924600” → “6,924,600”). “infinite” stays as-is.
gas_by_name
Look up gas cost for an internal function by name.
gas_by_selector
Look up gas cost for a function by its FuncSelector (external functions).
gas_for_contract
Look up creation/deploy gas for a contract.
resolve_contract_key
Resolve the gas index key for a declaration node.

Type Aliases§

GasIndex
All gas estimates indexed by (source_path, contract_name).