eth_gasPrice - Scroll RPC Method
Get current gas price on Scroll. Essential for transaction cost estimation for zero-migration DeFi protocols, zkEVM-native dApps, and 100+ ecosystem projects with native Ethereum tooling.
Returns the current gas price on Scroll in wei.
Why Scroll? Build on the largest zkEVM by market share with $750M+ TVL and bytecode-level Ethereum equivalence with bytecode-level EVM equivalence, native Hardhat/Remix/MetaMask support, decentralized proof validation, and Scroll SDK for L2/L3 deployment.
Use Cases
The eth_gasPrice method is essential for:
- Transaction pricing - Set appropriate gas prices
- Cost estimation - Calculate transaction costs before sending
- Gas monitoring - Track network congestion
- DeFi operations - Optimize costs for zero-migration DeFi protocols, zkEVM-native dApps, and 100+ ecosystem projects with native Ethereum tooling
Code Examples
Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32603 | Internal error | Node error |
Related Methods
eth_maxPriorityFeePerGas- Get priority fee (EIP-1559)eth_feeHistory- Get historical fee dataeth_estimateGas- Estimate gas needed
eth_estimateGas
Estimate gas required for transactions on Scroll. Essential for optimizing transaction costs for zero-migration DeFi protocols, zkEVM-native dApps, and 100+ ecosystem projects with native Ethereum tooling.
eth_maxPriorityFeePerGas
Get the suggested priority fee (tip) per gas for EIP-1559 transactions on Scroll. Essential for gas estimation, fee optimization, and time-sensitive transaction pricing.