Skip to content

Commit

Permalink
fix example PostDeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Aug 16, 2023
1 parent c94419d commit 57beee8
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 1,197 deletions.
18 changes: 11 additions & 7 deletions examples/minimal/packages/contracts/script/PostDeploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ contract PostDeploy is Script {

// Manually deploy a system with another namespace
ChatNamespacedSystem chatNamespacedSystem = new ChatNamespacedSystem();
IWorld(worldAddress).registerSystem("namespace", "ChatNamespaced", chatNamespacedSystem, true);
IWorld(worldAddress).registerFunctionSelector("namespace", "ChatNamespaced", "sendMessage", "(string)");
// Grant this system access to MessageTable
IWorld(worldAddress).grantAccess(
ResourceSelector.getNamespace(MessageTableTableId),
ResourceSelector.getName(MessageTableTableId),
address(chatNamespacedSystem)
IWorld(worldAddress).registerSystem(
ResourceSelector.from("namespace", "ChatNamespaced"),
chatNamespacedSystem,
true
);
IWorld(worldAddress).registerFunctionSelector(
ResourceSelector.from("namespace", "ChatNamespaced"),
"sendMessage",
"(string)"
);
// Grant this system access to MessageTable
IWorld(worldAddress).grantAccess(MessageTableTableId, address(chatNamespacedSystem));

// ------------------ EXAMPLES ------------------

Expand Down
Loading

0 comments on commit 57beee8

Please sign in to comment.