Minor Changes
-
#1147
66cc35a8
Thanks @dk1a! - Create gas-report package, move gas-report cli command and GasReporter contract to it -
#1061
a7b30c79
Thanks @dk1a! - RenameMudV2Test
toMudTest
and move from@latticexyz/std-contracts
to@latticexyz/store
.// old import import { MudV2Test } from "@latticexyz/std-contracts/src/test/MudV2Test.t.sol"; // new import import { MudTest } from "@latticexyz/store/src/MudTest.sol";
Refactor
StoreSwitch
to use a storage slot instead offunction isStore()
to determine which contract is Store:- Previously
StoreSwitch
calledisStore()
onmsg.sender
to determine ifmsg.sender
is aStore
contract. If the call succeeded, theStore
methods were called onmsg.sender
, otherwise the data was written to the own storage. - With this change
StoreSwitch
instead checks for anaddress
in a known storage slot. If the address equals the own address, data is written to the own storage. If it is an external address,Store
methods are called on this address. If it is unset (address(0)
), store methods are called onmsg.sender
. - In practice this has the same effect as before: By default the
World
contracts sets its own address inStoreSwitch
, whileSystem
contracts keep the Store address undefined, soSystems
write to their caller (World
) if they are executed viacall
or directly to theWorld
storage if they are executed viadelegatecall
. - Besides gas savings, this change has two additional benefits:
- it is now possible for
Systems
to explicitly set aStore
address to make them exclusive to thatStore
and - table libraries can now be used in tests without having to provide an explicit
Store
argument, because theMudTest
base contract redirects reads and writes to the internalWorld
contract.
- it is now possible for
- Previously
Patch Changes
-
#1153
8d51a034
Thanks @dk1a! - Clean up Memory.sol, make mcopy pure -
#1168
48909d15
Thanks @dk1a! - bump forge-std and ds-test dependencies -
#1179
53522998
Thanks @holic! - - bump to viem 1.3.0 and abitype 0.9.3- move
@wagmi/chains
imports toviem/chains
- refine a few types
- move
-
Updated dependencies [
8d51a034
,48909d15
,66cc35a8
,f03531d9
,53522998
,0c4f9fea
]:- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
- @latticexyz/[email protected]
All notable changes to this project will be documented in this file.
See Conventional Commits for commit guidelines.
1.42.0 (2023-04-13)
Bug Fixes
Features
- add support for key schemas (#480) (37aec2e)
- cli: add encode function to all tables (#498) (564604c)
- cli: add module config to CLI (#494) (263c828)
- cli: allow static arrays as abi types in store config and tablegen (#509) (588d037)
- cli: improve storeArgument, refactor cli (#500) (bb68670)
- cli: set storeArgument to true by default (#553) (cb1ecbc)
- cli: use a central codegen dir for tablegen and worldgen (#585) (7500b11)
- cli: use abi types in store config (#507) (12a739f)
- cli: use json for gas report output (#607) (bea12ca)
- config: separate config from cli (#600) (cd224a5)
- store: add metadata to the schema table (#550) (55ab704)
- use IErrors in IStore and IWorldCore (#573) (4f9ed7b)
- v2 event decoding (#415) (374ed54)
- world,store: add updateInField (#525) (0ac76fd)
- world: add naive ReverseMappingHook/Module (#487) (36aaaef)
- world: add support for modules, add RegistrationModule, add CoreModule (#482) (624cbbc)
- world: add UniqueEntityModule (#552) (983e26a)
- world: allow registration of function selectors in the World, split out RegisterSystem from World (#481) (ba0166f)
- world: simplify access control to namespaces instead of routes (#467) (945f2ef)
1.41.0 (2023-03-09)
Bug Fixes
Features
- add pushToField to Store and World (#434) (b665efc)
- cli: add setMetadata to autogen of table libraries (#466) (1e129fe)
- cli: add v2 deployment script (#450) (1db37a5)
- cli: user types and route/path separation (#454) (758bf03)
1.40.0 (2023-03-03)
Features
- add StoreMetadata table for table name and field names to Store and World (#428) (ae39ace)
- v2 - add store, world and schema-type, cli table code generation (#422) (cb731e0)
BREAKING CHANGES
- This commit removes the deprecated
mud deploy
CLI command. Usemud deploy-contracts
instead.