Skip to content
Last updated: February 06, 2026

SCWE-127: EIP-1559 Basefee Assumptions

Stable Version v1.0

This content is in the version-(v1.0) and still under active development, so it is subject to change any time (e.g. structure, IDs, content, URLs, etc.).

Send Feedback

Relationships

Description

Hardcoding gas price/basefee assumptions (e.g., fixed gasprice limits or expecting refunds) can break on EIP-1559 chains. Contracts that require exact block.basefee ranges or reimburse fixed gas can become stuck or exploitable via gas griefing.

Remediation

  • Avoid relying on specific basefee values; parameterize and allow updates via governance with delays.
  • Use robust gas estimation and caps on external calls; avoid refund-dependent logic.
  • Simulate on mainnet forks with varying basefee to validate liveness.

Examples

Vulnerable

require(tx.gasprice <= 30 gwei, "gas too high"); // fails as basefee rises

Fixed

uint256 maxGasPrice = governanceMaxGasPrice;
require(tx.gasprice <= maxGasPrice, "gas too high"); // upgradable with delays