DeFi
What a smart contract audit checks, and what it does not
A smart contract audit is a paid review, limited in time, of a named set of contracts at a particular version, and it ends in a report listing what the reviewers found. It is evidence that qualified people looked at part of a system at one moment. The word “audited” on a protocol’s website says less than that, since nothing standardises it, and the DefiLlama audit code on this site’s protocol pages says less again. In the words of the pages’ own note, “An audit code says an audit was listed, not what it found.”
A review of named code, for a fixed time
Ethereum.org describes an audit as one way of getting an independent code review, and warns developers against treating it as a silver bullet: audits will not catch every bug and are mostly an additional round of review. The reports show what that round consists of.
Take two published by Trail of Bits, one of the firms that makes its reports public. Its review of Balancer V2 ran from 22 March to 2 April 2021, with two engineers spending four person-weeks working from two named commits of the code. It found 14 issues, two of them rated high severity. The engineers also ran a fuzzer, a tool that throws large numbers of generated inputs at the code, to look for rounding errors in the pools’ arithmetic. The report noted that the code was still changing while they worked, including changes the review did not cover. The review of Aave V4, dated February 2026, took three consultants from 21 October to 3 November 2025, six engineer-weeks in all.
That report closes with a test coverage disclaimer. It says security assessments are time-boxed and often rely on information the client provides, so the findings should not be taken as a comprehensive list of the system’s flaws. An oracle provider makes the same point from the other side. Chainlink’s developer responsibilities page says developers must audit their code before going to production and must judge for themselves whether the audits they commissioned are good enough. Nothing outside the report vouches for its quality.
Scope, and the commit it names
A report sets out what was in scope, and the list of what was not is often more useful. The Aave V4 review lists its coverage limitations. The engineers assumed that third-party dependencies work as expected. The code does little to validate the Chainlink price feeds the protocol reads, which the Aave team acknowledged, so the review assumed the feeds report a correct price. It did not cover interactions with non-standard tokens, such as those that charge a fee on transfer, and it trusted governance to set parameters correctly.
Audit contests draw a similar line around the people who run a protocol. Code4rena’s severity rules tell auditors to assume that every privileged role is trustworthy, and send direct misuse of admin privileges to the quality-assurance report rather than the high or medium findings. A review run on rules like these can pass a contract whose owner is able to drain it, so long as that power is part of the design. The rug pulls built on owner-only mint and blacklist functions live in that gap, and a clean report says nothing about the intentions of whoever holds the keys.
The commit matters as much as the list. A report reviews code as it stood at a given revision. The contract on the chain may have been deployed from a later one, and if it sits behind an upgradeable proxy, the logic can be replaced at the same address after the review, as the tokenomics piece describes for supply caps. Matching the deployed bytecode to the audited source is work somebody has to do, and how to read a block explorer shows where a verified contract’s source can be read.
Findings, severity and the fix review
A finding names a problem, rates it and recommends a fix. Firms grade differently. In the Balancer V2 report, Trail of Bits rated each finding on two scales. Severity runs from informational through low and medium to high, with a category called undetermined for cases where the extent of the risk was not settled during the engagement. Difficulty, from low to high, rates how hard the flaw is to exploit. Code4rena uses high, medium and a quality-assurance bucket. It defines high as assets that can be stolen, lost or compromised directly, and its rules class the loss of dust amounts, rounding errors among them, as low risk. Severity is a judgement made before anyone has tried to exploit the flaw, and the Balancer case below shows how hard that judgement can be.
After the report comes the fix review, a second, narrower pass at the changes the team made. Trail of Bits describes it as a review of specific areas of the code and configuration, not a comprehensive analysis of the system. The Aave V4 report does not agree with itself on how many issues it holds: its executive summary speaks of six findings, while its findings table lists seven. The fix review, done from 21 to 23 January 2026, counts seven and records that Aave resolved three and accepted the other four, adding context for each issue it chose not to address. The report’s status key defines “Risk Accepted” as an issue the client acknowledged. It does not mean the issue went away.
What “audited” on a website means
Nothing in particular, on its own. The word carries no standard and no licence, and a badge costs nothing to copy. The claim becomes useful only once it leads to a report that can be read, and Trail of Bits makes the point about its own work: the Aave V4 report says its publications page is the sole canonical source, and copies obtained elsewhere may have been modified.
In the EU the claim has a legal home in one place. A white paper drawn up under MiCA must give the outcome of any audit of the technology, as what a crypto whitepaper commits to sets out. That makes the result a disclosure the offeror answers for, which a logo on a landing page is not.
The audit code on this site’s protocol pages
Each protocol page reached from the DeFi protocols table shows a fact headed “DefiLlama audit code”, taken from a field in DefiLlama’s protocol data. As of 22 November 2026, per DefiLlama, the snapshot behind the table holds 368 protocols. The code is 0 for 183 of them, 2 for 179 and 3 for five; for one the field is blank, and its page shows “n/a”. No protocol in the snapshot has a 1.
The code is not a count of reports. In DefiLlama’s public protocol list, read the same day, the field runs from 0 to 3 where it is filled in, across 9,091 entries, and the audit links beside it do not track the number. Aave V3 has a 2 and one link, to Aave’s own security page. Euler V2 has a 2 and seven links, while Euler Labs puts V2’s audits at “50+ to date”. Cetus CLMM, which is not in the snapshot, has a 0 and no links, although audits of its code are on record in the analyses of its exploit. DefiLlama’s documentation, as read on 22 November 2026, does not define the field. The safe reading is the one the protocol pages’ note gives: “An audit code says an audit was listed, not what it found.” A 0 does not show that no audit took place.
Audited, then drained
DefiLlama’s hacks record has no field saying whether a protocol had been audited, so no rate of audited protocols among victims can be computed from it. Its classes show something else. Of the 999 incidents it files against DeFi protocols, worth $9.3B in all as of 22 November 2026, per DefiLlama, 187 worth $2.7B, 28.7% of the value (computed), sit in four classes about keys, infrastructure, people and insiders: Key Compromise, Frontend & Infrastructure, Social Engineering and Rugpull. A review of contract code either does not examine those failures or, where they run through privileged roles, assumes them away. The incidents with written accounts on this site show how audited code fails in the rest.
Balancer V2 is the clearest case, because the auditor has written it up. The exploit of 3 November 2025 came through rounding in the pools’ maths. In its own analysis, Trail of Bits says the commit it reviewed in April 2021 did not contain the flaw, though the review found similar rounding issues. A review of another pool type that October flagged how those pools used the stable-pool maths library, rated “undetermined severity” because the team could not determine whether it was exploitable. When the firm reviewed the pools that were later drained, in September 2022, that library was explicitly out of scope. Trail of Bits says the pools were exploited through the same vulnerability it had reported.
At Euler, by Euler Labs’ account, the flaw arrived with a fix. Its post-mortem
says a white hat reported a small bug through the protocol’s bug bounty, one
that every previous auditor had missed. The patch, including a new function
called donateToReserves, went to the protocol’s most recent auditor, and by
July 2022 the bug was patched. The function, the account says, lacked a health
check to stop a user donating themselves into an unhealthy position, and nobody
spotted it at the time. In March 2023 an attacker used it to drain what Euler
Labs puts at about $197m; DefiLlama’s record lists Euler
V1 at $197.0M.
At Cetus, by Dedaub’s account, a fix broke when the code moved to another chain.
Dedaub’s
analysis
of the 2025 exploit says an OtterSec audit of an
earlier version written for Aptos identified a similar overflow vulnerability in
early 2023 and recommended switching to a function called checked_shlw with
overflow detection. When the team ported the code to Sui, Dedaub says, a bug was
introduced into that function. In its account, audits of the Sui version by
OtterSec and MoveBit did not find it, and a Zellic audit in April 2025 found
nothing beyond informational findings. Dedaub suggests the maths library may
have been out of scope.
Parity’s account of 2017 turns on code that was restructured after it was audited. Its post-mortem says the original multisig code had been audited, and that its restructured library had had no formal audit, although it had received many reviews. The self-destruct function that a user then triggered was, in Parity’s words, “a remainder of the original audited contract”. The library’s destruction froze the wallets that relied on it.
At Curve in 2023 the fault was in the compiler, not in the contracts’ source. Vyper’s post-mortem says versions 0.2.15, 0.2.16 and 0.3.0 produced malfunctioning re-entrancy guards, a bug that by its account went undetected for want of tests in the compiler and was fixed in 0.3.1 without its impact on protocols using those versions being realised. Curve pools compiled with them were, the post-mortem says, exploited in July 2023. A review of the source alone cannot catch a compiler that turns correct source into faulty bytecode.
Two more cases sit at either end. At Nomad, Immunefi’s analysis traces the 2022 bridge drain to a routine upgrade that marked a zero hash as a trusted root, so that on Immunefi’s reading the way in was a change to code that was already running; cross-chain bridge hacks has the details. And Halborn calls Cashio an unaudited project.
Reading an audit before relying on a protocol
None of this makes an audit worthless. It makes the report the thing to read, rather than the word.
- Find the report where the auditor publishes it, not only where the project links to it.
- Note the dates and the commit, and compare them with when the contracts in use were deployed and whether they have been upgraded since.
- Read the scope and the coverage limitations, and check that the contracts holding deposits are in it.
- Count the findings left open or accepted, and read the team’s reasons.
- Find out who can upgrade the contracts or change their parameters, since an audit assumes those people behave.
- Check whether a bug bounty runs now. An audit ended on a date; a bounty keeps paying people to look.
A protocol can pass every step and still fail. By the accounts above, Balancer, Euler and Cetus had all been audited, more than once, before they were drained. The note on this site’s protocol pages ends: “None of this is a measure of safety.”