World
Batch Calls

Batch calls

Batch calls allow a single call to the World to perform multiple System calls. Using batchCall (opens in a new tab) you can issue calls on your own behalf. If you have the proper delegations, you can also use batchCallFrom (opens in a new tab) 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.

The advantage of using batchCall rather than the standard multicall (opens in a new tab) is that batchCall is a native MUD function that lives in the World contract, so it does not change msg.sender. As a result, when you use batchCall MUD can apply access control, and Systems can rely on the value of _msgSender().