We make here a general presentation about how the formal verification of smart contracts works by explaining:
- How people secure their smart contracts without formal verification.
- How do formal tools typically work?
- How our solution coq-of-solidity works on a short example (an ERC-20 contract).
- Where LLMs could be the most useful, according to us, for formal verification work.
To ensure your code is fully secure today, contact us atย ย ๐contact@formal.land!ย ๐
Formal verification goes further than traditional audits to make 100% sure you cannot lose your funds, thanks to mathematical reasoning on the code. It can also be integrated into your CI pipeline to check that every commit is fully correct without doing a whole audit again.
We are already working with some of the leading blockchain entities such as:
- The Ethereum Foundation
- The Sui Foundation
- Previously, the Aleph Zero and Tezos foundations

๐ก๏ธ Securing smart contracts, the common wayโ
Smart contracts are short programs, typically less than 5,000 lines of code, running "on the blockchain" to implement transaction rules. Examples can be virtual marketplaces to trade cryptocurrencies, virtual dollar coins, traceability databases, and NFTs, ... Most of the smart contracts are written in Solidity, a JavaScript-like language, and some are in Rust.
To know what a smart contract looks like, you can find a list of the biggest ones (in terms of users) on shafu0x/awesome-smart-contracts. A popular library to write smart contracts is OpenZeppelin. You can also search for the Solidity language on GitHub to find repositories with Solidity code.
Smart contracts are most of the time open-source, as it is important for the users to know what are the rules which handle their money. If a contract is not open-source, it is probably a scam.
Securing smart contracts is very important as a single bug can mean that an attacker can steal all the funds of the users who deposited money on the contract, or just block it to compromise the service. Millions of dollars are stolen every month due to bugs in the contracts, and some projects almost lose everything in such attacks. An historically important attack is the DAO hack where $60 million was stolen, leading to a hard fork of the Ethereum blockchain.
Now, how do people secure their code? First of all, most projects are well aware that software security is important, and if they want to raise money or advertise their product, they need to show that they are secure. They typically do the following:
- Audits Projects require a few audits, which are made by specialized companies or individuals, to review the code of a smart contract and find bugs or vulnerabilities. The issues are classified into categories of importance: informational, low, medium, high, or critical. The highest categories mean it is possible to steal all of the funds. Lower categories are more remarks about the coding style/missing documentation. At the end of an audit, a report is published together with the corrections for the vulnerabilities that were discovered. As an example, here is a list of audit reports from the company Trail of Bits.
- Competitions They enable anyone, during a pre-defined period of time of like a month, to look for bugs in a smart contract. At the end of the competition, a price pot is shared among the persons who found the most bugs. A typical price pot is $100,000, and some large competitions can go above $1,000,000ย ๐ฐ. You can see the list of all ongoing competitions on www.dailywarden.com.
- Bounties Finally, bounties are like competitions but always live. The aim is to reward critical vulnerabilities, such that there is an incentive to report a bug instead of exploiting it. A popular platform is Immunefi.
To give an idea of the amounts that are at risk of attacks on the blockchain, the total valuation of Ethereum, the main smart contracts platform, is estimated at more than 300 Billion dollars! Attacks are believed to be mainly done by ๐ฐ๐ตย North Korean agents, but sometimes they happen to be single, clever individuals.