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

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.

Last updated . 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.
  • @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, 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 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, Vyper team, Dedaub, CoinDesk, CertiK

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 and the Vyper post-mortem trace each loss to it, and estimates of the total run from $61.7M (CoinDesk) to about $69.3M (CertiK). 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, 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, 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 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 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 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 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 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 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 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?

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, 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 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.

Talk to an auditor 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 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

QuillShield is building the security layer between AI and money, so you can keep shipping between audits.

Sign-up is free, and new accounts get $50 in credit, good for up to half of an order.

  1. 1Sign up and import a repo
  2. 2See the exact price before anything is charged
  3. 3Approve it, and the audit starts