Profiling Gas Consumption in Solidity Smart Contracts
- URL: http://arxiv.org/abs/2008.05449v3
- Date: Wed, 15 Dec 2021 15:49:09 GMT
- Title: Profiling Gas Consumption in Solidity Smart Contracts
- Authors: Andrea Di Sorbo, Sonia Laudanna, Anna Vacca, Corrado A. Visaggio,
Gerardo Canfora
- Abstract summary: We propose GasMet, a suite of metrics for statically evaluating the code quality of a smart contract from the gas consumption perspective.
An experiment involving 2,186 smart contracts demonstrates that the proposed metrics have direct associations with deployment costs.
- Score: 3.0378875015087567
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Nowadays, more and more applications are developed for running on a
distributed ledger technology, namely dApps. The business logic of dApps is
usually implemented within smart contracts developed through Solidity, a
programming language for writing smart contracts on different blockchain
platforms, including the popular Ethereum. In Ethereum, the smart contracts run
on the machines of miners and the gas corresponds to the execution fee
compensating such computing resources. However, the deployment and execution
costs of a smart contract depend on the implementation choices done by
developers. Unappropriated design choices could lead to higher gas consumption
than necessary. In this paper, we (i) identify a set of 19 Solidity code smells
affecting the deployment and transaction costs of a smart contract, and (ii)
assess the relevance of such smells through a survey involving 34 participants.
On top of these smells, we propose GasMet, a suite of metrics for statically
evaluating the code quality of a smart contract from the gas consumption
perspective. An experiment involving 2,186 smart contracts demonstrates that
the proposed metrics have direct associations with deployment costs. The
metrics in our suite can be used for more easily identifying source code
segments that need optimizations.
Related papers
- Codev-Bench: How Do LLMs Understand Developer-Centric Code Completion? [60.84912551069379]
We present the Code-Development Benchmark (Codev-Bench), a fine-grained, real-world, repository-level, and developer-centric evaluation framework.
Codev-Agent is an agent-based system that automates repository crawling, constructs execution environments, extracts dynamic calling chains from existing unit tests, and generates new test samples to avoid data leakage.
arXiv Detail & Related papers (2024-10-02T09:11:10Z) - Versioned Analysis of Software Quality Indicators and Self-admitted Technical Debt in Ethereum Smart Contracts with Ethstractor [2.052808596154225]
This paper proposes Ethstractor, the first smart contract collection tool for gathering a dataset of versioned smart contracts.
The collected dataset is then used to evaluate the reliability of code metrics as indicators of vulnerabilities in smart contracts.
arXiv Detail & Related papers (2024-07-22T18:27:29Z) - Specification Mining for Smart Contracts with Trace Slicing and Predicate Abstraction [10.723903783651537]
We propose a specification mining approach to infer contract specifications from past transactionhistories.
Our approach derives high-level behavioral automata of function invocations, accompanied byprogram invariants statistically inferred from the transaction histories.
arXiv Detail & Related papers (2024-03-20T03:39:51Z) - Contract Usage and Evolution in Android Mobile Applications [45.44831696628473]
We present the first large-scale empirical study on the presence and use of contracts in Android applications, written in Java or Kotlin.
We analyzed 2,390 Android applications from the F-Droid repository and processed more than 51,749 KLOC.
Our findings show that it would be desirable to have libraries that standardize contract specifications in Java and Kotlin.
arXiv Detail & Related papers (2024-01-25T15:36:49Z) - Automated Invariant Generation for Solidity Smart Contracts [2.4181711081104282]
We propose a novel invariant generation framework, INVCON+, for Solidity smart contracts.
INVCON+ extends the existing invariant detector, InvCon, to automatically produce verified contract invariants.
We evaluate INVCON+ on 361 ERC20 and 10 ERC721 real-world contracts, as well as common ERC20 vulnerability benchmarks.
arXiv Detail & Related papers (2024-01-01T03:37:30Z) - A Comparative Gas Cost Analysis of Proxy and Diamond Patterns in EVM Blockchains for Trusted Smart Contract Engineering [0.0]
This study aims to provide an in-depth analysis of gas costs associated with two prevalent upgradeable smart contract patterns: the Proxy and diamond patterns.
We conduct a comparative analysis of gas costs for both patterns in contrast to a traditional non-upgradeable smart contract.
arXiv Detail & Related papers (2023-12-14T13:54:25Z) - Formally Verifying a Real World Smart Contract [52.30656867727018]
We search for a tool capable of formally verifying a real-world smart contract written in a recent version of Solidity.
In this article, we present our search for a tool capable of formally verifying a real-world smart contract written in a recent version of Solidity.
arXiv Detail & Related papers (2023-07-05T14:30:21Z) - Semantic Information Marketing in The Metaverse: A Learning-Based
Contract Theory Framework [68.8725783112254]
We address the problem of designing incentive mechanisms by a virtual service provider (VSP) to hire sensing IoT devices to sell their sensing data.
Due to the limited bandwidth, we propose to use semantic extraction algorithms to reduce the delivered data by the sensing IoT devices.
We propose a novel iterative contract design and use a new variant of multi-agent reinforcement learning (MARL) to solve the modelled multi-dimensional contract problem.
arXiv Detail & Related papers (2023-02-22T15:52:37Z) - Smart Contract Vulnerability Detection: From Pure Neural Network to
Interpretable Graph Feature and Expert Pattern Fusion [48.744359070088166]
Conventional smart contract vulnerability detection methods heavily rely on fixed expert rules.
Recent deep learning approaches alleviate this issue but fail to encode useful expert knowledge.
We develop automatic tools to extract expert patterns from the source code.
We then cast the code into a semantic graph to extract deep graph features.
arXiv Detail & Related papers (2021-06-17T07:12:13Z) - A Bytecode-based Approach for Smart Contract Classification [10.483992071557195]
The number of smart contracts deployed on blockchain platforms is growing exponentially, which makes it difficult for users to find desired services by manual screening.
Current research on smart contract classification focuses on Natural Language Processing (NLP) solutions which are based on contract source code.
This paper proposes a classification model based on features from contract bytecode instead of source code to solve these problems.
arXiv Detail & Related papers (2021-05-31T03:00:29Z) - ESCORT: Ethereum Smart COntRacTs Vulnerability Detection using Deep
Neural Network and Transfer Learning [80.85273827468063]
Existing machine learning-based vulnerability detection methods are limited and only inspect whether the smart contract is vulnerable.
We propose ESCORT, the first Deep Neural Network (DNN)-based vulnerability detection framework for smart contracts.
We show that ESCORT achieves an average F1-score of 95% on six vulnerability types and the detection time is 0.02 seconds per contract.
arXiv Detail & Related papers (2021-03-23T15:04:44Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.