Skip to content

@latticexyz/[email protected]

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 21 Jul 14:49
· 1306 commits to main since this release
f0dfff7

Minor Changes

  • #1147 66cc35a8 Thanks @dk1a! - Create gas-report package, move gas-report cli command and GasReporter contract to it

  • #1061 a7b30c79 Thanks @dk1a! - Rename MudV2Test to MudTest 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 of function isStore() to determine which contract is Store:

    • Previously StoreSwitch called isStore() on msg.sender to determine if msg.sender is a Store contract. If the call succeeded, the Store methods were called on msg.sender, otherwise the data was written to the own storage.
    • With this change StoreSwitch instead checks for an address 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 on msg.sender.
    • In practice this has the same effect as before: By default the World contracts sets its own address in StoreSwitch, while System contracts keep the Store address undefined, so Systems write to their caller (World) if they are executed via call or directly to the World storage if they are executed via delegatecall.
    • Besides gas savings, this change has two additional benefits:
      1. it is now possible for Systems to explicitly set a Store address to make them exclusive to that Store and
      2. table libraries can now be used in tests without having to provide an explicit Store argument, because the MudTest base contract redirects reads and writes to the internal World contract.

Patch Changes

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

  • cli: account for getRecord's trimming (#574) (9c5317a)

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

  • cli: add missing await to tablegen, fix formatting (#472) (4313c27)

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. Use mud deploy-contracts instead.