# Vyper smart contract audit: from the compiler release to the code

URL: https://shield.quillaudits.com/languages/vyper/

A Vyper smart contract audit checks the logic of the contract like any EVM audit, and it also checks the compiler release the code is built with, because Vyper compiler bugs have shipped into deployed contracts. The review pins that release against the published advisories, re-enters every `@nonreentrant` function in tests, and looks hardest at the calls the lock does not cover. QuillShield audits Solidity today, so for Vyper code request a manual audit from QuillAudits.

**QuillShield doesn't support Vyper today.** It audits Solidity in Foundry projects. For Vyper code, [request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit).

Last updated 3 December 2026. 6 minute read. By the QuillAudits Team.

## What does a Vyper audit check that a Solidity audit doesn't?

Most of a Vyper review is the same work as any EVM audit: who can call each function, what state changes before each external call, where prices come from and which way each division rounds. What differs is that the language removes some Solidity risks by design, while the compiler release you build with has to be checked against its published advisories.

The Vyper docs list the design differences that change a review:

- Arithmetic and array accesses are bounds-checked at runtime, and [there is no way to disable the checks](https://docs.vyperlang.org/en/latest/solidity-differences.html).
- `@nonreentrant` is opt-in and uses one global lock that protects against same-contract reentrancy. It does not stop contract A calling contract B, which then calls back into A.
- There are no modifiers or inline assembly, and a module system replaces inheritance, with every override resolved at compile time.
- State-changing external calls need the `extcall` keyword and view calls need `staticcall`, so every external call is visible in the source.
- Storage arrays need a maximum size at compile time, and iterating an unbounded storage set can exceed the block gas limit.
- A token that returns nothing makes a typed `extcall` revert unless the call sets [`default_return_value`](https://docs.vyperlang.org/en/latest/interfaces.html), which the docs give as the way to handle ERC-20 tokens with the missing return value bug.

## Why does the compiler release matter so much in Vyper?

Bugs in the Vyper compiler have reached deployed contracts. The GitLab Advisory Database lists [48 advisories for the vyper package](https://advisories.gitlab.com/pkg/pypi/vyper) from 2020 to 2026, as checked on 3 December 2026. Several are rated Critical, among them memory corruption in `concat` (CVE-2024-22419), a bounds check bypass with negative array indexes (CVE-2024-24563) and an out-of-bounds write through augmented assignment (CVE-2025-27105). Each affects a range of releases, so the useful question for an audit is which advisories touch the exact release and the features your code uses.

| Protocol | Curve pools built with Vyper 0.2.15 to 0.3.0 |
| --- | --- |
| Date | 30 July 2023 |
| Chain | Ethereum |
| Loss | 6,106.65 WETH from the pETH/ETH pool alone, about $11M at the time, and $61.7M to $69.3M across the affected pools, by source |
| What happened | Attackers drained several Curve pools, among them pETH/ETH, msETH/ETH, alETH/ETH and CRV/ETH, because Vyper 0.2.15, 0.2.16 and 0.3.0 compiled a declared reentrancy lock that did not work. The pools declared the lock in their source, but the compiled code did not enforce it across functions. Vyper 0.3.1 had already fixed it. |
| Sources | [LlamaRisk](https://hackmd.io/@LlamaRisk/BJzSKHNjn), [Vyper team](https://hackmd.io/@vyperlang/HJUgNMhs2), [Dedaub](https://dedaub.com/blog/solidity-security-vulnerabilities/), [CoinDesk](https://www.coindesk.com/markets/2023/08/04/looter-behind-61m-curve-hack-starts-returning-assets-raising-hope-for-recovery/), [CertiK](https://www.certik.com/resources/blog/2qbPMcyJpR5UfoKrcjWxlQ-vyper-incident-anaylsis) |

The advisory behind that loss is CVE-2023-39363, which covers named reentrancy locks allocated incorrectly in versions 0.2.15 to 0.3.0. The [Curve post-mortem](https://hackmd.io/@LlamaRisk/BJzSKHNjn) and the [Vyper post-mortem](https://hackmd.io/@vyperlang/HJUgNMhs2) trace each loss to it, and estimates of the total run from $61.7M ([CoinDesk](https://www.coindesk.com/markets/2023/08/04/looter-behind-61m-curve-hack-starts-returning-assets-raising-hope-for-recovery/)) to about $69.3M ([CertiK](https://www.certik.com/resources/blog/2qbPMcyJpR5UfoKrcjWxlQ-vyper-incident-anaylsis)). In any language, a declared guard is not proof of a working one, and only a test that re-enters the compiled code shows the difference.

The Vyper release notes for 0.3.0 [strongly recommend version 0.3.1 or higher](https://docs.vyperlang.org/en/latest/release-notes.html), and version 0.4.0, released on 20 June 2024, removed named reentrancy locks and introduced the module system. Moving code across those releases changes how locks and imports behave, so treat a compiler upgrade as a code change that needs review. The Vyper team publishes audits of the compiler itself in [vyperlang/audits](https://github.com/vyperlang/audits), and the v0.4.2 release, for example, was reviewed by ChainSecurity and by Anatomist in April 2025.

## What are the main Vyper security vulnerabilities?

The table lists the classes a Vyper review spends its time on, with the page that explains each one in Solidity terms. The mechanics carry over, and the middle column says what changes in Vyper.

| Bug class | What goes wrong in Vyper | What to check |
| --- | --- | --- |
| Compiler bugs | A release compiles correct-looking source into code that behaves differently, as the 0.2.15 to 0.3.0 locks did. | Pin one release and read every advisory that affects it. |
| [Reentrancy](https://shield.quillaudits.com/learn/vulnerabilities/reentrancy/) across contracts | `@nonreentrant` covers the contract it is in, so a callback into another contract of the protocol is not stopped. | Map every external call and the contracts it can reach. |
| [Read-only reentrancy](https://shield.quillaudits.com/learn/vulnerabilities/read-only-reentrancy/) | A view returns a value from the middle of an update, such as a pool price, and another protocol reads it. | Which of your views do other protocols read during your external calls? |
| Token return values | A token that returns nothing makes a typed call revert unless `default_return_value` is set. | List every token the contract calls and what its transfer functions return. |
| [Unchecked external call](https://shield.quillaudits.com/learn/vulnerabilities/unchecked-external-call/) | A low-level `raw_call` whose result is ignored hides a failed transfer. | Is the result of every `raw_call` checked, or allowed to revert? |
| [Denial of service](https://shield.quillaudits.com/learn/vulnerabilities/denial-of-service/) | A loop over an unbounded storage set can exceed the block gas limit. | Can any loop or array grow with user input? |
| [Rounding and precision](https://shield.quillaudits.com/learn/vulnerabilities/rounding-precision-errors/) | Pool and pricing math divides in many places, and each rounding direction moves value. | Does each division round in favor of the pool? |
| [Access control](https://shield.quillaudits.com/learn/vulnerabilities/access-control/) | An `@external` function that sets fees, pauses or moves funds has no owner check. | List every `@external` function and who may call it. |
| [Oracle price manipulation](https://shield.quillaudits.com/learn/vulnerabilities/oracle-price-manipulation/) | The spot price of a pool is read by another contract while one transaction can still move it. | Where does each price your contracts use come from? |

## Which tools exist for Vyper security?

- [Titanoboa](https://github.com/vyperlang/titanoboa): a Vyper interpreter maintained by the Vyper team, for tests written in Python. The [Vyper docs on testing](https://docs.vyperlang.org/en/latest/testing-contracts.html) recommend [pytest](https://docs.pytest.org/en/latest/contents.html) as the test runner.
- [Moccasin](https://github.com/Cyfrin/moccasin): a Pythonic smart contract testing and development framework from Cyfrin, built on top of Titanoboa.
- [Slither](https://github.com/crytic/slither): a static analysis framework that [Trail of Bits describes](https://trailofbits.com/tools/slither/) as built for Solidity and Vyper.
- [The vyper advisory list](https://advisories.gitlab.com/pkg/pypi/vyper): every published compiler advisory, to check against the release you pin.
- [vyperlang/audits](https://github.com/vyperlang/audits): third-party reviews of the compiler itself, by year.

Tools find known patterns, but they can't tell you whether the invariant of a pool holds under every sequence of calls, so pair them with tests that re-enter each guarded function and fuzz the math against the invariant the design promises.

## Can QuillShield audit Vyper?

QuillShield does not audit Vyper today. It supports Solidity, for Foundry projects, and its full audit and pull request checks don't cover Vyper code. For a Vyper protocol, [request a manual audit from QuillAudits](https://www.quillaudits.com/smart-contract-audit), the audit firm that makes QuillShield, which has audited 1,500+ protocols since 2018 and is ISO/IEC 27001:2022 certified.

If your system also has Solidity contracts in a Foundry project, the [Solidity audit page](https://shield.quillaudits.com/languages/solidity/) covers what QuillShield checks there and what it costs. For how a manual review and an AI review split the work, see [AI audit vs manual audit](https://shield.quillaudits.com/blog/ai-audit-vs-manual-audit/).

**[Talk to an auditor](https://calendly.com/akshadh-a-quillaudits/30min) about the scope and timing of a manual Vyper audit.**

## What should you check before a Vyper audit?

- Which exact compiler release builds each contract, and which advisories affect it?
- Does a test re-enter every `@nonreentrant` function and expect a revert?
- Which external calls can reach another contract of yours, outside the lock?
- Does every call to a token that may return nothing set `default_return_value`?
- Does every loop and storage array have a bound that user input can't push past the gas limit?
- Which views do other protocols read as prices, and can they return a mid-update value?
- If the code moved to 0.4, were the lock and module changes reviewed as code changes?

## FAQ

### Is Vyper safer than Solidity?

Vyper removes some risks by design: arithmetic and array bounds are always checked, and there are no modifiers or inline assembly. Its compiler has had serious bugs, though, with [48 published advisories](https://advisories.gitlab.com/pkg/pypi/vyper) and the 2023 Curve losses, so the release you pin matters as much as the code.

### Which Vyper version should a contract use?

Use one exact release that you have checked against every published advisory, and record it in the audit scope. The Vyper release notes recommend 0.3.1 or higher over 0.3.0, and 0.4.0 changed reentrancy locks and added modules, so an upgrade across those releases needs review.

### Does @nonreentrant stop all reentrancy in Vyper?

The lock is opt-in and protects against same-contract reentrancy only, so a callback into another contract of your protocol is not covered, and cross-contract paths need their own guard or ordering.

### Can QuillShield audit Vyper contracts?

QuillShield supports Solidity in Foundry projects today, so for Vyper, request a manual audit from QuillAudits.

## Sources

- [Differences from Solidity, Vyper documentation, Vyper team](https://docs.vyperlang.org/en/latest/solidity-differences.html) · checked 3 December 2026
- [Interfaces, Vyper documentation, Vyper team](https://docs.vyperlang.org/en/latest/interfaces.html) · checked 3 December 2026
- [Testing a contract, Vyper documentation, Vyper team](https://docs.vyperlang.org/en/latest/testing-contracts.html) · checked 3 December 2026
- [Release notes, Vyper documentation, Vyper team](https://docs.vyperlang.org/en/latest/release-notes.html) · checked 3 December 2026
- [Advisories for the vyper package, GitLab Advisory Database](https://advisories.gitlab.com/pkg/pypi/vyper) · checked 3 December 2026
- [vyperlang/audits, Vyper team](https://github.com/vyperlang/audits) · checked 3 December 2026
- [Curve's post-mortem of the 30 July 2023 exploits, LlamaRisk](https://hackmd.io/@LlamaRisk/BJzSKHNjn) · checked 3 December 2026
- [Vyper's technical post-mortem of the reentrancy lock bug, Vyper team](https://hackmd.io/@vyperlang/HJUgNMhs2) · checked 3 December 2026
- [Solidity security vulnerabilities: a 2026 guide, Dedaub](https://dedaub.com/blog/solidity-security-vulnerabilities/) · checked 3 December 2026
- [Looter Behind $61M Curve Hack Starts Returning Assets, Raising Hope for Recovery, CoinDesk](https://www.coindesk.com/markets/2023/08/04/looter-behind-61m-curve-hack-starts-returning-assets-raising-hope-for-recovery/) · checked 3 December 2026
- [Vyper Incident Analysis, CertiK](https://www.certik.com/resources/blog/2qbPMcyJpR5UfoKrcjWxlQ-vyper-incident-anaylsis) · checked 3 December 2026
- [Titanoboa, Vyper team](https://github.com/vyperlang/titanoboa) · checked 3 December 2026
- [Moccasin, Cyfrin](https://github.com/Cyfrin/moccasin) · checked 3 December 2026
- [pytest documentation, pytest](https://docs.pytest.org/en/latest/contents.html) · checked 3 December 2026
- [Slither, Trail of Bits](https://github.com/crytic/slither) · checked 3 December 2026
- [Slither, Solidity and Vyper static analysis, Trail of Bits](https://trailofbits.com/tools/slither/) · checked 3 December 2026
