2022/03/11 by Eske Hoy Nielsen, Nielsen, Eske Hoy, Danil Annenkov +3 · 1 citation
Business, Management and Accounting · Computer Science · Decision Sciences · #Accounting #Auction Theory and Applications #Audit #Blockchain #Blockchain Technology Applications and Security #Business #Code (set theory) #Computer science #Computer security #Correctness #Cryptography and Security (cs.CR) #FOS: Computer and information sciences #FinTech, Crowdfunding, Digital Finance #Finance #Formal methods #Formal verification #Logic in Computer Science (cs.LO) #Mathematical proof #Order (exchange) #Programming language #Proof assistant #Smart contract #Software engineering #cs.CR #cs.LO
paper · pdf · doi:10.48550/arxiv.2203.08016
arxiv created 2022/03/11 · openalex publication_date 2022/03/11 · arxiv updated 2022/03/16 · openalex created_date 2025/10/10 · openalex updated_date 2026/08/06
The number of attacks and accidents leading to significant losses of crypto-assets is growing. According to Chainalysis, in 2021, approx. 14 billion has been lost due to various incidents, and this number is dominated by Decentralized Finance (DeFi) applications. In order to address these issues, one can use a collection of tools ranging from auditing to formal methods. We use formal verification and provide the first formalisation of a DeFi contract in a foundational proof assistant capturing contract interactions. We focus on Dexter2, a decentralized, non-custodial exchange for the Tezos network similar to Uniswap on Ethereum. The Dexter implementation consists of several smart contracts. This poses unique challenges for formalisation due to the complex contract interactions. Our formalisation includes proofs of functional correctness with respect to an informal specification for the contracts involved in Dexter's implementation. Moreover, our formalisation is the first to feature proofs of safety properties of the interacting smart contracts of a decentralized exchange. We have extracted our contract from Coq into CameLIGO code, so it can be deployed on the Tezos blockchain. Uniswap and Dexter are paradigmatic for a collection of similar contracts. Our methodology thus allows us to implement and verify DeFi applications featuring similar interaction patterns.