mvx_flash_loan_patterns
OfficialAtomic lend-execute-verify pattern
Authormultiversx
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides a robust pattern for implementing atomic operations involving lending and borrowing assets within a single transaction, ensuring that all steps, from lending to repayment, are completed successfully or rolled back entirely.
Core Features & Use Cases
- Atomic Transactions: Guarantees that lending, execution of a callback, and repayment occur as a single, indivisible operation.
- Reentrancy Protection: Includes a guard to prevent recursive calls within the same operation.
- Shard Validation: Ensures operations are confined to the same blockchain shard to maintain atomicity.
- Endpoint Validation: Verifies that the callback endpoint is not a built-in function, preventing bypass of repayment logic.
- Repayment Verification: Confirms that the contract balance is sufficient for repayment after the callback.
- Use Case: Ideal for implementing flash loans, atomic swaps, or temporary asset grants where immediate repayment is critical.
Quick Start
Implement the atomic lend-execute-verify pattern using the provided Rust code snippet.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: mvx_flash_loan_patterns Download link: https://github.com/multiversx/mx-ai-skills/archive/main.zip#mvx-flash-loan-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.