-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(world,store): add initialize method, initialize core tables in c…
…ore module (#1472)
- Loading branch information
Showing
59 changed files
with
478 additions
and
2,595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@latticexyz/store": major | ||
--- | ||
|
||
- `StoreCore`'s `initialize` function is split into `initialize` (to set the `StoreSwitch`'s `storeAddress`) and `registerCoreTables` (to register the `Tables` and `StoreHooks` tables). | ||
The purpose of this is to give consumers more granular control over the setup flow. | ||
|
||
- The `StoreRead` contract no longer calls `StoreCore.initialize` in its constructor. | ||
`StoreCore` consumers are expected to call `StoreCore.initialize` and `StoreCore.registerCoreTable` in their own setup logic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
"@latticexyz/cli": patch | ||
"@latticexyz/world": minor | ||
--- | ||
|
||
- The `World` contract now has an `initialize` function, which can be called once by the creator of the World to install the core module. | ||
This change allows the registration of all core tables to happen in the `CoreModule`, so no table metadata has to be included in the `World`'s bytecode. | ||
|
||
```solidity | ||
interface IBaseWorld { | ||
function initialize(IModule coreModule) public; | ||
} | ||
``` | ||
|
||
- The `World` contract now stores the original creator of the `World` in an immutable state variable. | ||
It is used internally to only allow the original creator to initialize the `World` in a separate transaction. | ||
|
||
```solidity | ||
interface IBaseWorld { | ||
function creator() external view returns (address); | ||
} | ||
``` | ||
|
||
- The deploy script is updated to use the `World`'s `initialize` function to install the `CoreModule` instead of `registerRootModule` as before. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
122 changes: 0 additions & 122 deletions
122
packages/store/abi/StoreRead.sol/StoreRead.abi.json.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.