1/5
--- ### Introduction to Formal Verification Formal verification involves transforming code into mathematical expressions and then proving certain invariants or properties about the system. This process is essential for ensuring that the code performs as expected under various conditions. #### Tools for Formal Verification: Halmos and Certora - **Halmos**: This tool integrates with foundry fuzz tests to facilitate symbolic execution. It allows developers to run analyses directly on their tests, though it has some limitations when dealing with more complex or creative coding scenarios. - **Certora**: Certora offers a Comprehensive Verification Language (CVL) that enables extensive customization for writing formal verification specifications. Its robust language features support a wide range of verification needs. #### Working with Certora Certora operates without making assumptions about the underlying codebase, considering possibilities like value transactions and storage modifications. This flexibility is crucial when proving or disproving rules or invariants specified by the developer. ##### Example of a Basic Rule in Certora We explored a simple rule to understand Certora's capabilities: - **Rule**: Does the function `hellFunc` ever revert? - **Process**: We started by defining preconditions, checking if the function reverted, and then asserting to verify our findings. This helped us identify an edge case where the function reverted under specific conditions.
A quick introduction to formal verification in Solidity. The lesson goes over how to use the Halmos and Certora tools to verify a simple rule or invariant for a solidity contract. This example will show how to write a rule that proves that a function will never revert.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Assembly
Writing smart contracts using Huff and Yul
Ethereum Virtual Machine OPCodes
Formal verification testing
Smart contract invariant testing
Halmos, Certora, Kontrol
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Guest lecturers:
Josselin Feist
Head of Blockchain at Trail of Bits
Last updated on January 17, 2025
Solidity Developer
Assembly and Formal VerificationDuration: 30min
Duration: 4h 38min
Duration: 3h 57min
Duration: 1h 56min
Course Overview
About the course
Assembly
Writing smart contracts using Huff and Yul
Ethereum Virtual Machine OPCodes
Formal verification testing
Smart contract invariant testing
Halmos, Certora, Kontrol
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Guest lecturers:
Josselin Feist
Head of Blockchain at Trail of Bits
Last updated on January 17, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar