Declarative smart contracts
Haoxian Chen, Gerald Whitters, Mohammad Javad Amiri, Yuepeng Wang, Boon Thau Loo
Abstract
This paper presents DeCon, a declarative programming language for implementing smart contracts and specifying contract-level properties. Driven by the observation that smart contract operations and contract-level properties can be naturally expressed as relational constraints, DeCon models each smart contract as a set of relational tables that store transaction records. This relational representation of smart contracts enables convenient specification of contract properties, facilitates run-time monitoring of potential property violations, and brings clarity to contract debugging via data provenance. Specifically, a DeCon program consists of a set of declarative rules and violation query rules over the relational representation, describing the smart contract implementation and contract-level properties, respectively. We have developed a tool that can compile DeCon programs into executable Solidity programs, with instrumentation for run-time property monitoring. Our case studies demonstrate that DeCon can implement realistic smart contracts such as ERC20 and ERC721 digital tokens. Our evaluation results reveal the marginal overhead of DeCon compared to the open-source reference implementation, incurring 14% median gas overhead for execution, and another 16% median gas overhead for run-time verification.
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.
2 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts cites Making Smart Contracts Smarter
- Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks cites teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts
- Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks cites ZEUS: Analyzing Safety 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
- ZEUS: Analyzing Safety of Smart Contracts cites Making Smart Contracts Smarter
- Consolidating Smart Contracts with Behavioral Contracts cites Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks
- SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites teEther: Gnawing at Ethereum to Automatically Exploit Smart Contracts
- SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks
- SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites ZEUS: Analyzing Safety of Smart Contracts
- SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites Making Smart Contracts Smarter
- SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites Consolidating Smart Contracts with Behavioral Contracts
- SymGPT: Auditing Smart Contracts via Combining Symbolic Execution with Large Language Models cites Securify: Practical Security Analysis of Smart Contracts
- Securify: Practical Security Analysis of Smart Contracts cites ZEUS: Analyzing Safety of Smart Contracts
- Securify: Practical Security Analysis of Smart Contracts cites Making Smart Contracts Smarter
Cited by top-tier papers2
Builds on13
- Making Smart Contracts SmarterLoi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena et al.CCS 2016 · 2,306 citations
- Securify: Practical Security Analysis of Smart ContractsPetar Tsankov, Andrei Marian Dan, Dana Drachsler-Cohen, Arthur Gervais et al.CCS 2018 · 1,108 citations
- ZEUS: Analyzing Safety of Smart ContractsSukrit Kalra, Seep Goel, Mohan Dhawan, Subodh SharmaNDSS 2018 · 595 citations
- teEther: Gnawing at Ethereum to Automatically Exploit Smart ContractsJohannes Krupp, Christian RossowUSENIX Security 2018 · 345 citations
- Sereum: Protecting Existing Smart Contracts Against Re-Entrancy AttacksMichael Rodler, Wenting Li, Ghassan O. Karame, Lucas DaviNDSS 2019 · 298 citations
Related papers
- Verifying Declarative Smart ContractsHaoxian Chen, Lan Lu, Brendan Massey, Yuepeng Wang et al.ICSE 2024 · 2 citations
- Demystifying Loops in Smart ContractsBenjamin Mariano, Yanju Chen, Yu Feng, Shuvendu K. Lahiri et al.ASE 2020 · 20 citations
- Synthesis-powered optimization of smart contracts via data type refactoringYanju Chen, Yuepeng Wang, Maruth Goyal, James Dong et al.OOPSLA 2022 · 14 citations
- SmartCoCo: Checking Comment-Code Inconsistency in Smart Contracts via Constraint Propagation and BindingSicheng Hao, Yuhong Nan, Zibin Zheng, Xiaohui LiuASE 2023 · 7 citations
- DiSCo: Towards Decompiling EVM Bytecode to Source Code using Large Language ModelsXing Su, Hanzhong Liang, Hao Wu, Ben Niu et al.FSE 2025 · 2 citations
