multiversx-property-testing_skill

This skill helps you design and execute property-based tests for MultiversX smart contracts, uncovering edge cases with random inputs and invariants.

10

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill multiversx/mx-ai-skills --skill multiversx-property-testing

  • SKILL.md10.4 KB

Overview

This skill uses property-based testing and fuzzing to discover edge cases and invariant violations in MultiversX smart contract logic. It shows how to set up proptest and cargo-fuzz, design invariants and stateful models, and convert failing cases into reproducible scenario tests. The goal is faster, safer contracts by finding unexpected behavior that unit tests miss.

How this skill works

The skill generates randomized inputs and operation sequences to exercise contract logic and check invariants such as conservation, bounds, and idempotency. It uses proptest strategies and stateful testing to model expected outcomes and compare them to contract behavior. For deeper exploration it shows how to run LLVM-based fuzzers with cargo-fuzz and how to seed and shrink failing cases into minimal repro scenarios.

When to use it

  • When building comprehensive test suites for smart contracts
  • When verifying invariants (e.g., total supply, monotonicity, bounds)
  • When testing complex state machines or multi-step flows
  • When searching for input handling bugs or overflow/underflow issues
  • When converting hard-to-reproduce bugs into deterministic scenario tests

Best practices

  • Start with simple, well-documented invariants such as conservation or bounds
  • Use custom strategies to model valid addresses, token IDs, and safe numeric ranges
  • Leverage proptest shrinking to get minimal failing inputs for debugging
  • Seed fuzz corpora with known edge cases and run fuzzers continuously
  • Run property tests and fuzzing in CI and document intended failure modes

Example use cases

  • Verify that deposit and transfer operations conserve total supply across random amounts and sequences
  • Fuzz deposit functions with arbitrary byte input to ensure no panics and invariant preservation
  • Stateful testing of deposit/withdraw/transfer sequences to compare a model state with contract state
  • Boundary testing for numeric limits and overflow handling with explicit acceptance/rejection checks
  • Generate scenario tests from failing operation sequences to reproduce bugs in integration environments

FAQ

Yes. Add proptest as a dev-dependency and multiversx-sc-scenario for contract scenarios. For fuzzing, install cargo-fuzz and initialize fuzz targets.

How do I avoid false positives from random inputs?

Use prop_assume to enforce preconditions, craft strategies that reflect valid domain constraints, and seed known-good cases to guide generation.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
multiversx-property-testing skill by multiversx/mx-ai-skills | VeilStrat