diff --git a/.changeset/pre.json b/.changeset/pre.json index 279db2386dd..391ee2eca71 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -42,6 +42,7 @@ "clever-rats-sip", "cool-snakes-reply", "dirty-items-retire", + "dry-chicken-love", "eighty-tigers-argue", "empty-planes-kiss", "fast-ears-hug", @@ -70,6 +71,7 @@ "mean-pans-study", "metal-cats-double", "metal-wombats-judge", + "mighty-eels-type", "modern-bikes-build", "modern-hornets-jam", "nasty-waves-divide", @@ -80,6 +82,7 @@ "perfect-mangos-cry", "pink-fans-nail", "pink-horses-deny", + "pink-tips-give", "pretty-hotels-drop", "quick-numbers-flash", "quiet-squids-share", @@ -106,6 +109,7 @@ "tame-lemons-play", "thin-buses-reply", "tricky-carrots-talk", + "tricky-comics-remain", "tricky-frogs-beam", "tricky-kangaroos-love", "tricky-olives-stare", @@ -113,6 +117,7 @@ "twenty-birds-scream", "unlucky-guests-cover", "weak-mails-cross", + "wicked-tigers-return", "wild-gorillas-care", "witty-jokes-serve", "witty-tigers-rest" diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ef0a7ad389..5034abd10bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,71 @@ +## Version 2.0.0-next.8 + +### Major changes + +**[feat(world): change requireOwnerOrSelf to requireOwner (#1457)](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670)** (@latticexyz/world) + +- The access control library no longer allows calls by the `World` contract to itself to bypass the ownership check. + This is a breaking change for root modules that relied on this mechanism to register root tables, systems or function selectors. + To upgrade, root modules must use `delegatecall` instead of a regular `call` to install root tables, systems or function selectors. + + ```diff + - world.registerSystem(rootSystemId, rootSystemAddress); + + address(world).delegatecall(abi.encodeCall(world.registerSystem, (rootSystemId, rootSystemAddress))); + ``` + +- An `installRoot` method was added to the `IModule` interface. + This method is now called when installing a root module via `world.installRootModule`. + When installing non-root modules via `world.installModule`, the module's `install` function continues to be called. + +**[feat(world): add Balance table and BalanceTransferSystem (#1425)](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0)** (@latticexyz/world) + +The World now maintains a balance per namespace. +When a system is called with value, the value stored in the World contract and credited to the system's namespace. + +Previously, the World contract did not store value, but passed it on to the system contracts. +However, as systems are expected to be stateless (reading/writing state only via the calling World) and can be registered in multiple Worlds, this could have led to exploits. + +Any address with access to a namespace can use the balance of that namespace. +This allows all systems registered in the same namespace to work with the same balance. + +There are two new World methods to transfer balance between namespaces (`transferBalanceToNamespace`) or to an address (`transferBalanceToAddress`). + +```solidity +interface IBaseWorld { + function transferBalanceToNamespace(bytes16 fromNamespace, bytes16 toNamespace, uint256 amount) external; + + function transferBalanceToAddress(bytes16 fromNamespace, address toAddress, uint256 amount) external; +} +``` + +### Minor changes + +**[feat(store,world): add ability to unregister hooks (#1422)](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7)** (@latticexyz/store, @latticexyz/world) + +It is now possible to unregister Store hooks and System hooks. + +```solidity +interface IStore { + function unregisterStoreHook(bytes32 table, IStoreHook hookAddress) external; + // ... +} + +interface IWorld { + function unregisterSystemHook(bytes32 resourceSelector, ISystemHook hookAddress) external; + // ... +} +``` + +**[feat(protocol-parser): add keySchema/valueSchema helpers (#1443)](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)** (@latticexyz/store) + +Moved `KeySchema`, `ValueSchema`, `SchemaToPrimitives` and `TableRecord` types into `@latticexyz/protocol-parser` + +**[feat(protocol-parser): add keySchema/valueSchema helpers (#1443)](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)** (@latticexyz/protocol-parser) + +Adds `decodeKey`, `decodeValue`, `encodeKey`, and `encodeValue` helpers to decode/encode from key/value schemas. Deprecates previous methods that use a schema object with static/dynamic field arrays, originally attempting to model our on-chain behavior but ended up not very ergonomic when working with table configs. + +--- + ## Version 2.0.0-next.7 ### Major changes diff --git a/docs/pages/changelog.mdx b/docs/pages/changelog.mdx index 8ef0a7ad389..5034abd10bb 100644 --- a/docs/pages/changelog.mdx +++ b/docs/pages/changelog.mdx @@ -1,3 +1,71 @@ +## Version 2.0.0-next.8 + +### Major changes + +**[feat(world): change requireOwnerOrSelf to requireOwner (#1457)](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670)** (@latticexyz/world) + +- The access control library no longer allows calls by the `World` contract to itself to bypass the ownership check. + This is a breaking change for root modules that relied on this mechanism to register root tables, systems or function selectors. + To upgrade, root modules must use `delegatecall` instead of a regular `call` to install root tables, systems or function selectors. + + ```diff + - world.registerSystem(rootSystemId, rootSystemAddress); + + address(world).delegatecall(abi.encodeCall(world.registerSystem, (rootSystemId, rootSystemAddress))); + ``` + +- An `installRoot` method was added to the `IModule` interface. + This method is now called when installing a root module via `world.installRootModule`. + When installing non-root modules via `world.installModule`, the module's `install` function continues to be called. + +**[feat(world): add Balance table and BalanceTransferSystem (#1425)](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0)** (@latticexyz/world) + +The World now maintains a balance per namespace. +When a system is called with value, the value stored in the World contract and credited to the system's namespace. + +Previously, the World contract did not store value, but passed it on to the system contracts. +However, as systems are expected to be stateless (reading/writing state only via the calling World) and can be registered in multiple Worlds, this could have led to exploits. + +Any address with access to a namespace can use the balance of that namespace. +This allows all systems registered in the same namespace to work with the same balance. + +There are two new World methods to transfer balance between namespaces (`transferBalanceToNamespace`) or to an address (`transferBalanceToAddress`). + +```solidity +interface IBaseWorld { + function transferBalanceToNamespace(bytes16 fromNamespace, bytes16 toNamespace, uint256 amount) external; + + function transferBalanceToAddress(bytes16 fromNamespace, address toAddress, uint256 amount) external; +} +``` + +### Minor changes + +**[feat(store,world): add ability to unregister hooks (#1422)](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7)** (@latticexyz/store, @latticexyz/world) + +It is now possible to unregister Store hooks and System hooks. + +```solidity +interface IStore { + function unregisterStoreHook(bytes32 table, IStoreHook hookAddress) external; + // ... +} + +interface IWorld { + function unregisterSystemHook(bytes32 resourceSelector, ISystemHook hookAddress) external; + // ... +} +``` + +**[feat(protocol-parser): add keySchema/valueSchema helpers (#1443)](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)** (@latticexyz/store) + +Moved `KeySchema`, `ValueSchema`, `SchemaToPrimitives` and `TableRecord` types into `@latticexyz/protocol-parser` + +**[feat(protocol-parser): add keySchema/valueSchema helpers (#1443)](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)** (@latticexyz/protocol-parser) + +Adds `decodeKey`, `decodeValue`, `encodeKey`, and `encodeValue` helpers to decode/encode from key/value schemas. Deprecates previous methods that use a schema object with static/dynamic field arrays, originally attempting to model our on-chain behavior but ended up not very ergonomic when working with table configs. + +--- + ## Version 2.0.0-next.7 ### Major changes diff --git a/packages/abi-ts/CHANGELOG.md b/packages/abi-ts/CHANGELOG.md index 2206bd70dec..4410450fd1b 100644 --- a/packages/abi-ts/CHANGELOG.md +++ b/packages/abi-ts/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/abi-ts +## 2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/abi-ts/package.json b/packages/abi-ts/package.json index 6e7052b1d0a..6eb24d5d166 100644 --- a/packages/abi-ts/package.json +++ b/packages/abi-ts/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/abi-ts", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.", "repository": { "type": "git", diff --git a/packages/block-logs-stream/CHANGELOG.md b/packages/block-logs-stream/CHANGELOG.md index c65566ebf5c..dd9e7bd5331 100644 --- a/packages/block-logs-stream/CHANGELOG.md +++ b/packages/block-logs-stream/CHANGELOG.md @@ -1,5 +1,14 @@ # @latticexyz/block-logs-stream +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies []: + - @latticexyz/common@2.0.0-next.8 + - @latticexyz/config@2.0.0-next.8 + - @latticexyz/schema-type@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/block-logs-stream/package.json b/packages/block-logs-stream/package.json index 1085b00e260..64bafdb100d 100644 --- a/packages/block-logs-stream/package.json +++ b/packages/block-logs-stream/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/block-logs-stream", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Create a stream of EVM block logs for events", "repository": { "type": "git", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 1ba66421781..42da0da38a4 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,21 @@ # Change Log +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies [[`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7), [`51914d65`](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670), [`2ca75f9b`](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)]: + - @latticexyz/store@2.0.0-next.8 + - @latticexyz/world@2.0.0-next.8 + - @latticexyz/protocol-parser@2.0.0-next.8 + - @latticexyz/abi-ts@2.0.0-next.8 + - @latticexyz/common@2.0.0-next.8 + - @latticexyz/config@2.0.0-next.8 + - @latticexyz/gas-report@2.0.0-next.8 + - @latticexyz/schema-type@2.0.0-next.8 + - @latticexyz/services@2.0.0-next.8 + - @latticexyz/utils@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index e9e3df7eeaf..667a7d77653 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/cli", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Command line interface for mud", "repository": { "type": "git", diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index 1eb31dd15db..521aefc5672 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies []: + - @latticexyz/schema-type@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/common/package.json b/packages/common/package.json index a5ced5763eb..e269b73d8f5 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/common", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Common low level logic shared between packages", "repository": { "type": "git", diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index fc3166a2758..cd74617d7c4 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies []: + - @latticexyz/common@2.0.0-next.8 + - @latticexyz/schema-type@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/config/package.json b/packages/config/package.json index 60607e57859..c40af6e11dc 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/config", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Config for Store and World", "repository": { "type": "git", diff --git a/packages/create-mud/CHANGELOG.md b/packages/create-mud/CHANGELOG.md index 4866c679555..2a64f39d794 100644 --- a/packages/create-mud/CHANGELOG.md +++ b/packages/create-mud/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/create-mud/package.json b/packages/create-mud/package.json index 03ac7dd38fa..0a7d9ce420a 100644 --- a/packages/create-mud/package.json +++ b/packages/create-mud/package.json @@ -1,6 +1,6 @@ { "name": "create-mud", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Create a new MUD project", "license": "MIT", "author": "Lattice ", diff --git a/packages/dev-tools/CHANGELOG.md b/packages/dev-tools/CHANGELOG.md index aefada976f2..c358797e359 100644 --- a/packages/dev-tools/CHANGELOG.md +++ b/packages/dev-tools/CHANGELOG.md @@ -1,5 +1,18 @@ # @latticexyz/dev-tools +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies [[`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7), [`51914d65`](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670), [`2ca75f9b`](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)]: + - @latticexyz/store@2.0.0-next.8 + - @latticexyz/world@2.0.0-next.8 + - @latticexyz/react@2.0.0-next.8 + - @latticexyz/store-sync@2.0.0-next.8 + - @latticexyz/common@2.0.0-next.8 + - @latticexyz/recs@2.0.0-next.8 + - @latticexyz/utils@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/dev-tools/package.json b/packages/dev-tools/package.json index 73b4320f300..c1af28ac225 100644 --- a/packages/dev-tools/package.json +++ b/packages/dev-tools/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/dev-tools", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "MUD developer tools", "repository": { "type": "git", @@ -51,12 +51,12 @@ "vitest": "0.31.4" }, "peerDependencies": { - "@latticexyz/common": "2.0.0-next.7", - "@latticexyz/recs": "2.0.0-next.7", - "@latticexyz/store": "2.0.0-next.7", - "@latticexyz/store-sync": "2.0.0-next.7", - "@latticexyz/utils": "2.0.0-next.7", - "@latticexyz/world": "2.0.0-next.7" + "@latticexyz/common": "2.0.0-next.8", + "@latticexyz/recs": "2.0.0-next.8", + "@latticexyz/store": "2.0.0-next.8", + "@latticexyz/store-sync": "2.0.0-next.8", + "@latticexyz/utils": "2.0.0-next.8", + "@latticexyz/world": "2.0.0-next.8" }, "publishConfig": { "access": "public" diff --git a/packages/ecs-browser/CHANGELOG.md b/packages/ecs-browser/CHANGELOG.md index abb75abcbb1..8544b652c7d 100644 --- a/packages/ecs-browser/CHANGELOG.md +++ b/packages/ecs-browser/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/ecs-browser +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/ecs-browser/package.json b/packages/ecs-browser/package.json index d0cac40c369..d9fe5088a72 100644 --- a/packages/ecs-browser/package.json +++ b/packages/ecs-browser/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/ecs-browser", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "private": true } diff --git a/packages/gas-report/CHANGELOG.md b/packages/gas-report/CHANGELOG.md index 0a4ac784226..5a6f1590d11 100644 --- a/packages/gas-report/CHANGELOG.md +++ b/packages/gas-report/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/gas-report/package.json b/packages/gas-report/package.json index fc972592290..5ad7eeeb7f7 100644 --- a/packages/gas-report/package.json +++ b/packages/gas-report/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/gas-report", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Gas reporter for specific lines within forge tests", "repository": { "type": "git", diff --git a/packages/network/CHANGELOG.md b/packages/network/CHANGELOG.md index 23167d767bf..f67d572e1b6 100644 --- a/packages/network/CHANGELOG.md +++ b/packages/network/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/network +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/network/package.json b/packages/network/package.json index 7659ebc4856..9eb328626a1 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/network", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "private": true } diff --git a/packages/noise/CHANGELOG.md b/packages/noise/CHANGELOG.md index c1e1da813a6..da095e5407b 100644 --- a/packages/noise/CHANGELOG.md +++ b/packages/noise/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/noise/package.json b/packages/noise/package.json index cb73c66e015..34f8665f646 100644 --- a/packages/noise/package.json +++ b/packages/noise/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/noise", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "license": "MIT", "type": "module", "exports": { diff --git a/packages/phaserx/CHANGELOG.md b/packages/phaserx/CHANGELOG.md index f4b606349db..9f9f0b4af86 100644 --- a/packages/phaserx/CHANGELOG.md +++ b/packages/phaserx/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies []: + - @latticexyz/utils@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/phaserx/package.json b/packages/phaserx/package.json index 8c56e1fec84..718d1e459d8 100644 --- a/packages/phaserx/package.json +++ b/packages/phaserx/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/phaserx", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/protocol-parser/CHANGELOG.md b/packages/protocol-parser/CHANGELOG.md index 708b4006259..4bf6a0b363a 100644 --- a/packages/protocol-parser/CHANGELOG.md +++ b/packages/protocol-parser/CHANGELOG.md @@ -1,5 +1,17 @@ # @latticexyz/protocol-parser +## 2.0.0-next.8 + +### Minor Changes + +- [#1443](https://github.com/latticexyz/mud/pull/1443) [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98) Thanks [@holic](https://github.com/holic)! - Adds `decodeKey`, `decodeValue`, `encodeKey`, and `encodeValue` helpers to decode/encode from key/value schemas. Deprecates previous methods that use a schema object with static/dynamic field arrays, originally attempting to model our on-chain behavior but ended up not very ergonomic when working with table configs. + +### Patch Changes + +- Updated dependencies []: + - @latticexyz/common@2.0.0-next.8 + - @latticexyz/schema-type@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/protocol-parser/package.json b/packages/protocol-parser/package.json index 33a16745946..f7096b2e4e6 100644 --- a/packages/protocol-parser/package.json +++ b/packages/protocol-parser/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/protocol-parser", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Parser utilities for the MUD protocol", "repository": { "type": "git", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 1fb047e3a3a..c29f0ed006d 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies [[`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)]: + - @latticexyz/store@2.0.0-next.8 + - @latticexyz/recs@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 93e7d156dd2..3fedb5d19b8 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/react", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "React tools for MUD client.", "repository": { "type": "git", diff --git a/packages/recs/CHANGELOG.md b/packages/recs/CHANGELOG.md index 833c6f845bb..27d9823cc6f 100644 --- a/packages/recs/CHANGELOG.md +++ b/packages/recs/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies []: + - @latticexyz/schema-type@2.0.0-next.8 + - @latticexyz/utils@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/recs/package.json b/packages/recs/package.json index 14595558f0d..5d72ffd027e 100644 --- a/packages/recs/package.json +++ b/packages/recs/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/recs", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/schema-type/CHANGELOG.md b/packages/schema-type/CHANGELOG.md index f517629eeb7..98391dc3031 100644 --- a/packages/schema-type/CHANGELOG.md +++ b/packages/schema-type/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/schema-type/package.json b/packages/schema-type/package.json index a7b5463968a..e0d57ed90bb 100644 --- a/packages/schema-type/package.json +++ b/packages/schema-type/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/schema-type", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "SchemaType enum for various languages", "repository": { "type": "git", diff --git a/packages/services/CHANGELOG.md b/packages/services/CHANGELOG.md index f290a384486..80ae0765553 100644 --- a/packages/services/CHANGELOG.md +++ b/packages/services/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/services/package.json b/packages/services/package.json index 28c3358d47a..97904a63393 100644 --- a/packages/services/package.json +++ b/packages/services/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/services", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "MUD services for enhanced interactions with on-chain ECS state", "repository": { "type": "git", diff --git a/packages/solecs/CHANGELOG.md b/packages/solecs/CHANGELOG.md index 7e80ed7bec2..71fcc584f1e 100644 --- a/packages/solecs/CHANGELOG.md +++ b/packages/solecs/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/solecs +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/solecs/package.json b/packages/solecs/package.json index a9ee1a0030d..474ec9ccd2e 100644 --- a/packages/solecs/package.json +++ b/packages/solecs/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/solecs", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "private": true } diff --git a/packages/solhint-config-mud/CHANGELOG.md b/packages/solhint-config-mud/CHANGELOG.md index 7c4a4a887b0..6354ac1eda3 100644 --- a/packages/solhint-config-mud/CHANGELOG.md +++ b/packages/solhint-config-mud/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/solhint-config-mud/package.json b/packages/solhint-config-mud/package.json index fddb57eb007..8850d0fb168 100644 --- a/packages/solhint-config-mud/package.json +++ b/packages/solhint-config-mud/package.json @@ -1,6 +1,6 @@ { "name": "solhint-config-mud", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/solhint-plugin-mud/CHANGELOG.md b/packages/solhint-plugin-mud/CHANGELOG.md index 7c4a4a887b0..6354ac1eda3 100644 --- a/packages/solhint-plugin-mud/CHANGELOG.md +++ b/packages/solhint-plugin-mud/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/solhint-plugin-mud/package.json b/packages/solhint-plugin-mud/package.json index c2ef8077ed4..391eb8b1da5 100644 --- a/packages/solhint-plugin-mud/package.json +++ b/packages/solhint-plugin-mud/package.json @@ -1,6 +1,6 @@ { "name": "solhint-plugin-mud", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/std-client/CHANGELOG.md b/packages/std-client/CHANGELOG.md index 983562e2091..ffdbe25dae6 100644 --- a/packages/std-client/CHANGELOG.md +++ b/packages/std-client/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/std-client +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/std-client/package.json b/packages/std-client/package.json index 8a6fdbe36cc..4cc879fe7ea 100644 --- a/packages/std-client/package.json +++ b/packages/std-client/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/std-client", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "private": true } diff --git a/packages/std-contracts/CHANGELOG.md b/packages/std-contracts/CHANGELOG.md index 1b6c0f3d3cc..7eb79427331 100644 --- a/packages/std-contracts/CHANGELOG.md +++ b/packages/std-contracts/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/std-contracts +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/std-contracts/package.json b/packages/std-contracts/package.json index 6995511ef12..b6fdb984bb4 100644 --- a/packages/std-contracts/package.json +++ b/packages/std-contracts/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/std-contracts", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "private": true } diff --git a/packages/store-cache/CHANGELOG.md b/packages/store-cache/CHANGELOG.md index 1f193d263d5..2c3e9dfea38 100644 --- a/packages/store-cache/CHANGELOG.md +++ b/packages/store-cache/CHANGELOG.md @@ -1,5 +1,7 @@ # @latticexyz/store-cache +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/store-cache/package.json b/packages/store-cache/package.json index 93be48ccfe8..b2054eeeb95 100644 --- a/packages/store-cache/package.json +++ b/packages/store-cache/package.json @@ -1,5 +1,5 @@ { "name": "@latticexyz/store-cache", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "private": true } diff --git a/packages/store-indexer/CHANGELOG.md b/packages/store-indexer/CHANGELOG.md index 0807481c98d..66870ddba26 100644 --- a/packages/store-indexer/CHANGELOG.md +++ b/packages/store-indexer/CHANGELOG.md @@ -1,5 +1,15 @@ # @latticexyz/store-indexer +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies [[`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)]: + - @latticexyz/store@2.0.0-next.8 + - @latticexyz/store-sync@2.0.0-next.8 + - @latticexyz/block-logs-stream@2.0.0-next.8 + - @latticexyz/common@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/store-indexer/package.json b/packages/store-indexer/package.json index 0636b81fdfe..c17410cf6b3 100644 --- a/packages/store-indexer/package.json +++ b/packages/store-indexer/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store-indexer", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Minimal Typescript indexer for Store", "repository": { "type": "git", diff --git a/packages/store-sync/CHANGELOG.md b/packages/store-sync/CHANGELOG.md index 923a974a6b4..bbde5dd65e6 100644 --- a/packages/store-sync/CHANGELOG.md +++ b/packages/store-sync/CHANGELOG.md @@ -1,5 +1,18 @@ # @latticexyz/store-sync +## 2.0.0-next.8 + +### Patch Changes + +- Updated dependencies [[`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7), [`51914d65`](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670), [`2ca75f9b`](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)]: + - @latticexyz/store@2.0.0-next.8 + - @latticexyz/world@2.0.0-next.8 + - @latticexyz/protocol-parser@2.0.0-next.8 + - @latticexyz/block-logs-stream@2.0.0-next.8 + - @latticexyz/common@2.0.0-next.8 + - @latticexyz/recs@2.0.0-next.8 + - @latticexyz/schema-type@2.0.0-next.8 + ## 2.0.0-next.7 ### Patch Changes diff --git a/packages/store-sync/package.json b/packages/store-sync/package.json index f74cc00e7a8..74ac0cd678f 100644 --- a/packages/store-sync/package.json +++ b/packages/store-sync/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store-sync", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Utilities to sync MUD Store events with a client or cache", "repository": { "type": "git", diff --git a/packages/store/CHANGELOG.md b/packages/store/CHANGELOG.md index 6733a97de75..2ead398342b 100644 --- a/packages/store/CHANGELOG.md +++ b/packages/store/CHANGELOG.md @@ -1,5 +1,32 @@ # Change Log +## 2.0.0-next.8 + +### Minor Changes + +- [#1422](https://github.com/latticexyz/mud/pull/1422) [`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7) Thanks [@alvrs](https://github.com/alvrs)! - It is now possible to unregister Store hooks and System hooks. + + ```solidity + interface IStore { + function unregisterStoreHook(bytes32 table, IStoreHook hookAddress) external; + // ... + } + + interface IWorld { + function unregisterSystemHook(bytes32 resourceSelector, ISystemHook hookAddress) external; + // ... + } + ``` + +- [#1443](https://github.com/latticexyz/mud/pull/1443) [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98) Thanks [@holic](https://github.com/holic)! - Moved `KeySchema`, `ValueSchema`, `SchemaToPrimitives` and `TableRecord` types into `@latticexyz/protocol-parser` + +### Patch Changes + +- Updated dependencies []: + - @latticexyz/common@2.0.0-next.8 + - @latticexyz/config@2.0.0-next.8 + - @latticexyz/schema-type@2.0.0-next.8 + ## 2.0.0-next.7 ### Major Changes diff --git a/packages/store/package.json b/packages/store/package.json index f2e3e66ff2b..ee891b48893 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/store", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "Store", "repository": { "type": "git", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index b1c4fb91656..5c02256dec5 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,7 @@ # Change Log +## 2.0.0-next.8 + ## 2.0.0-next.7 ## 2.0.0-next.6 diff --git a/packages/utils/package.json b/packages/utils/package.json index cf94e596a69..7da0b51e495 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/utils", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "repository": { "type": "git", "url": "https://github.com/latticexyz/mud.git", diff --git a/packages/world/CHANGELOG.md b/packages/world/CHANGELOG.md index 48725d10bd7..dfd6c336c34 100644 --- a/packages/world/CHANGELOG.md +++ b/packages/world/CHANGELOG.md @@ -1,5 +1,65 @@ # Change Log +## 2.0.0-next.8 + +### Major Changes + +- [#1457](https://github.com/latticexyz/mud/pull/1457) [`51914d65`](https://github.com/latticexyz/mud/commit/51914d656d8cd8d851ccc8296d249cf09f53e670) Thanks [@alvrs](https://github.com/alvrs)! - - The access control library no longer allows calls by the `World` contract to itself to bypass the ownership check. + This is a breaking change for root modules that relied on this mechanism to register root tables, systems or function selectors. + To upgrade, root modules must use `delegatecall` instead of a regular `call` to install root tables, systems or function selectors. + + ```diff + - world.registerSystem(rootSystemId, rootSystemAddress); + + address(world).delegatecall(abi.encodeCall(world.registerSystem, (rootSystemId, rootSystemAddress))); + ``` + + - An `installRoot` method was added to the `IModule` interface. + This method is now called when installing a root module via `world.installRootModule`. + When installing non-root modules via `world.installModule`, the module's `install` function continues to be called. + +- [#1425](https://github.com/latticexyz/mud/pull/1425) [`2ca75f9b`](https://github.com/latticexyz/mud/commit/2ca75f9b9063ea33524e6c609b87f5494f678fa0) Thanks [@alvrs](https://github.com/alvrs)! - The World now maintains a balance per namespace. + When a system is called with value, the value stored in the World contract and credited to the system's namespace. + + Previously, the World contract did not store value, but passed it on to the system contracts. + However, as systems are expected to be stateless (reading/writing state only via the calling World) and can be registered in multiple Worlds, this could have led to exploits. + + Any address with access to a namespace can use the balance of that namespace. + This allows all systems registered in the same namespace to work with the same balance. + + There are two new World methods to transfer balance between namespaces (`transferBalanceToNamespace`) or to an address (`transferBalanceToAddress`). + + ```solidity + interface IBaseWorld { + function transferBalanceToNamespace(bytes16 fromNamespace, bytes16 toNamespace, uint256 amount) external; + + function transferBalanceToAddress(bytes16 fromNamespace, address toAddress, uint256 amount) external; + } + ``` + +### Minor Changes + +- [#1422](https://github.com/latticexyz/mud/pull/1422) [`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7) Thanks [@alvrs](https://github.com/alvrs)! - It is now possible to unregister Store hooks and System hooks. + + ```solidity + interface IStore { + function unregisterStoreHook(bytes32 table, IStoreHook hookAddress) external; + // ... + } + + interface IWorld { + function unregisterSystemHook(bytes32 resourceSelector, ISystemHook hookAddress) external; + // ... + } + ``` + +### Patch Changes + +- Updated dependencies [[`1d60930d`](https://github.com/latticexyz/mud/commit/1d60930d6d4c9a0bda262e5e23a5f719b9dd48c7), [`5e71e1cb`](https://github.com/latticexyz/mud/commit/5e71e1cb541b0a18ee414e18dd80f1dd24a92b98)]: + - @latticexyz/store@2.0.0-next.8 + - @latticexyz/common@2.0.0-next.8 + - @latticexyz/config@2.0.0-next.8 + - @latticexyz/schema-type@2.0.0-next.8 + ## 2.0.0-next.7 ### Major Changes diff --git a/packages/world/package.json b/packages/world/package.json index c80c8b6eea2..e2c56ec3a11 100644 --- a/packages/world/package.json +++ b/packages/world/package.json @@ -1,6 +1,6 @@ { "name": "@latticexyz/world", - "version": "2.0.0-next.7", + "version": "2.0.0-next.8", "description": "World framework", "repository": { "type": "git",