Yul is an intermediate representation that lies in between the (high-level) source code and the (low-level) bytecode languages for Ethereum smart contracts. Although it was proposed to favour the development of verification and optimization techniques, there exists no verifier that can be applied on Yul code directly yet. In this paper, we present a transformational approach to verifying Yul code by transforming it into an equivalent set of Constrained Horn Clauses (CHCs), leading, to the best of our knowledge, to the first approach to directly verify Yul code. Our transformational approach applies the first Futamura projection, i.e., specializes a Yul interpreter written in CHC with respect tothe Yul code to be verified. The verification of the transformed CHC code can rely on existing tools for CHC verification, namely we have used Z3 with the SPACER engine on our case studies.

Verifying Smart Contracts in Yul via Transformation to CHC by Interpreter Specialization

De Angelis, Emanuele;Fioravanti, Fabio;Matricardi, Giulia
2025-01-01

Abstract

Yul is an intermediate representation that lies in between the (high-level) source code and the (low-level) bytecode languages for Ethereum smart contracts. Although it was proposed to favour the development of verification and optimization techniques, there exists no verifier that can be applied on Yul code directly yet. In this paper, we present a transformational approach to verifying Yul code by transforming it into an equivalent set of Constrained Horn Clauses (CHCs), leading, to the best of our knowledge, to the first approach to directly verify Yul code. Our transformational approach applies the first Futamura projection, i.e., specializes a Yul interpreter written in CHC with respect tothe Yul code to be verified. The verification of the transformed CHC code can rely on existing tools for CHC verification, namely we have used Z3 with the SPACER engine on our case studies.
2025
Lecture Notes in Computer Science
Inglese
35th International Symposium on Logic-Based Program Synthesis and Transformation, LOPSTR 2025
2025
ita
16117
22
39
18
9783032048479
9783032048486
Springer Science and Business Media Deutschland GmbH
none
Albert, Elvira; De Angelis, Emanuele; Fioravanti, Fabio; Hernández-Cerezo, Alejandro; Matricardi, Giulia
273
info:eu-repo/semantics/conferenceObject
5
4 Contributo in Atti di Convegno (Proceeding)::4.1 Contributo in Atti di convegno
   Smart Knowledge: Enhancing Argumentation and Abstraction for Explanation and Analysis
   SMARTK
   Università  degli Studi della CALABRIA
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11564/868173
 Attenzione

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus ND
  • ???jsp.display-item.citation.isi??? ND
social impact