Testing a Contract

For testing Vyper contracts we recommend the use of pytest along with one of the following frameworks:

Titanoboa

Titanoboa is a Vyper interpreter maintained by the Vyper team. It provides:

  • Fast execution for testing

  • Pretty tracebacks for debugging

  • Forking capabilities

  • Deployment features

Getting Started:

Note

For comprehensive examples and best practices, refer to the official Titanoboa documentation linked above.

Moccasin

Moccasin is a fast, Pythonic smart contract testing and development framework built on top of Titanoboa. It provides:

  • ZKsync built-in support

  • Named contracts for cleaner address management

  • Custom pytest markers for staging tests

  • Encrypted wallet support (no private keys in .env files)

  • GitHub and Python dependency installation

Getting Started: