Skip to content

Commit

Permalink
feat(world): generate system libs (#3587)
Browse files Browse the repository at this point in the history
Co-authored-by: V <[email protected]>
  • Loading branch information
frolic and vdrg authored Feb 11, 2025
1 parent b774ab2 commit 06e48e0
Show file tree
Hide file tree
Showing 22 changed files with 1,706 additions and 717 deletions.
17 changes: 17 additions & 0 deletions .changeset/dry-camels-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@latticexyz/world": patch
---

Added experimental system libraries for World systems for better ergonomics when interacting with core systems.

Note that these libraries are marked experimental as we may make breaking changes to their interfaces.

```solidity
import { worldRegistrationSystem } from "@latticexyz/world/src/codegen/experimental/systems/WorldRegistrationSystemLib.sol";
// equivalent to `IBaseWorld(_world()).registerNamespace("hello")` but directly routed through `world.call` for better gas.
worldRegistrationSystem.registerNamespace("hello");
// and makes delegation use cases easier
worldRegistrationSystem.callFrom(_msgSender()).registerNamespace("hello");
```
5 changes: 5 additions & 0 deletions .changeset/lovely-seahorses-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/store": patch
---

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.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function transferBalanceToAddress(
[Git Source](https://github.com/latticexyz/mud/blob/main/packages/world/src/modules/init/implementations/StoreRegistrationSystem.sol)

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

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

Expand Down
Loading

0 comments on commit 06e48e0

Please sign in to comment.