mvx_sc_best_practices

Guide MultiversX smart contract development with multiversx-sc best practices.

12|5|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/multiversx/mx-ai-skills --skill mvx-sc-best-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mvx_sc_best_practices
Source: https://github.com/multiversx/mx-ai-skills/tree/main/antigravity/skills/mvx_sc_best_practices
Command: npx skills add https://github.com/multiversx/mx-ai-skills --skill mvx-sc-best-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill provides expert guidance to help developers write secure, gas-efficient, and idiomatic smart contracts on the MultiversX blockchain, preventing common pitfalls and optimizing resource usage.

Core Features & Use Cases

  • Storage Optimization: Learn the most cost-effective ways to manage on-chain storage.
  • Security Patterns: Implement robust arithmetic safety, reentrancy guards, and access control.
  • Testing & Deployment: Understand best practices for testing with Mandos and using the transfer-execute pattern.
  • Use Case: A developer is unsure about the best way to store a list of user addresses. This skill will guide them to use UnorderedSetMapper for efficient membership checks and prevent gas-loop DoS vectors.

Quick Start

Use the mvx_sc_best_practices skill to understand how to optimize storage for a list of user scores.

Frequently Asked Questions about mvx_sc_best_practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent reentrancy attacks in a MultiversX Rust smart contract?

To prevent reentrancy attacks in a MultiversX Rust smart contract, implement the Checks-Effects-Interactions pattern. This ensures state changes are fully applied before any external calls are made, protecting against malicious re-entry.

How do I optimize gas usage for MultiversX smart contract storage?

Optimize gas usage for MultiversX smart contract storage by utilizing cache-based gas optimization patterns and selecting efficient mappers like `SingleValueMapper` or `VecMapper`. This reduces redundant read and write operations on-chain.

How does Mandos testing work for MultiversX smart contracts?

Mandos testing for MultiversX smart contracts works by executing whitebox scenarios to validate contract logic and state transitions. It provides a framework to simulate blockchain interactions and verify expected outcomes during development.

Why should I use BigUint for arithmetic safety in MultiversX Rust contracts?

You should use `BigUint` for arithmetic safety in MultiversX Rust contracts to handle large numeric values securely. It prevents overflow and underflow vulnerabilities that can occur with standard integer types during token calculations.

What are common pitfalls with token identifier validation in MultiversX smart contracts?

Common pitfalls with token identifier validation in MultiversX smart contracts include failing to verify the token type before processing transfers. Proper validation ensures contracts only interact with expected tokens, preventing unauthorized asset manipulation.