Skip to content

Deferred calls #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/learn/asc/deferred-calls.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
id: deferred-calls
sidebar_label: Deferred calls
---

# Deferred Calls


TODO


Massa is the first blockchain to implement Deferred Calls in smart contracts ? 🚀

This unique feature lets developers schedule actions in the future, enabling advanced automation and seamless interactions between DApps.

Deferred Calls, unlocking powerful capabilities for smart contracts to execute advanced, time-sensitive actions autonomously.
28 changes: 28 additions & 0 deletions docs/learn/asc/vs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
id: versus
sidebar_label: Async msg vs Deferred Calls
---

# Asynchronous Messages vs Deferred Calls


When developing dApps on the Massa blockchain, it's essential to choose the right method interacting in automated ways with the blockchain.This documentation presents the differences between these two approaches and explains when to use each.

## Async Msg
Async Msg are used to send asynchronous messages to smart contracts. They're ideal for cases where a smart contract needs to perform an action in the future without waiting for a response. However, please note that the execution of Async Msg is not guaranteed.


## Deferred Calls

Deferred Calls are used to schedule calls to smart contracts at a later time. The key difference between Deferred Calls and Async Msg is that Deferred Calls guarantee the execution of the scheduled call, provided that the reservation fees have been paid. This means that the call will be executed at the specified time (Slot), and the blockchain will ensure that the execution is attempted once. If the call fails for any reason, it will not be retried.


## Comparison

The following table highlights the main differences between the two methods:

| **Feature** | **Async Msg** | **Deferred Calls** |
| --- | --- | --- |
| **Execution Guarantee** | No | Yes (if reservation fees are paid) |
| **Use Cases** | Running an autonomous AI, evolving NFTs | Trading bot, Detecting and liquidating under-collateralized positions, advancing game state, Transfert liquidity |
| **Benefits** | Enables asynchronous communication between smart contracts | Guarantees the execution of scheduled calls |
8 changes: 8 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ const sidebars = {
type: "doc",
id: "learn/asc/massa-asc",
},
{
type: "doc",
id: "learn/asc/deferred-calls",
},
{
type: "doc",
id: "learn/asc/versus",
},
{
type: "doc",
id: "learn/asc/use-cases",
Expand Down
Loading