Pérez Carrasco, Víctor,
Klemen, Maximiliano,
López García, Pedro,
Morales Caballero, José Francisco and
Hermenegildo, Manuel V.
ORCID: https://orcid.org/0000-0002-7583-323X
(2020).
Cost analysis of smart contracts via parametric resource analysis.
En:
"Static Analysis: 27th International Symposium, SAS 2020, Virtual Event, November 18–20, 2020, Proceedings".
Lecture Notes in Computer Science
(12389).
Springer, Suiza, pp. 7-31.
ISBN 978-3-030-65473-3.
Resumen
The very nature of smart contracts and blockchain platforms, where program execution and storage are replicated across a large number of nodes, makes resource consumption analysis highly relevant. This has led to the development of analyzers for specific platforms and languages. However, blockchain platforms present significant variability in languages and cost models, as well as over time. Approaches that facilitate the quick development and adaptation of cost analyses are thus potentially attractive in this context. We explore the application of a generic approach and tool for cost analysis to the problem of static inference of gas consumption bounds in smart contracts. The approach is based on Parametric Resource Analysis, a method that simplifies the implementation of analyzers for inferring safe bounds on different resources and with different resource consumption models. In addition, to support different input languages, the approach also makes use of translation into a Horn clause-based intermediate representation. To assess practicality we develop an analyzer for the Tezos platform and its Michelson language. We argue that this approach offers a rapid, flexible, and effective method for the development of cost analyses for smart contracts.