Skip to content

Commit

Permalink
first commit def call doc
Browse files Browse the repository at this point in the history
  • Loading branch information
modship committed Jan 21, 2025
1 parent aaddbd0 commit 4893b7a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
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

0 comments on commit 4893b7a

Please sign in to comment.