Skip to content

A library to write verification harnesses for the Solana Certora Prover

Notifications You must be signed in to change notification settings

Certora/solana-cvt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ca085df · Jan 13, 2025

History

69 Commits
Jan 8, 2025
Sep 2, 2024
Jan 8, 2025
Sep 2, 2024
Jan 26, 2024
Jan 13, 2025
Jan 8, 2025
Jan 8, 2025
Jan 8, 2025
Jan 9, 2025
Jan 26, 2024
Jan 8, 2025
Oct 23, 2024

Repository files navigation

Solana Certora Verification Tool (CVT)

This workspace defines a set of functions and macros that can be called from Solana programs to create non-deterministic environments, add assumptions, check properties, call summaries, etc.

It includes the following crates:

  • vectors: Define simpler implementions of Vec to be used during verification. Probably the most useful implementation is NoResizableVec.

  • cvt: convenient macros (cvt_assert!, cvt_assume!, cvt_satisfy!, cvt_vacuity_check!, etc) to be used for writing specs.

  • cvt_macro: definition of macro attribute #[rule]. This attribute tells the Solana prover that the function is a rule.

  • early_panic: definition of macro attribute #[early_panic]. This macro replaces ? with unwrap. It helps the prover by removing error paths.

  • hook_macro - Defines macros for inserting hooks at the beginning and end of functions.

  • nondet: Definition of Nondet trait for Rust types such as numbers, pointers, etc and also for common Solana specific types such as AccountInfo, Pubkey, spl_token::state::Mint, etc. You can also add #[derive(Nondet)] for simple user-defined Rust struct. The Nondet traits provides the function nondet().

  • solana_cvt: summaries for SPL Token instructions such as transfer, mint_to, and burn. It also contains mocks for solana_program::Clock.

  • calltrace - Defines macros to print values in the Solana's prover calltrace.