Skip to content

Commit

Permalink
docs(world): add batch-calls to new docs (#1848)
Browse files Browse the repository at this point in the history
Co-authored-by: alvarius <[email protected]>
  • Loading branch information
qbzzt and alvrs authored Nov 3, 2023
1 parent e255867 commit 81d44f4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions next-docs/pages/world/batch-calls.mdx
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# Batch calls

Batch calls allow a single call to the `World` to perform multiple `System` calls.
Using [`batchCall`](https://github.com/latticexyz/mud/blob/main/packages/world/src/modules/core/implementations/BatchCallSystem.sol#L15-L33) you can issue calls on your own behalf.
If you have the proper [delegations](/world/account-delegation), you can also use [`batchCallFrom`](https://github.com/latticexyz/mud/blob/main/packages/world/src/modules/core/implementations/BatchCallSystem.sol#L35-L53) to issue `System` calls on behalf of other addresses.

The calls take place sequentially, and after they all finish successfully you get back the return values from all of them.
If any of the calls revert, so does `batchCall` / `batchCallFrom`, so all the state changes created by the previous calls are discarded.

0 comments on commit 81d44f4

Please sign in to comment.