The optimization of gas consumption in Ethereum smart contracts is critical for enhancing the economic viability, scalability, and security of blockchain applications. Existing tools, however, are largely limited to static heuristics or local pattern matching, failing to capture the complex, non-local dependencies that drive gas inefficiency.
To address this limitation, this paper introduces GasGAT, a deep learning framework that models smart contracts as semantic graphs and leverages a Graph Attention Network (GAT) to detect gas-intensive code patterns. By capturing intricate dependencies between functions, state variables, and control flows, GasGAT is able to identify non-local and inter-procedural inefficiencies that are often missed by rule-based or purely local static analysis tools. Unlike existing approaches, which focus primarily on local code patterns or rule-based detection, GasGAT explicitly reasons about long-range execution paths within smart contracts. We evaluate our method on a dataset of 40,000 verified Ethereum smart contracts (Solidity ≥0.8.0, labeled via Slither static analysis), including both a polarized subset (excluding ambiguous cases) and a full, non-filtered setting.
Under 5-fold cross-validation, GasGAT achieves an accuracy of 94.92% (±1.04%) and a macro F1-score of 88.69% (±2.70%), with a McNemar statistic of 633.12 (p ≪ 0.05) confirming statistical significance. Crucially, GasGAT is the only model whose performance remains stable when correlated node features are removed (Δ = 0.00%), demonstrating that its attention mechanism learns genuine structural patterns rather than label-feature correlations.
The primary contribution of GasGAT lies not in marginal accuracy improvements, but in its ability to provide interpretable, structural insights through attention mechanisms. This represents a paradigm shift from traditional detection methods toward explainable, graph-based reasoning for gas optimization, enabling developers to design more efficient, scalable, and secure decentralized applications.
Youssef Said, A. M. Khaddar, Lahcen Hassine et al.· Frontiers in Blockchain· 0 citations
In post-disaster environments, the failure of terrestrial communication infrastructure necessitates the rapid deployment of unmanned aerial vehicles (UAVs) as aerial base stations to restore wireless connectivity. This paper addresses the joint UAV activation-and-placement problem in continuous space, with the objective of minimizing the number of deployed UAVs while satisfying coverage and minimum-separation constraints. To solve this problem, we propose a Hybrid K-means Quantum-Inspired Evolutionary Algorithm (HKQEA) that combines K-means-guided initialization, a calibrated penalty-based feasibility objective, non-elitist evolutionary search, and a quantum-inspired learning update. Experimental results over 50 independent runs show that HKQEA attains a best fully feasible solution with 8 UAVs, while achieving average values of 98.94% for coverage, 99.94% for non-overlap, and 99.68% for minimum-distance satisfaction. Comparative evaluation against standard Non-dominated Sorting Genetic Algorithm II (NSGA-II), Particle Swarm Optimization algorithm (PSO) and an elitist variant of HKQEA further shows that the proposed method provides a more favorable balance among exploration, convergence behavior, and reliable feasibility preservation in constrained deployment problems. An illustrative procurement-level cost analysis also indicates that reducing the fleet from 10 UAVs to 8 can yield a 20% reduction in hardware count, corresponding to a simplified savings ratio of 25% for the studied deployment setting. These results demonstrate the potential of the proposed framework for resource-efficient post-disaster communication restoration.
Fatima Azzahraa Amarcha, Lahcen Hassine, R. Saadane et al.· Journal of King Saud Univers...· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.