Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

multiversx-spec-compliancemultiversx 规范合规性

Agent Skill

multiversx-spec-compliance 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

499

周安装

20

GitHub Stars

11

下载量

162
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:multiversx-spec-compliance(multiversx 规范合规性)
来源仓库:https://github.com/multiversx/mx-ai-skills
仓库路径:skills/multiversx-spec-compliance
安装命令:
npx skills add https://github.com/multiversx/mx-ai-skills --skill multiversx-spec-compliance
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/multiversx/mx-ai-skills --skill multiversx-spec-compliance

简介

用于查找、检索和筛选相关信息,验证是否符合 MultiversX 规范。

  • 适合在开发或审计时对照技术标准进行检查。
  • 可结合官方文档生成合规性报告,但需人工确认例外情况。
  • 安装命令:npx skills add https://github.com/multiversx/mx-ai-skills --skill multiversx-spec-compliance。
  • 注意规范更新频率,避免使用过时的标准版本。

SKILL.md

Specification Compliance Verification

Ensure that MultiversX smart contract implementations match their intended design as specified in whitepapers, technical specifications, and MultiversX Improvement Proposals (MIPs). This skill bridges the gap between documentation and code.

When to Use

  • Auditing contracts against their whitepapers
  • Verifying tokenomics implementations
  • Checking MIP standard compliance
  • Validating economic formulas and constraints
  • Reviewing upgrade proposals against specs

1. Verification Process Overview

Inputs Required

