Optimizing Gas Consumption in Ethereum Smart Contracts: A Static Analysis Approach

Ethereum smart contracts enable decentralized applications (dApps) on the blockchain and execution of each transaction on dApps incurs a gas cost (fee). While the gas cost prevents denial-of-service (DoS) attacks and incentivizes miners, unoptimized smart contracts may cause excessive gas waste, resulting in higher transaction costs and reduced scalability. Hence, this paper introduces four novel gas waste detectors integrated into the Slither static analysis framework to identify common gas wastes in Solidity smart contracts, including redundant use of address(this), division by unsigned integers, short constant strings, and unnecessary type casting. We analyzed 397 smart contracts from 53 dApps deployed on Ethereum, uncovering 250 instances of gas waste. Our findings indicate that every dApp analyzed exhibits at least one form of gas waste. Notably, division by unsigned integers emerged as the most prevalent gas waste, while half of the dApps could save gas by optimizing short constant strings. To facilitate further research, the annotated dataset of gas waste instances is available on GitHub.

Authors

Institutions

Publication Details

Published
2025-04-23
DOI
https://doi.org/10.1109/comtech65062.2025.11034442
Primary Topic
Blockchain Technology Applications and Security
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Optimizing Gas Consumption in Ethereum Smart Contracts: A Static Analysis Approach

Abdur Rehman Raza, Saifullah Khalid, Shahzaib Tahir, Asif Masood et al.
Blockchain Technology Applications and Security
article

Optimizing Gas Consumption in Ethereum Smart Contracts: A Static Analysis Approach

Abdur Rehman Raza, Saifullah Khalid, Shahzaib Tahir, Asif Masood, Khawir Mahmood
article en

Abstract

Ethereum smart contracts enable decentralized applications (dApps) on the blockchain and execution of each transaction on dApps incurs a gas cost (fee). While the gas cost prevents denial-of-service (DoS) attacks and incentivizes miners, unoptimized smart contracts may cause excessive gas waste, resulting in higher transaction costs and reduced scalability. Hence, this paper introduces four novel gas waste detectors integrated into the Slither static analysis framework to identify common gas wastes in Solidity smart contracts, including redundant use of address(this), division by unsigned integers, short constant strings, and unnecessary type casting. We analyzed 397 smart contracts from 53 dApps deployed on Ethereum, uncovering 250 instances of gas waste. Our findings indicate that every dApp analyzed exhibits at least one form of gas waste. Notably, division by unsigned integers emerged as the most prevalent gas waste, while half of the dApps could save gas by optimizing short constant strings. To facilitate further research, the annotated dataset of gas waste instances is available on GitHub.

National University of Sciences and Technology (PK)
Affordable and clean energy
Openalex Percentile: Top 80%
Blockchain Technology Applications and Security
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Optimizing Gas Consumption in Ethereum Smart Contracts: A Static Analysis Approach — Abdur Rehman Raza, Saifullah Khalid, et al. · (2025) | TGRS Research Map | TGRS