Skip to content

Commit 06e48e0

Browse files
frolicvdrg
andauthored
feat(world): generate system libs (#3587)
Co-authored-by: V <vdrg@lattice.xyz>
1 parent b774ab2 commit 06e48e0

22 files changed

Lines changed: 1706 additions & 717 deletions

.changeset/dry-camels-accept.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@latticexyz/world": patch
3+
---
4+
5+
Added experimental system libraries for World systems for better ergonomics when interacting with core systems.
6+
7+
Note that these libraries are marked experimental as we may make breaking changes to their interfaces.
8+
9+
```solidity
10+
import { worldRegistrationSystem } from "@latticexyz/world/src/codegen/experimental/systems/WorldRegistrationSystemLib.sol";
11+
12+
// equivalent to `IBaseWorld(_world()).registerNamespace("hello")` but directly routed through `world.call` for better gas.
13+
worldRegistrationSystem.registerNamespace("hello");
14+
15+
// and makes delegation use cases easier
16+
worldRegistrationSystem.callFrom(_msgSender()).registerNamespace("hello");
17+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@latticexyz/store": patch
3+
---
4+
5+
Updated `IStoreRegistration` interface to allow calling `registerTable` with `keyNames` and `fieldNames` from `memory` rather than `calldata` so this can be called with names returned by table libraries.

docs/pages/world/reference/internal/init-module-implementation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function transferBalanceToAddress(
169169
[Git Source](https://github.com/latticexyz/mud/blob/main/packages/world/src/modules/init/implementations/StoreRegistrationSystem.sol)
170170

171171
**Inherits:**
172-
[System](/world/reference/system#system), [IWorldErrors](/world/reference/world-external#iworlderrors), [LimitedCallContext](/world/reference/internal/init-module#limitedcallcontext)
172+
[System](/world/reference/system#system), [IWorldErrors](/world/reference/world-external#iworlderrors), IStoreRegistration, [LimitedCallContext](/world/reference/internal/init-module#limitedcallcontext)
173173

174174
_This contract provides functionality for the registration of store-related resources within the World framework._
175175

0 commit comments

Comments
 (0)