InputDescriptionSource
CodeRust implementationsrc/*.rs
SpecificationDesign documentwhitepaper.pdf, README.md, specs/
MIP ReferenceStandard requirementsMultiversX MIPs

Process Flow

1. Extract Claims → List all requirements from spec
2. Map to Code   → Find implementing code for each claim
3. Verify Logic  → Confirm implementation matches spec
4. Document      → Record findings and deviations

2. Claim Extraction

Specification Language Keywords

Extract statements containing these keywords:

KeywordMeaningExample
MUSTRequired"Users MUST stake minimum 100 tokens"
MUST NOTForbidden"Admin MUST NOT withdraw user funds"
SHOULDRecommended"Contract SHOULD emit events"
SHALLObligation"Rewards SHALL be calculated daily"
MAYOptional"Users MAY delegate to multiple validators"

Example Claim Extraction

From Whitepaper:

"The staking contract MUST enforce a minimum stake of 1000 EGLD. Rewards MUST be calculated using APY = base_rate * (1 + boost_factor). Users MUST NOT be able to withdraw during the lock period."

Extracted Claims:

1. [MUST] Minimum stake: 1000 EGLD
2. [MUST] Reward formula: APY = base_rate * (1 + boost_factor)
3. [MUST NOT] Withdrawal during lock period

Claim Documentation Template

| ID | Type | Claim | Source | Code Location | Status |
|----|------|-------|--------|---------------|--------|
| C1 | MUST | Min stake 1000 EGLD | WP §3.1 | stake.rs:45 | Verified |
| C2 | MUST | APY formula | WP §4.2 | rewards.rs:78 | Deviation |
| C3 | MUST NOT | Lock withdrawal | WP §3.3 | withdraw.rs:23 | Verified |

3. Code Mapping

Finding Implementing Code

For each claim, locate the relevant code:

// Claim C1: Min stake 1000 EGLD
// Location: src/stake.rs:45

const MIN_STAKE_EGLD: u64 = 1000;  // 1000 EGLD (whole units)
const DECIMALS: u32 = 18;

#[payable("EGLD")]
#[endpoint]
fn stake(&self) {
    let payment = self.call_value().egld();
    let min_stake_wei = BigUint::from(MIN_STAKE_EGLD) * BigUint::from(10u64).pow(DECIMALS);
    require!(
        *payment >= min_stake_wei,
        "Minimum stake is 1000 EGLD"  // ← Implements C1
    );
    // ...
}

Mapping Checklist

For each claim:

  • Code location identified
  • Implementation logic understood
  • Constants/values match spec
  • Edge cases handled per spec

4. Verification Techniques

Formula Verification

Spec:

"APY = base_rate * (1 + boost_factor)"

Code Review:

fn calculate_apy(&self, base_rate: BigUint, boost_factor: BigUint) -> BigUint {
    // Verify this matches: APY = base_rate * (1 + boost_factor)

    let one = BigUint::from(PRECISION);  // Check: What is PRECISION?
    let boost_multiplier = &one + &boost_factor;
    let apy = &base_rate * &boost_multiplier / &one;

    // QUESTION: Is division by PRECISION correct? Spec doesn't mention it.
    // FINDING: Precision handling not in spec - potential deviation

    apy
}

Constraint Verification

Spec:

"Users MUST NOT withdraw during the lock period of 7 days"

Code Review:

#[endpoint]
fn withdraw(&self) {
    let stake_time = self.stake_timestamp(&caller).get(); // TimestampMillis
    let current_time = self.blockchain().get_block_timestamp_millis();
    let lock_period = self.lock_period().get();  // DurationMillis - Check: Is this 7 days?

    require!(
        current_time >= stake_time + lock_period,
        "Lock period not elapsed"
    );
    // ...
}

// VERIFICATION NEEDED:
// 1. Is lock_period initialized to 7 days (604800 seconds)?
// 2. Is lock_period immutable or can admin change it?
// 3. Can this be bypassed through any other endpoint?

State Transition Verification

Spec:

"State transitions: INACTIVE → ACTIVE → COMPLETED"

Code Review:

#[derive(TopEncode, TopDecode, TypeAbi, PartialEq)]
pub enum State {
    Inactive,
    Active,
    Completed,
}

fn activate(&self) {
    let current = self.state().get();
    require!(current == State::Inactive, "Can only activate from Inactive");
    self.state().set(State::Active);
}

fn complete(&self) {
    let current = self.state().get();
    require!(current == State::Active, "Can only complete from Active");
    self.state().set(State::Completed);
}

// VERIFICATION:
// ✓ Inactive → Active (activate)
// ✓ Active → Completed (complete)
// ? Is there a way to go backwards? (Should not be allowed)
// ? Can state be set directly? (Search for .set(State::))

5. MultiversX MIP Compliance

Common MIPs to Verify

MIPTopicKey Requirements
MIP-2Semi-Fungible TokensSFT metadata format, royalties
MIP-3Dynamic NFTsAttribute update mechanisms
MIP-4RoyaltiesRoyalty calculation and distribution

MIP-2 SFT Compliance Example

Requirements:

  • Token type must be SFT (nonce > 0, quantity > 1 allowed)
  • Metadata format follows standard
  • Royalties encoded correctly

Verification:

// Check NFT creation follows MIP-2

#[endpoint]
fn create_sft(&self, ...) -> u64 {
    // VERIFY: Using NonFungibleTokenMapper correctly
    let nonce = self.sft_token().nft_create(
        initial_quantity,  // MIP-2: Must allow quantity > 1
        &SftAttributes {
            // MIP-2: Required attributes
            name: ...,
            royalties: ...,  // In basis points (0-10000)
            hash: ...,
            attributes: ...,
            uris: ...,
        }
    );
    nonce
}

6. Tokenomics Verification

Common Tokenomics Claims

Claim TypeExampleVerification
Total SupplyMax 1B tokensCheck mint constraints
Inflation Rate5% annuallyVerify mint formula
Burn Rate1% per transferCheck fee calculation
Distribution40% communityVerify initial allocation

Example: Inflation Verification

Spec:

"Annual inflation rate is 5%, calculated per epoch"

Code Review:

const ANNUAL_INFLATION_BPS: u64 = 500;  // 5% = 500 basis points
const EPOCHS_PER_YEAR: u64 = 365;       // Assuming daily epochs

fn calculate_epoch_inflation(&self) -> BigUint {
    let total_supply = self.total_supply().get();
    let epoch_rate = ANNUAL_INFLATION_BPS / EPOCHS_PER_YEAR;

    // VERIFICATION:
    // 500 / 365 = 1.369... but integer division = 1
    // This is LESS than 5% annually (365 * 1 = 365 bps = 3.65%)
    // FINDING: Integer precision loss causes ~27% less inflation than spec

    &total_supply * BigUint::from(epoch_rate) / BigUint::from(10000u64)
}

7. Deviation Handling

Deviation Categories

CategorySeverityAction
CriticalBreaks core functionalityMust fix
MajorSignificant differenceShould fix
MinorSlight variationDocument
EnhancementBeyond specDocument

Deviation Report Template

## Deviation Report

### DEV-001: Inflation Calculation Precision Loss

**Claim**: Annual inflation rate is 5%
**Source**: Whitepaper §5.2
**Code**: rewards.rs:calculate_epoch_inflation()

**Expected**: 5.00% annual inflation
**Actual**: 3.65% annual inflation

**Root Cause**: Integer division of basis points by epochs
loses precision (500/365 = 1, not 1.369)

**Impact**: ~27% less inflation than documented

**Recommendation**: Use scaled arithmetic

// Instead of: let epoch_rate = ANNUAL_INFLATION_BPS / EPOCHS_PER_YEAR;

// Use: let scaled_annual = BigUint::from(ANNUAL_INFLATION_BPS) * &total_supply; let epoch_inflation = scaled_annual / BigUint::from(EPOCHS_PER_YEAR) / BigUint::from(10000u64);


**Severity**: Major **Status**: Open

8. Compliance Report Template

# Specification Compliance Report

**Project**: [Name]
**Specification Version**: [Version]
**Code Version**: [Commit/Tag]
**Date**: [Date]
**Auditor**: [Name]

## Executive Summary
[Brief overview of compliance status]

## Specification Coverage

| Section | Claims | Verified | Deviations | Not Found |
|---------|--------|----------|------------|-----------|
| §3 Staking | 12 | 10 | 1 | 1 |
| §4 Rewards | 8 | 7 | 1 | 0 |
| §5 Governance | 5 | 5 | 0 | 0 |
| **Total** | **25** | **22** | **2** | **1** |

## Verified Claims
[List of all verified claims with code references]

## Deviations
[Detailed deviation reports]

## Unimplemented Claims
[Claims from spec not found in code]

## MIP Compliance
| MIP | Status | Notes |
|-----|--------|-------|
| MIP-2 | Compliant | - |
| MIP-4 | Partial | Royalty distribution differs |

## Recommendations
1. [Priority recommendation]
2. [Second priority]

## Conclusion
[Overall compliance assessment]

9. Best Practices

  1. Get the right spec version: Ensure code and spec versions match
  2. Document assumptions: When spec is ambiguous, document interpretation
  3. Test boundary values: Verify spec limits are correctly implemented
  4. Check units: EGLD vs wei, seconds vs epochs, basis points vs percentages
  5. Verify precision: BigUint calculations should maintain precision
  6. Review change history: Check if spec evolved and code was updated

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.53%
按下载量换算58

Claude

28.7%
按下载量换算46

Cursor

18.33%
按下载量换算30

Gemini CLI

10.5%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills