Lune

OOPSLA2020Top-tier venue

Taming callbacks for smart contract modularity

Elvira Albert, Shelly Grossman, Noam Rinetzky, Clara Rodríguez-Núñez, Albert Rubio, Mooly Sagiv

Abstract

Callbacks are an effective programming discipline for implementing event-driven programming, especially in environments like Ethereum which forbid shared global state and concurrency. Callbacks allow a callee to delegate the execution back to the caller. Though effective, they can lead to subtle mistakes principally in open environments where callbacks can be added in a new code. Indeed, several high profile bugs in smart contracts exploit callbacks. We present the first static technique ensuring modularity in the presence of callbacks and apply it to verify prominent smart contracts. Modularity ensures that external calls to other contracts cannot affect the behavior of the contract. Importantly, modularity is guaranteed without restricting programming.

In general, checking modularity is undecidableÐeven for programs without loops. This paper describes an effective technique for soundly ensuring modularity harnessing SMT solvers. The main idea is to define a constructive version of modularity using commutativity and projection operations on program segments. We believe that this approach is also accessible to programmers, since counterexamples to modularity can be generated automatically by the SMT solvers, allowing programmers to understand and fix the error.

We implemented our approach in order to demonstrate the precision of the modularity analysis and applied it to real smart contracts, including a subset of the 150 most active contracts in Ethereum. Our implementation decompiles bytecode programs into an intermediate representation and then implements the modularity checking using SMT queries. Overall, we argue that our experimental results indicate that the method can be applied to many realistic contracts, and that it is able to prove modularity where other methods fail.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

9 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Securing smart contract with runtime validation cites Making Smart Contracts Smarter
  • Securing smart contract with runtime validation cites Securify: Practical Security Analysis of Smart Contracts
  • Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks cites Making Smart Contracts Smarter
  • Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks cites Securify: Practical Security Analysis of Smart Contracts
  • Rich specifications for Ethereum smart contract verification cites Making Smart Contracts Smarter
  • Rich specifications for Ethereum smart contract verification cites Securify: Practical Security Analysis of Smart Contracts
  • Ethainter: a smart contract security analyzer for composite vulnerabilities cites Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks
  • Ethainter: a smart contract security analyzer for composite vulnerabilities cites Making Smart Contracts Smarter
  • Ethainter: a smart contract security analyzer for composite vulnerabilities cites Securify: Practical Security Analysis of Smart Contracts
  • Consolidating Smart Contracts with Behavioral Contracts cites Securing smart contract with runtime validation
  • Consolidating Smart Contracts with Behavioral Contracts cites Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks
  • Consolidating Smart Contracts with Behavioral Contracts cites Rich specifications for Ethereum smart contract verification
  • Consolidating Smart Contracts with Behavioral Contracts cites Ethainter: a smart contract security analyzer for composite vulnerabilities
  • Consolidating Smart Contracts with Behavioral Contracts cites Symbolic value-flow static analysis: deep, precise, complete modeling of Ethereum smart contracts
  • Symbolic value-flow static analysis: deep, precise, complete modeling of Ethereum smart contracts cites Ethainter: a smart contract security analyzer for composite vulnerabilities
  • Symbolic value-flow static analysis: deep, precise, complete modeling of Ethereum smart contracts cites Making Smart Contracts Smarter
  • Symbolic value-flow static analysis: deep, precise, complete modeling of Ethereum smart contracts cites Securify: Practical Security Analysis of Smart Contracts
  • FORAY: Towards Effective Attack Synthesis against Deep Logical Vulnerabilities in DeFi Protocols cites Making Smart Contracts Smarter
  • FORAY: Towards Effective Attack Synthesis against Deep Logical Vulnerabilities in DeFi Protocols cites Securify: Practical Security Analysis of Smart Contracts
  • Compositional Security for Reentrant Applications cites Securing smart contract with runtime validation
  • Compositional Security for Reentrant Applications cites Ethainter: a smart contract security analyzer for composite vulnerabilities
  • Compositional Security for Reentrant Applications cites Making Smart Contracts Smarter
  • Securify: Practical Security Analysis of Smart Contracts cites Making Smart Contracts Smarter
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers9

  1. Compositional Security for Reentrant ApplicationsEthan Cecchetti, Siqiu Yao, Haobin Ni, Andrew C. MyersS&P 2021 · 42 citations
  2. Rich specifications for Ethereum smart contract verificationChristian Bräm, Marco Eilers, Peter Müller, Robin Sierra et al.OOPSLA 2021 · 23 citations
  3. Symbolic value-flow static analysis: deep, precise, complete modeling of Ethereum smart contractsYannis Smaragdakis, Neville Grech, Sifis Lagouvardos, Konstantinos Triantafyllou et al.OOPSLA 2021 · 18 citations
  4. Consolidating Smart Contracts with Behavioral ContractsGuannan Wei, Danning Xie, Wuqi Zhang, Yongwei Yuan et al.PLDI 2024 · 6 citations
  5. FORAY: Towards Effective Attack Synthesis against Deep Logical Vulnerabilities in DeFi ProtocolsHongbo Wen, Hanzhi Liu, Jiaxin Song, Yanju Chen et al.CCS 2024 · 6 citations

Builds on7

  1. Making Smart Contracts SmarterLoi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena et al.CCS 2016 · 2,306 citations
  2. Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais et al.CCS 2018 · 1,108 citations
  3. Sereum: Protecting Existing Smart Contracts Against Re-Entrancy AttacksMichael Rodler, Wenting Li, Ghassan O. Karame, Lucas DaviNDSS 2019 · 298 citations
  4. Ethainter: a smart contract security analyzer for composite vulnerabilitiesLexi Brent, Neville Grech, Sifis Lagouvardos, Bernhard Scholz et al.PLDI 2020 · 163 citations
  5. Securing smart contract with runtime validationAo Li, Jemin Andrew Choi, Fan LongPLDI 2020 · 60 citations

Related papers

  1. eThor: Practical and Provably Sound Static Analysis of Ethereum Smart ContractsClara Schneidewind, Ilya Grishchenko, Markus Scherer, Matteo MaffeiCCS 2020 · 9 citations
  2. FairChecker: Detecting Fund-Stealing Bugs in DeFi Protocols via Fairness ValidationYi Sun, Zhuo Zhang, Xiangyu ZhangICSE 2025
  3. Practical Verification of Smart Contracts using Memory SplittingShelly Grossman, John Toman, Alexander Bakst, Sameer Arora et al.OOPSLA 2024 · 7 citations
  4. Targeted greybox fuzzing with static lookahead analysisValentin Wüstholz, Maria ChristakisICSE 2020 · 14 citations
  5. Canary: practical static detection of inter-thread value-flow bugsYuandao Cai, Peisen Yao, Charles ZhangPLDI 2021 · 25 citations
Dusk over the sea between two cliffs drawn in fine vertical lines