A pattern for operations that temporarily lend assets, execute an external callback, and verify repayment — all atomically within a single transaction.
You want to lend tokens to a contract, let it execute arbitrary logic, and guarantee repayment (plus fee) before the transaction completes. If repayment fails, the entire transaction reverts.
| Flash loans | Yes — the canonical use case | | Atomic swaps with verification | Yes — send tokens, verify counterparty sent back | | Temporary grants (execute-then-return) | Yes — lend tokens for computation, verify return | | Cross-shard operations | No — atomicity requires same-shard | | Simple transfers | No — overkill |
Modello atomico di prestito-esecuzione-verifica per contratti intelligenti MultiversX. Da utilizzare quando si creano prestiti flash, swap atomici, sovvenzioni temporanee o qualsiasi operazione che presta beni, esegue una richiamata e verifica il rimborso all'interno di una singola transazione. Fonte: multiversx/mx-ai-skills.