← Protocols
Vyper
01Description

Pythonic, intentionally minimal smart-contract language for the EVM. Trades expressivity for auditability — no inheritance, no inline assembly (by default), bounded loops, and explicit storage.

02Best for
  • 01auditable financial primitives
  • 02Curve-style AMMs
  • 03high-assurance contracts
  • 04Python-fluent teams
  • 05minimal-attack-surface vaults
03Install
  • pipx install vyper
  • pip install snekmate titanoboa
05Prompt snippet
Use Vyper when audit-readability matters more than feature surface. Compile with `vyper contracts/Token.vy` (or `vyper -f abi,bytecode contracts/Token.vy`). For testing, use Titanoboa (`pip install titanoboa`) — `import boa; c = boa.load("contracts/Token.vy"); c.transfer(addr, 1)`. For battle-tested building blocks (ERC20/721/4626, ownership, Merkle) import from `snekmate`. Hardhat users can use `@nomiclabs/hardhat-vyper`; Foundry users can compile via `forge build --use vyper:0.4.x` after installing the binary.
06Gotchas
  • Vyper deliberately omits features that exist in Solidity: no inheritance, no recursive functions, no unbounded loops, no inline `assembly` (raw_call only), and limited generics. Porting a Solidity codebase usually requires redesign, not translation.
  • Compiler ABI is not 100% bug-for-bug compatible across minor versions — historic 0.2.x → 0.3.x → 0.4.x bumps changed decorator names (`@external` vs `@public`), interface syntax, and storage layout. Always pin `# @version 0.4.x` and pin the binary in CI.
  • Tooling ecosystem is smaller: Slither/Echidna/Halmos work but with reduced detector coverage; many Foundry cheatcodes assume Solidity stack traces. Use Titanoboa or Ape for first-class testing.
  • Storage layout differs from Solidity (different padding/packing rules) — never deploy a Vyper implementation behind a proxy that previously held a Solidity contract without an explicit layout migration.
  • A high-impact reentrancy bug was disclosed in Vyper 0.2.15–0.3.0 in 2023; treat any version pin in legacy code as a security finding and upgrade to a patched 0.4.x release.
07Alternatives