@latticexyz/world 2.0.0-alpha.1.61 → 2.0.0-alpha.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,7 +80,7 @@
80
80
  "registerStoreHook(bytes32,address)": "6e81fd71",
81
81
  "setMetadata(bytes32,string,string[])": "fe86a89f"
82
82
  },
83
- "rawMetadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"tableId\",\"type\":\"bytes32\"},{\"internalType\":\"Schema\",\"name\":\"valueSchema\",\"type\":\"bytes32\"},{\"internalType\":\"Schema\",\"name\":\"keySchema\",\"type\":\"bytes32\"}],\"name\":\"registerSchema\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"tableId\",\"type\":\"bytes32\"},{\"internalType\":\"contract IStoreHook\",\"name\":\"hook\",\"type\":\"address\"}],\"name\":\"registerStoreHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"tableId\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"tableName\",\"type\":\"string\"},{\"internalType\":\"string[]\",\"name\":\"fieldNames\",\"type\":\"string[]\"}],\"name\":\"setMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/IStoreRegistrationSystem.sol\":\"IStoreRegistrationSystem\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":3000},\"remappings\":[\":@latticexyz/=node_modules/@latticexyz/\",\":ds-test/=node_modules/ds-test/src/\",\":forge-std/=node_modules/forge-std/src/\",\":hardhat/=node_modules/hardhat/\"]},\"sources\":{\"node_modules/@latticexyz/schema-type/src/solidity/SchemaType.sol\":{\"keccak256\":\"0xe881f296ba0fe410faa6395ee4a65b9bf154947aebc6aa323d41a0484504221e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba7f706464d14365ff751936ba96f79f200df7bcd9d9f8abccd0b41387ca7967\",\"dweb:/ipfs/QmTiHgH3ZM2oJoqsbNs3iwwPFNYFNU7m8co87woxRLaUZ6\"]},\"node_modules/@latticexyz/store/src/Bytes.sol\":{\"keccak256\":\"0x117331c70b8cda783991a6b3e14861176068086526548d334cef8e1c24e16d5b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://613026caf6782e8a4ad0f366781fc13141492b667a723bdea69250c9b517c790\",\"dweb:/ipfs/QmQqwBSjcrDUoVvmXxeKZZpyGSEpeMTh2QZRExQTdZLrCt\"]},\"node_modules/@latticexyz/store/src/IStore.sol\":{\"keccak256\":\"0x0a0187382a8650fceffd3e8a689e182528e7278a038bddd89b8cfeaae4fad853\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://195936f865ce0d0de6b49b6f2e45e7efda1db955fd9d6030e7689573045ca938\",\"dweb:/ipfs/QmcF56m1A3mNhh5Nh8eKZckiRJxmkzeUYUY4D2H1Ghmp7b\"]},\"node_modules/@latticexyz/store/src/IStoreErrors.sol\":{\"keccak256\":\"0xc001ac6dca3e41389da8d6e4a7305e84f70d5df9fd631a72b974b6fc44fb753a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://989b7e7146c5bfbf7468b7dea0432c3119a033a337702d7c063ac09654eb5f43\",\"dweb:/ipfs/QmVcTf9YNPb8QhZtU3WTSjezX1XvKRVTRiXGcqqMH8LD7T\"]},\"node_modules/@latticexyz/store/src/Memory.sol\":{\"keccak256\":\"0x706d0d1ddd874bdcd4f73422721420b32939c1c96d4718db8b1b8e9f78bfa76c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ed8c858fa9c3756cb70cb92bb860e0ae6429eb62551b502fb4a883e1344eb42\",\"dweb:/ipfs/QmezLAADZmFj8bKS9dccTQYHcpy4g8PSZ75AuvppSwjrW7\"]},\"node_modules/@latticexyz/store/src/PackedCounter.sol\":{\"keccak256\":\"0xd3d6a9bb72f5580e7b9794530a186e05e8d6da7c9172cb01e62fcc6e558dd052\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0625cb2a0d0e544800dff8194182aa440e1e6d61cc77b9e2d8d0186bce261146\",\"dweb:/ipfs/QmRmWWwTaJ7JPZZnJXavjJNXBzEjaK4KEzxaWj5MeJQUuH\"]},\"node_modules/@latticexyz/store/src/Schema.sol\":{\"keccak256\":\"0xf06793dc2e9e9994403d29125359eb2f326b0e6e502d51a8e6e4e45fc9d90a3c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8cb23bf421b29839200e5584a770186309dd05cd77d4345c964f47528117a244\",\"dweb:/ipfs/QmQBvrDAtoqibky7CjCLKxGz3MquxK1iNk2Yac55Lc4xF5\"]},\"node_modules/@latticexyz/store/src/Slice.sol\":{\"keccak256\":\"0x14879c6c859cad89451616dcee1ab6222fd565849809b89407de48f0c1a01133\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://924caa18aa0e656a295da626d586dfb120bbea321123010462b0640c7e0c52c4\",\"dweb:/ipfs/QmNueqwy4g5mwq9kXaPzue8X2mqyFjH2P2AFi3pNN3WTAt\"]},\"node_modules/@latticexyz/store/src/Storage.sol\":{\"keccak256\":\"0x2ccca6556a3c2595479914d30efa84fc3b61cff30036522714a0ef99289ee2af\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d169812a4159454be580d42fedee63d121646102e6462fe3b2ea905b69bee07\",\"dweb:/ipfs/QmXiKsMeN4nsdiqDwhuWfb4J3UF57B4rkuwkfbrRXA6vtb\"]},\"node_modules/@latticexyz/store/src/StoreCore.sol\":{\"keccak256\":\"0xf49b4fc780939cba8d47a8bb27cca0da280ef66bdb13fbdba7b592904f60b38c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f059ba3c075335bae6dca93acb60ea9738bd5c103de3921f50c641a843bf57fd\",\"dweb:/ipfs/QmVsnyfkNtb794qxgJcU3hdUNhXBYcbCWh57taz56DiL9K\"]},\"node_modules/@latticexyz/store/src/StoreSwitch.sol\":{\"keccak256\":\"0x101cad457c139da328dc9263a1e8d4def87d828305f47f2a83b0bae681f69ed2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://158cbf36ba5b46ab273b7a1382003a2f74bbced189d1f54c9bb2f8608787703e\",\"dweb:/ipfs/QmfWbQgk9uto7g5RyHqnfr8FpXEcDRw2jEb2vAxHaNDFQ5\"]},\"node_modules/@latticexyz/store/src/TableId.sol\":{\"keccak256\":\"0x8c55662dc4f66be577bb96bfdcb65d95fe1323c733443ab749cb9ec1e58f0a6e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://209ed70247c1c64b56d9b21f2902e67e0994cb89ac19be8e1553dac9d978fb76\",\"dweb:/ipfs/QmVLYNDwBL3GZidDpwqFZx916zoGZ5tWVztxKQFEEzVybP\"]},\"node_modules/@latticexyz/store/src/Utils.sol\":{\"keccak256\":\"0x426216bfa1c0e70640787007a6e39257cf09e586fd04831ea4fb3dd9c5768fc4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://38e657fa9cfaebe39477eaff27d1ad4d7eeaf0c0058539d2ec7e6976d93df4f4\",\"dweb:/ipfs/QmRuaxqRjUrHHC2ZyTnpmq6sfrWGCDh91B6F5chFAToU6U\"]},\"node_modules/@latticexyz/store/src/codegen/Tables.sol\":{\"keccak256\":\"0x2eba8dd4e9f07b505438a2fb744ac7da26b1f6321b8a88054e9442db947ab435\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd1a60dfff209a3f1df84aeb5d7f8a5cf0419c19be63bac428df0a779d5ba437\",\"dweb:/ipfs/QmaHem2GMJPHrtr1f7fk1ThTBESdYipmBxEEoKT1DBRmsd\"]},\"node_modules/@latticexyz/store/src/codegen/tables/Callbacks.sol\":{\"keccak256\":\"0xd08a349a80fd3c118b2565f90c3f0009de8fda334d5ccbefed9cce2593969a8f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a31bf1a5cdd7637e33beb087fb5a403c7e744760f859ac4782dc456496882490\",\"dweb:/ipfs/QmTRzEZStf8puC5mWrbhgtq4wUiibQ3CG1KrBogHuzqwz2\"]},\"node_modules/@latticexyz/store/src/codegen/tables/Hooks.sol\":{\"keccak256\":\"0xd1d26a119318b5348e4ced17668a3e65fa1098dd93924725689645422b304193\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9067ff17adebe5409e1adcaf9b341021a9698dc25358b23d66ffb83985b360cb\",\"dweb:/ipfs/QmSZS83ogfbY8J6Uxs7n6hJoH9uq3Rej25h2uR4ZKfSu14\"]},\"node_modules/@latticexyz/store/src/codegen/tables/Mixed.sol\":{\"keccak256\":\"0x9931ff796508d48d2d4848b81db5508856589084660b86b5c50bee6ded0b4064\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3c77463faf354200fab92a74a31af868330b54d97cdd6d2c277317d43879bd3f\",\"dweb:/ipfs/Qmf8nj8ibymTR1ZkBKVX3RdegT81taBidw7zGryMsJGkU6\"]},\"node_modules/@latticexyz/store/src/codegen/tables/StoreMetadata.sol\":{\"keccak256\":\"0x0091f547cc1515247ee0161550973c1e6f448cc5e8b775a90dcca2b892fc32fd\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1b513683f0d1afc1d586f42fa150f75fadaa2d2fee1928bb465d7b23564df8e3\",\"dweb:/ipfs/QmR62XNtRracRgta9Jh9VVBvux9RmM5R5h17sSZZUfJ8nS\"]},\"node_modules/@latticexyz/store/src/codegen/tables/Vector2.sol\":{\"keccak256\":\"0x88a138ab11926ea728d95eda67ee5b789e184bf77850aaf4a46b99d537febc3b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d856ed9f2cb1c3727d6b46031c51c8b71bcbc49dc02af6bcb98672f2301de15a\",\"dweb:/ipfs/QmNyDgKrq4bZCKFLDkRxuacHwvBzYii5rwaoczUcLvS745\"]},\"node_modules/@latticexyz/store/src/tightcoder/DecodeSlice.sol\":{\"keccak256\":\"0xe760dfb8ff20cfb44eee6a5f03ac84abbc91382fca2e36c88c92046e6b3a66e0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://75eb4b355c547ffee62031d8dfb80844fa31fa4460543a088278083662dc4c12\",\"dweb:/ipfs/Qmf8sRcrjJ6hEQ8TPwwe6KcXcE2MPw7Juvf7fKBZ1fBCt6\"]},\"node_modules/@latticexyz/store/src/tightcoder/EncodeArray.sol\":{\"keccak256\":\"0x046f0a2dc543c7a80be91ff26b19990a10fbe73cb605f4944af38e04326a43df\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d94f038e70179571d2aed3cbe03e812ce79a471372171fb78e8189bebd7ae1ac\",\"dweb:/ipfs/QmUV4bkaEc8hefLpLRaGwmu4WZsqRLE9e6R8UdaKPExb6p\"]},\"node_modules/@latticexyz/store/src/tightcoder/TightCoder.sol\":{\"keccak256\":\"0xff0278a4e35174bbed8a38dad8ae7506f725bfe95f0b7c13829c353d68dd25dc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://26249ec0c2fa3a3430a2f8edbfc5cd678e34ea1cf1d7490ecaf1e925c976eb85\",\"dweb:/ipfs/QmUpkhr5kFiDKc7rZ2z5HcTf5PkrWVJu5sa31tYv911cPL\"]},\"node_modules/forge-std/src/console.sol\":{\"keccak256\":\"0x91d5413c2434ca58fd278b6e1e79fd98d10c83931cc2596a6038eee4daeb34ba\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://91ccea707361e48b9b7a161fe81f496b9932bc471e9c4e4e1e9c283f2453cc70\",\"dweb:/ipfs/QmcB66sZhQ6Kz7MUHcLE78YXRUZxoZnnxZjN6yATsbB2ec\"]},\"src/AccessControl.sol\":{\"keccak256\":\"0x85b5f2b3fb0a96c223f77e2f3a4ceb0ca74bb8f6b269a1555f40779214494f1b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ef026f8c1705354fecabeefc9d1c121f93291138345e6d74766091cf6cac0c24\",\"dweb:/ipfs/QmaYvjBaBheDNwDWCDShfH8mdtBiQSmZewUjJcXsa8XWJ1\"]},\"src/Call.sol\":{\"keccak256\":\"0x27114d009081f1f0a5c0b62c9ebe30415c76ed02fa46b305202bb5163711d926\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a553cf84c877160c8db6978083f09632800032de6dcc5d8a5c3b9c18cabeb578\",\"dweb:/ipfs/QmWyCDz5NobNAHEs1PCftXJzV5oCu5SKfmzfA9BynSccGn\"]},\"src/ResourceSelector.sol\":{\"keccak256\":\"0xf6a1714d556e95fda532f630ac1bd8fd9843e980dffce29f81a29c0b6f02d368\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5075e64cc1224bcd8ab46c16f85874ac91efecbf5cbeb82e5c1e3fa4f1a1edfa\",\"dweb:/ipfs/QmTqCVF6k7CMsiUJ223mXumjVyoCCNU2uE9fUHDgBmDdRj\"]},\"src/System.sol\":{\"keccak256\":\"0xf1342c8461adb4c5821c1ca106a67ba34402b36265fa63bf766eed937bd92bf9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ea41f96a27a26d56d62824e007b3b0234d44fcd94361e5c8f40fdb334cbf444b\",\"dweb:/ipfs/QmRfj4iS5Lu9V4e47wsPQy4op1qQ6hqaJpERLB5EyzqW38\"]},\"src/Types.sol\":{\"keccak256\":\"0xc5784c3845cb97da4e1147a62163865bfb0090f43a6c3f672d5d69b7806e6545\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e849e5c0f3cf032ae2d5e77117f15cc942aa65f276e63a14feefe5b9bdd8b545\",\"dweb:/ipfs/QmSCpGZSBHjxrKm8LGD5tTEwe16aVd2ugQv5itA648hsVm\"]},\"src/WorldContext.sol\":{\"keccak256\":\"0xd44a445ff07ac1551e5a8f17450381664ecf68dcb1c89fee8fb11b9b73c9cd7b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1235cc5636743b9afbb313676fc4c84ac5607142c758b0bfc59107aff79ed30c\",\"dweb:/ipfs/QmUtTUFjxKy7GtQC1Uzn6B2bRNZpcASFySPDjd16T47Rcz\"]},\"src/constants.sol\":{\"keccak256\":\"0xa0ae422aceefe0e7f200448201769e2bc527fa9e647475f65401558a03c0a83d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a2473ca8ab5e184b7320c476fd07bdff31ff450fc750ab9eabb9c0a2ee43776e\",\"dweb:/ipfs/QmQ7sBqwPgj4AtsENyzCMFWVQeMzV5uuCN8ygNU2pKYotE\"]},\"src/interfaces/IStoreRegistrationSystem.sol\":{\"keccak256\":\"0xadea1caaeba91185fd9170ccc3e9403be18098120925ad648123bb0518b556a2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1dece5a0660d1c2b9c4b9e7510fc1d3c267b607c263f6a88cd1dfa3cf00edd09\",\"dweb:/ipfs/QmS1amAtXvppuBB9tdkdte9cF7dBZx47dR3WVGHAoufrST\"]},\"src/interfaces/ISystemHook.sol\":{\"keccak256\":\"0x6302d7467fb8b6ddf1bc089037e2b5c06441e8f975caf172f4875686b822448d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6adcd8e6d0a1d8c1e027398e5159533561002bb321df887baedcb0fbdc05c91f\",\"dweb:/ipfs/QmXAVXzE6hMysP7SXvxKt6XetH7bnvGVUuXJVJqmG22RSn\"]},\"src/interfaces/IWorldErrors.sol\":{\"keccak256\":\"0x214a9f68915fb01baad4a4ca2c65545d26e481fc14b0ceadb9e4f378c4eec08a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://54b93db1cb7d5212d54fe776587d5ceddf56ab276cc72c969f28604bddb8b665\",\"dweb:/ipfs/QmSQJ82HRvBaknXWnwXWNYJj9EHuaiBCPe7W9C9uwyUNCW\"]},\"src/modules/core/constants.sol\":{\"keccak256\":\"0xf8dd287f03dad9b27801f74977c49e9fd8d4f36b8084ef8a742fa39a18f158bc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c391d8f7b843a8e71b696218e4463167ee5ee220a783fac0d17adf41d6fc04cf\",\"dweb:/ipfs/QmWNQQWpzrG8oXaZdUYSixkEpf3Dci9F2BtUJnWhjNyQaw\"]},\"src/modules/core/implementations/StoreRegistrationSystem.sol\":{\"keccak256\":\"0x621c5fbb3e6d80b91002169da8a7b0a3401f36a6f238de3d6c6f63d2472ccefc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a5529a9a1834a164a1f29336b57f80c7a53990939fe277dd230e0efd8fbd775f\",\"dweb:/ipfs/QmdHYDKPub4Euvt3fg9wRxRUPy7S9bfB139tXLByGnHsLn\"]},\"src/modules/core/implementations/WorldRegistrationSystem.sol\":{\"keccak256\":\"0x86aa735c9951644467c8db402f4631ce977ee2a83602c054a2a3367d4b398320\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a255a1efdfe19761cca4b3d61d2731b6cda679295037d856a978e5881124e67b\",\"dweb:/ipfs/QmQKAXiVbqPGiKhr9K7RiN7hH5cpTCBmkne3QE7UeLLSkQ\"]},\"src/modules/core/tables/FunctionSelectors.sol\":{\"keccak256\":\"0xf34299a05aba86c9a9224e7f75d419728107ff5a04147469fa5bf3c682323781\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9e37d6111bf3c15186179d91682a60eed40bf261c6a007d4a3392427aaa5417a\",\"dweb:/ipfs/QmeR4fZM1DmWesehSnEf45EpaPsxH5YAe3815VaPJN8Wvv\"]},\"src/modules/core/tables/ResourceType.sol\":{\"keccak256\":\"0x220250af4468861c4bf75e47ee227d3fdfc80c02c3d988f6de29503a285e4e89\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d3bbeae4b806ae73367a126546880bfe4ae00ed287fe8a595958aa0d2db07cfa\",\"dweb:/ipfs/QmQmquSugDyszpgBcmiQZSAwnaYSdQY9N2Z2cMKyrja8RK\"]},\"src/modules/core/tables/SystemRegistry.sol\":{\"keccak256\":\"0x8ab24db176f31f231b8e63e6ae1d69780a3173ebfd11555fd5358b114df5295b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3a9cc20faebcde6828a7a278b0dc42799d99fdebc716dc86ca597daacba2b716\",\"dweb:/ipfs/QmXXe7tM6JPSYti713uQwSAuk4ZyaJsfdWmHEat1B1pmAs\"]},\"src/modules/core/tables/Systems.sol\":{\"keccak256\":\"0x08c7040b9be713161ce7eea6a2657694cc15bf2bcb7cbdb067bfb13e4d7f589f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://32b61b2ddf02943d0cf7b75dbe3b792ac3df6d8e2dd0332ccfa4f4642c6e1933\",\"dweb:/ipfs/QmZPQF6D1ths75JsUFo24FoRkTjEC2DaWLhgKedKPAgtrG\"]},\"src/tables/NamespaceOwner.sol\":{\"keccak256\":\"0x773f6897309d480e5b5aec746db0cf50f1beb569e4d08aa57eca6386cd8245d4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://91e1e4d64d0be9a7a4ec6a24f61337ab74d02d56b53c4ec8bff5bd4669b02db7\",\"dweb:/ipfs/Qmb38h2GuFLBZRQnZ9FPp4YjY1iCo5NNAoWiCiqLXDcPxD\"]},\"src/tables/ResourceAccess.sol\":{\"keccak256\":\"0x8bd985412e4ea2489c07422f7fee6fd1ebb24611e941e911d65475ba9cedccc9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ed9ab9f637220e0837abfec8803fe04ace9a6db63855624a5f69ad275cc630cb\",\"dweb:/ipfs/QmRYckxLqdkPYedM1UFfBG4cVtFxbhMGWDVKCgW74iywRk\"]}},\"version\":1}",
83
+ "rawMetadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"tableId\",\"type\":\"bytes32\"},{\"internalType\":\"Schema\",\"name\":\"valueSchema\",\"type\":\"bytes32\"},{\"internalType\":\"Schema\",\"name\":\"keySchema\",\"type\":\"bytes32\"}],\"name\":\"registerSchema\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"tableId\",\"type\":\"bytes32\"},{\"internalType\":\"contract IStoreHook\",\"name\":\"hook\",\"type\":\"address\"}],\"name\":\"registerStoreHook\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"tableId\",\"type\":\"bytes32\"},{\"internalType\":\"string\",\"name\":\"tableName\",\"type\":\"string\"},{\"internalType\":\"string[]\",\"name\":\"fieldNames\",\"type\":\"string[]\"}],\"name\":\"setMetadata\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/interfaces/IStoreRegistrationSystem.sol\":\"IStoreRegistrationSystem\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":3000},\"remappings\":[\":@latticexyz/=node_modules/@latticexyz/\",\":ds-test/=node_modules/ds-test/src/\",\":forge-std/=node_modules/forge-std/src/\",\":hardhat/=node_modules/hardhat/\"]},\"sources\":{\"node_modules/@latticexyz/schema-type/src/solidity/SchemaType.sol\":{\"keccak256\":\"0xe881f296ba0fe410faa6395ee4a65b9bf154947aebc6aa323d41a0484504221e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ba7f706464d14365ff751936ba96f79f200df7bcd9d9f8abccd0b41387ca7967\",\"dweb:/ipfs/QmTiHgH3ZM2oJoqsbNs3iwwPFNYFNU7m8co87woxRLaUZ6\"]},\"node_modules/@latticexyz/store/src/Bytes.sol\":{\"keccak256\":\"0x117331c70b8cda783991a6b3e14861176068086526548d334cef8e1c24e16d5b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://613026caf6782e8a4ad0f366781fc13141492b667a723bdea69250c9b517c790\",\"dweb:/ipfs/QmQqwBSjcrDUoVvmXxeKZZpyGSEpeMTh2QZRExQTdZLrCt\"]},\"node_modules/@latticexyz/store/src/IStore.sol\":{\"keccak256\":\"0x0a0187382a8650fceffd3e8a689e182528e7278a038bddd89b8cfeaae4fad853\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://195936f865ce0d0de6b49b6f2e45e7efda1db955fd9d6030e7689573045ca938\",\"dweb:/ipfs/QmcF56m1A3mNhh5Nh8eKZckiRJxmkzeUYUY4D2H1Ghmp7b\"]},\"node_modules/@latticexyz/store/src/IStoreErrors.sol\":{\"keccak256\":\"0xc001ac6dca3e41389da8d6e4a7305e84f70d5df9fd631a72b974b6fc44fb753a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://989b7e7146c5bfbf7468b7dea0432c3119a033a337702d7c063ac09654eb5f43\",\"dweb:/ipfs/QmVcTf9YNPb8QhZtU3WTSjezX1XvKRVTRiXGcqqMH8LD7T\"]},\"node_modules/@latticexyz/store/src/Memory.sol\":{\"keccak256\":\"0x706d0d1ddd874bdcd4f73422721420b32939c1c96d4718db8b1b8e9f78bfa76c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2ed8c858fa9c3756cb70cb92bb860e0ae6429eb62551b502fb4a883e1344eb42\",\"dweb:/ipfs/QmezLAADZmFj8bKS9dccTQYHcpy4g8PSZ75AuvppSwjrW7\"]},\"node_modules/@latticexyz/store/src/PackedCounter.sol\":{\"keccak256\":\"0xd3d6a9bb72f5580e7b9794530a186e05e8d6da7c9172cb01e62fcc6e558dd052\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://0625cb2a0d0e544800dff8194182aa440e1e6d61cc77b9e2d8d0186bce261146\",\"dweb:/ipfs/QmRmWWwTaJ7JPZZnJXavjJNXBzEjaK4KEzxaWj5MeJQUuH\"]},\"node_modules/@latticexyz/store/src/Schema.sol\":{\"keccak256\":\"0xf06793dc2e9e9994403d29125359eb2f326b0e6e502d51a8e6e4e45fc9d90a3c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8cb23bf421b29839200e5584a770186309dd05cd77d4345c964f47528117a244\",\"dweb:/ipfs/QmQBvrDAtoqibky7CjCLKxGz3MquxK1iNk2Yac55Lc4xF5\"]},\"node_modules/@latticexyz/store/src/Slice.sol\":{\"keccak256\":\"0x14879c6c859cad89451616dcee1ab6222fd565849809b89407de48f0c1a01133\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://924caa18aa0e656a295da626d586dfb120bbea321123010462b0640c7e0c52c4\",\"dweb:/ipfs/QmNueqwy4g5mwq9kXaPzue8X2mqyFjH2P2AFi3pNN3WTAt\"]},\"node_modules/@latticexyz/store/src/Storage.sol\":{\"keccak256\":\"0x2ccca6556a3c2595479914d30efa84fc3b61cff30036522714a0ef99289ee2af\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9d169812a4159454be580d42fedee63d121646102e6462fe3b2ea905b69bee07\",\"dweb:/ipfs/QmXiKsMeN4nsdiqDwhuWfb4J3UF57B4rkuwkfbrRXA6vtb\"]},\"node_modules/@latticexyz/store/src/StoreCore.sol\":{\"keccak256\":\"0xf49b4fc780939cba8d47a8bb27cca0da280ef66bdb13fbdba7b592904f60b38c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f059ba3c075335bae6dca93acb60ea9738bd5c103de3921f50c641a843bf57fd\",\"dweb:/ipfs/QmVsnyfkNtb794qxgJcU3hdUNhXBYcbCWh57taz56DiL9K\"]},\"node_modules/@latticexyz/store/src/StoreSwitch.sol\":{\"keccak256\":\"0x101cad457c139da328dc9263a1e8d4def87d828305f47f2a83b0bae681f69ed2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://158cbf36ba5b46ab273b7a1382003a2f74bbced189d1f54c9bb2f8608787703e\",\"dweb:/ipfs/QmfWbQgk9uto7g5RyHqnfr8FpXEcDRw2jEb2vAxHaNDFQ5\"]},\"node_modules/@latticexyz/store/src/TableId.sol\":{\"keccak256\":\"0x8c55662dc4f66be577bb96bfdcb65d95fe1323c733443ab749cb9ec1e58f0a6e\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://209ed70247c1c64b56d9b21f2902e67e0994cb89ac19be8e1553dac9d978fb76\",\"dweb:/ipfs/QmVLYNDwBL3GZidDpwqFZx916zoGZ5tWVztxKQFEEzVybP\"]},\"node_modules/@latticexyz/store/src/Utils.sol\":{\"keccak256\":\"0x426216bfa1c0e70640787007a6e39257cf09e586fd04831ea4fb3dd9c5768fc4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://38e657fa9cfaebe39477eaff27d1ad4d7eeaf0c0058539d2ec7e6976d93df4f4\",\"dweb:/ipfs/QmRuaxqRjUrHHC2ZyTnpmq6sfrWGCDh91B6F5chFAToU6U\"]},\"node_modules/@latticexyz/store/src/codegen/Tables.sol\":{\"keccak256\":\"0x2eba8dd4e9f07b505438a2fb744ac7da26b1f6321b8a88054e9442db947ab435\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://bd1a60dfff209a3f1df84aeb5d7f8a5cf0419c19be63bac428df0a779d5ba437\",\"dweb:/ipfs/QmaHem2GMJPHrtr1f7fk1ThTBESdYipmBxEEoKT1DBRmsd\"]},\"node_modules/@latticexyz/store/src/codegen/tables/Callbacks.sol\":{\"keccak256\":\"0xd08a349a80fd3c118b2565f90c3f0009de8fda334d5ccbefed9cce2593969a8f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a31bf1a5cdd7637e33beb087fb5a403c7e744760f859ac4782dc456496882490\",\"dweb:/ipfs/QmTRzEZStf8puC5mWrbhgtq4wUiibQ3CG1KrBogHuzqwz2\"]},\"node_modules/@latticexyz/store/src/codegen/tables/Hooks.sol\":{\"keccak256\":\"0xd1d26a119318b5348e4ced17668a3e65fa1098dd93924725689645422b304193\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9067ff17adebe5409e1adcaf9b341021a9698dc25358b23d66ffb83985b360cb\",\"dweb:/ipfs/QmSZS83ogfbY8J6Uxs7n6hJoH9uq3Rej25h2uR4ZKfSu14\"]},\"node_modules/@latticexyz/store/src/codegen/tables/Mixed.sol\":{\"keccak256\":\"0x9931ff796508d48d2d4848b81db5508856589084660b86b5c50bee6ded0b4064\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3c77463faf354200fab92a74a31af868330b54d97cdd6d2c277317d43879bd3f\",\"dweb:/ipfs/Qmf8nj8ibymTR1ZkBKVX3RdegT81taBidw7zGryMsJGkU6\"]},\"node_modules/@latticexyz/store/src/codegen/tables/StoreMetadata.sol\":{\"keccak256\":\"0x0091f547cc1515247ee0161550973c1e6f448cc5e8b775a90dcca2b892fc32fd\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1b513683f0d1afc1d586f42fa150f75fadaa2d2fee1928bb465d7b23564df8e3\",\"dweb:/ipfs/QmR62XNtRracRgta9Jh9VVBvux9RmM5R5h17sSZZUfJ8nS\"]},\"node_modules/@latticexyz/store/src/codegen/tables/Vector2.sol\":{\"keccak256\":\"0x88a138ab11926ea728d95eda67ee5b789e184bf77850aaf4a46b99d537febc3b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d856ed9f2cb1c3727d6b46031c51c8b71bcbc49dc02af6bcb98672f2301de15a\",\"dweb:/ipfs/QmNyDgKrq4bZCKFLDkRxuacHwvBzYii5rwaoczUcLvS745\"]},\"node_modules/@latticexyz/store/src/tightcoder/DecodeSlice.sol\":{\"keccak256\":\"0xe760dfb8ff20cfb44eee6a5f03ac84abbc91382fca2e36c88c92046e6b3a66e0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://75eb4b355c547ffee62031d8dfb80844fa31fa4460543a088278083662dc4c12\",\"dweb:/ipfs/Qmf8sRcrjJ6hEQ8TPwwe6KcXcE2MPw7Juvf7fKBZ1fBCt6\"]},\"node_modules/@latticexyz/store/src/tightcoder/EncodeArray.sol\":{\"keccak256\":\"0x046f0a2dc543c7a80be91ff26b19990a10fbe73cb605f4944af38e04326a43df\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d94f038e70179571d2aed3cbe03e812ce79a471372171fb78e8189bebd7ae1ac\",\"dweb:/ipfs/QmUV4bkaEc8hefLpLRaGwmu4WZsqRLE9e6R8UdaKPExb6p\"]},\"node_modules/@latticexyz/store/src/tightcoder/TightCoder.sol\":{\"keccak256\":\"0xff0278a4e35174bbed8a38dad8ae7506f725bfe95f0b7c13829c353d68dd25dc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://26249ec0c2fa3a3430a2f8edbfc5cd678e34ea1cf1d7490ecaf1e925c976eb85\",\"dweb:/ipfs/QmUpkhr5kFiDKc7rZ2z5HcTf5PkrWVJu5sa31tYv911cPL\"]},\"node_modules/forge-std/src/console.sol\":{\"keccak256\":\"0x91d5413c2434ca58fd278b6e1e79fd98d10c83931cc2596a6038eee4daeb34ba\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://91ccea707361e48b9b7a161fe81f496b9932bc471e9c4e4e1e9c283f2453cc70\",\"dweb:/ipfs/QmcB66sZhQ6Kz7MUHcLE78YXRUZxoZnnxZjN6yATsbB2ec\"]},\"src/AccessControl.sol\":{\"keccak256\":\"0x85b5f2b3fb0a96c223f77e2f3a4ceb0ca74bb8f6b269a1555f40779214494f1b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ef026f8c1705354fecabeefc9d1c121f93291138345e6d74766091cf6cac0c24\",\"dweb:/ipfs/QmaYvjBaBheDNwDWCDShfH8mdtBiQSmZewUjJcXsa8XWJ1\"]},\"src/Call.sol\":{\"keccak256\":\"0x27114d009081f1f0a5c0b62c9ebe30415c76ed02fa46b305202bb5163711d926\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a553cf84c877160c8db6978083f09632800032de6dcc5d8a5c3b9c18cabeb578\",\"dweb:/ipfs/QmWyCDz5NobNAHEs1PCftXJzV5oCu5SKfmzfA9BynSccGn\"]},\"src/ResourceSelector.sol\":{\"keccak256\":\"0xf6a1714d556e95fda532f630ac1bd8fd9843e980dffce29f81a29c0b6f02d368\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5075e64cc1224bcd8ab46c16f85874ac91efecbf5cbeb82e5c1e3fa4f1a1edfa\",\"dweb:/ipfs/QmTqCVF6k7CMsiUJ223mXumjVyoCCNU2uE9fUHDgBmDdRj\"]},\"src/System.sol\":{\"keccak256\":\"0xf1342c8461adb4c5821c1ca106a67ba34402b36265fa63bf766eed937bd92bf9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ea41f96a27a26d56d62824e007b3b0234d44fcd94361e5c8f40fdb334cbf444b\",\"dweb:/ipfs/QmRfj4iS5Lu9V4e47wsPQy4op1qQ6hqaJpERLB5EyzqW38\"]},\"src/Types.sol\":{\"keccak256\":\"0xc5784c3845cb97da4e1147a62163865bfb0090f43a6c3f672d5d69b7806e6545\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e849e5c0f3cf032ae2d5e77117f15cc942aa65f276e63a14feefe5b9bdd8b545\",\"dweb:/ipfs/QmSCpGZSBHjxrKm8LGD5tTEwe16aVd2ugQv5itA648hsVm\"]},\"src/WorldContext.sol\":{\"keccak256\":\"0xd44a445ff07ac1551e5a8f17450381664ecf68dcb1c89fee8fb11b9b73c9cd7b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1235cc5636743b9afbb313676fc4c84ac5607142c758b0bfc59107aff79ed30c\",\"dweb:/ipfs/QmUtTUFjxKy7GtQC1Uzn6B2bRNZpcASFySPDjd16T47Rcz\"]},\"src/constants.sol\":{\"keccak256\":\"0xa0ae422aceefe0e7f200448201769e2bc527fa9e647475f65401558a03c0a83d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a2473ca8ab5e184b7320c476fd07bdff31ff450fc750ab9eabb9c0a2ee43776e\",\"dweb:/ipfs/QmQ7sBqwPgj4AtsENyzCMFWVQeMzV5uuCN8ygNU2pKYotE\"]},\"src/interfaces/IStoreRegistrationSystem.sol\":{\"keccak256\":\"0x1bfecd0a6ede867c6f0d69e96b0247304f6f0e41ccf789006c19a2a150c7c9ca\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3252d7a5fbb873b1c02c8464a75a5722f091fa3d986d111af3eaa143a01f396f\",\"dweb:/ipfs/QmWMzs3PeWT5Pw8XnsmnVhHshEEZavPhR6NL3Rm3b5B2JG\"]},\"src/interfaces/ISystemHook.sol\":{\"keccak256\":\"0x6302d7467fb8b6ddf1bc089037e2b5c06441e8f975caf172f4875686b822448d\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6adcd8e6d0a1d8c1e027398e5159533561002bb321df887baedcb0fbdc05c91f\",\"dweb:/ipfs/QmXAVXzE6hMysP7SXvxKt6XetH7bnvGVUuXJVJqmG22RSn\"]},\"src/interfaces/IWorldErrors.sol\":{\"keccak256\":\"0x214a9f68915fb01baad4a4ca2c65545d26e481fc14b0ceadb9e4f378c4eec08a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://54b93db1cb7d5212d54fe776587d5ceddf56ab276cc72c969f28604bddb8b665\",\"dweb:/ipfs/QmSQJ82HRvBaknXWnwXWNYJj9EHuaiBCPe7W9C9uwyUNCW\"]},\"src/modules/core/constants.sol\":{\"keccak256\":\"0xf8dd287f03dad9b27801f74977c49e9fd8d4f36b8084ef8a742fa39a18f158bc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c391d8f7b843a8e71b696218e4463167ee5ee220a783fac0d17adf41d6fc04cf\",\"dweb:/ipfs/QmWNQQWpzrG8oXaZdUYSixkEpf3Dci9F2BtUJnWhjNyQaw\"]},\"src/modules/core/implementations/StoreRegistrationSystem.sol\":{\"keccak256\":\"0x621c5fbb3e6d80b91002169da8a7b0a3401f36a6f238de3d6c6f63d2472ccefc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a5529a9a1834a164a1f29336b57f80c7a53990939fe277dd230e0efd8fbd775f\",\"dweb:/ipfs/QmdHYDKPub4Euvt3fg9wRxRUPy7S9bfB139tXLByGnHsLn\"]},\"src/modules/core/implementations/WorldRegistrationSystem.sol\":{\"keccak256\":\"0x86aa735c9951644467c8db402f4631ce977ee2a83602c054a2a3367d4b398320\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a255a1efdfe19761cca4b3d61d2731b6cda679295037d856a978e5881124e67b\",\"dweb:/ipfs/QmQKAXiVbqPGiKhr9K7RiN7hH5cpTCBmkne3QE7UeLLSkQ\"]},\"src/modules/core/tables/FunctionSelectors.sol\":{\"keccak256\":\"0xf34299a05aba86c9a9224e7f75d419728107ff5a04147469fa5bf3c682323781\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9e37d6111bf3c15186179d91682a60eed40bf261c6a007d4a3392427aaa5417a\",\"dweb:/ipfs/QmeR4fZM1DmWesehSnEf45EpaPsxH5YAe3815VaPJN8Wvv\"]},\"src/modules/core/tables/ResourceType.sol\":{\"keccak256\":\"0x220250af4468861c4bf75e47ee227d3fdfc80c02c3d988f6de29503a285e4e89\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d3bbeae4b806ae73367a126546880bfe4ae00ed287fe8a595958aa0d2db07cfa\",\"dweb:/ipfs/QmQmquSugDyszpgBcmiQZSAwnaYSdQY9N2Z2cMKyrja8RK\"]},\"src/modules/core/tables/SystemRegistry.sol\":{\"keccak256\":\"0x8ab24db176f31f231b8e63e6ae1d69780a3173ebfd11555fd5358b114df5295b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://3a9cc20faebcde6828a7a278b0dc42799d99fdebc716dc86ca597daacba2b716\",\"dweb:/ipfs/QmXXe7tM6JPSYti713uQwSAuk4ZyaJsfdWmHEat1B1pmAs\"]},\"src/modules/core/tables/Systems.sol\":{\"keccak256\":\"0x08c7040b9be713161ce7eea6a2657694cc15bf2bcb7cbdb067bfb13e4d7f589f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://32b61b2ddf02943d0cf7b75dbe3b792ac3df6d8e2dd0332ccfa4f4642c6e1933\",\"dweb:/ipfs/QmZPQF6D1ths75JsUFo24FoRkTjEC2DaWLhgKedKPAgtrG\"]},\"src/tables/NamespaceOwner.sol\":{\"keccak256\":\"0x773f6897309d480e5b5aec746db0cf50f1beb569e4d08aa57eca6386cd8245d4\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://91e1e4d64d0be9a7a4ec6a24f61337ab74d02d56b53c4ec8bff5bd4669b02db7\",\"dweb:/ipfs/Qmb38h2GuFLBZRQnZ9FPp4YjY1iCo5NNAoWiCiqLXDcPxD\"]},\"src/tables/ResourceAccess.sol\":{\"keccak256\":\"0x8bd985412e4ea2489c07422f7fee6fd1ebb24611e941e911d65475ba9cedccc9\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ed9ab9f637220e0837abfec8803fe04ace9a6db63855624a5f69ad275cc630cb\",\"dweb:/ipfs/QmRYckxLqdkPYedM1UFfBG4cVtFxbhMGWDVKCgW74iywRk\"]}},\"version\":1}",
84
84
  "metadata": {
85
85
  "compiler": {
86
86
  "version": "0.8.13+commit.abaa5c0e"
@@ -422,10 +422,10 @@
422
422
  "license": "MIT"
423
423
  },
424
424
  "src/interfaces/IStoreRegistrationSystem.sol": {
425
- "keccak256": "0xadea1caaeba91185fd9170ccc3e9403be18098120925ad648123bb0518b556a2",
425
+ "keccak256": "0x1bfecd0a6ede867c6f0d69e96b0247304f6f0e41ccf789006c19a2a150c7c9ca",
426
426
  "urls": [
427
- "bzz-raw://1dece5a0660d1c2b9c4b9e7510fc1d3c267b607c263f6a88cd1dfa3cf00edd09",
428
- "dweb:/ipfs/QmS1amAtXvppuBB9tdkdte9cF7dBZx47dR3WVGHAoufrST"
427
+ "bzz-raw://3252d7a5fbb873b1c02c8464a75a5722f091fa3d986d111af3eaa143a01f396f",
428
+ "dweb:/ipfs/QmWMzs3PeWT5Pw8XnsmnVhHshEEZavPhR6NL3Rm3b5B2JG"
429
429
  ],
430
430
  "license": "MIT"
431
431
  },
@@ -535,7 +535,7 @@
535
535
  ]
536
536
  },
537
537
  "nodeType": "SourceUnit",
538
- "src": "32:488:60",
538
+ "src": "32:486:60",
539
539
  "nodes": [
540
540
  {
541
541
  "id": 34796,
@@ -552,10 +552,10 @@
552
552
  {
553
553
  "id": 34799,
554
554
  "nodeType": "ImportDirective",
555
- "src": "107:99:60",
555
+ "src": "107:97:60",
556
556
  "nodes": [],
557
557
  "absolutePath": "src/modules/core/implementations/StoreRegistrationSystem.sol",
558
- "file": "./../modules/core/implementations/StoreRegistrationSystem.sol",
558
+ "file": "../modules/core/implementations/StoreRegistrationSystem.sol",
559
559
  "nameLocation": "-1:-1:-1",
560
560
  "scope": 34830,
561
561
  "sourceUnit": 35821,
@@ -590,19 +590,19 @@
590
590
  {
591
591
  "id": 34829,
592
592
  "nodeType": "ContractDefinition",
593
- "src": "208:311:60",
593
+ "src": "206:311:60",
594
594
  "nodes": [
595
595
  {
596
596
  "id": 34810,
597
597
  "nodeType": "FunctionDefinition",
598
- "src": "247:88:60",
598
+ "src": "245:88:60",
599
599
  "nodes": [],
600
600
  "functionSelector": "d5933686",
601
601
  "implemented": false,
602
602
  "kind": "function",
603
603
  "modifiers": [],
604
604
  "name": "registerSchema",
605
- "nameLocation": "256:14:60",
605
+ "nameLocation": "254:14:60",
606
606
  "parameters": {
607
607
  "id": 34808,
608
608
  "nodeType": "ParameterList",
@@ -612,10 +612,10 @@
612
612
  "id": 34801,
613
613
  "mutability": "mutable",
614
614
  "name": "tableId",
615
- "nameLocation": "279:7:60",
615
+ "nameLocation": "277:7:60",
616
616
  "nodeType": "VariableDeclaration",
617
617
  "scope": 34810,
618
- "src": "271:15:60",
618
+ "src": "269:15:60",
619
619
  "stateVariable": false,
620
620
  "storageLocation": "default",
621
621
  "typeDescriptions": {
@@ -626,7 +626,7 @@
626
626
  "id": 34800,
627
627
  "name": "bytes32",
628
628
  "nodeType": "ElementaryTypeName",
629
- "src": "271:7:60",
629
+ "src": "269:7:60",
630
630
  "typeDescriptions": {
631
631
  "typeIdentifier": "t_bytes32",
632
632
  "typeString": "bytes32"
@@ -639,10 +639,10 @@
639
639
  "id": 34804,
640
640
  "mutability": "mutable",
641
641
  "name": "valueSchema",
642
- "nameLocation": "295:11:60",
642
+ "nameLocation": "293:11:60",
643
643
  "nodeType": "VariableDeclaration",
644
644
  "scope": 34810,
645
- "src": "288:18:60",
645
+ "src": "286:18:60",
646
646
  "stateVariable": false,
647
647
  "storageLocation": "default",
648
648
  "typeDescriptions": {
@@ -657,10 +657,10 @@
657
657
  "name": "Schema",
658
658
  "nodeType": "IdentifierPath",
659
659
  "referencedDeclaration": 18979,
660
- "src": "288:6:60"
660
+ "src": "286:6:60"
661
661
  },
662
662
  "referencedDeclaration": 18979,
663
- "src": "288:6:60",
663
+ "src": "286:6:60",
664
664
  "typeDescriptions": {
665
665
  "typeIdentifier": "t_userDefinedValueType$_Schema_$18979",
666
666
  "typeString": "Schema"
@@ -673,10 +673,10 @@
673
673
  "id": 34807,
674
674
  "mutability": "mutable",
675
675
  "name": "keySchema",
676
- "nameLocation": "315:9:60",
676
+ "nameLocation": "313:9:60",
677
677
  "nodeType": "VariableDeclaration",
678
678
  "scope": 34810,
679
- "src": "308:16:60",
679
+ "src": "306:16:60",
680
680
  "stateVariable": false,
681
681
  "storageLocation": "default",
682
682
  "typeDescriptions": {
@@ -691,10 +691,10 @@
691
691
  "name": "Schema",
692
692
  "nodeType": "IdentifierPath",
693
693
  "referencedDeclaration": 18979,
694
- "src": "308:6:60"
694
+ "src": "306:6:60"
695
695
  },
696
696
  "referencedDeclaration": 18979,
697
- "src": "308:6:60",
697
+ "src": "306:6:60",
698
698
  "typeDescriptions": {
699
699
  "typeIdentifier": "t_userDefinedValueType$_Schema_$18979",
700
700
  "typeString": "Schema"
@@ -703,13 +703,13 @@
703
703
  "visibility": "internal"
704
704
  }
705
705
  ],
706
- "src": "270:55:60"
706
+ "src": "268:55:60"
707
707
  },
708
708
  "returnParameters": {
709
709
  "id": 34809,
710
710
  "nodeType": "ParameterList",
711
711
  "parameters": [],
712
- "src": "334:0:60"
712
+ "src": "332:0:60"
713
713
  },
714
714
  "scope": 34829,
715
715
  "stateMutability": "nonpayable",
@@ -719,14 +719,14 @@
719
719
  {
720
720
  "id": 34820,
721
721
  "nodeType": "FunctionDefinition",
722
- "src": "339:104:60",
722
+ "src": "337:104:60",
723
723
  "nodes": [],
724
724
  "functionSelector": "fe86a89f",
725
725
  "implemented": false,
726
726
  "kind": "function",
727
727
  "modifiers": [],
728
728
  "name": "setMetadata",
729
- "nameLocation": "348:11:60",
729
+ "nameLocation": "346:11:60",
730
730
  "parameters": {
731
731
  "id": 34818,
732
732
  "nodeType": "ParameterList",
@@ -736,10 +736,10 @@
736
736
  "id": 34812,
737
737
  "mutability": "mutable",
738
738
  "name": "tableId",
739
- "nameLocation": "368:7:60",
739
+ "nameLocation": "366:7:60",
740
740
  "nodeType": "VariableDeclaration",
741
741
  "scope": 34820,
742
- "src": "360:15:60",
742
+ "src": "358:15:60",
743
743
  "stateVariable": false,
744
744
  "storageLocation": "default",
745
745
  "typeDescriptions": {
@@ -750,7 +750,7 @@
750
750
  "id": 34811,
751
751
  "name": "bytes32",
752
752
  "nodeType": "ElementaryTypeName",
753
- "src": "360:7:60",
753
+ "src": "358:7:60",
754
754
  "typeDescriptions": {
755
755
  "typeIdentifier": "t_bytes32",
756
756
  "typeString": "bytes32"
@@ -763,10 +763,10 @@
763
763
  "id": 34814,
764
764
  "mutability": "mutable",
765
765
  "name": "tableName",
766
- "nameLocation": "393:9:60",
766
+ "nameLocation": "391:9:60",
767
767
  "nodeType": "VariableDeclaration",
768
768
  "scope": 34820,
769
- "src": "377:25:60",
769
+ "src": "375:25:60",
770
770
  "stateVariable": false,
771
771
  "storageLocation": "calldata",
772
772
  "typeDescriptions": {
@@ -777,7 +777,7 @@
777
777
  "id": 34813,
778
778
  "name": "string",
779
779
  "nodeType": "ElementaryTypeName",
780
- "src": "377:6:60",
780
+ "src": "375:6:60",
781
781
  "typeDescriptions": {
782
782
  "typeIdentifier": "t_string_storage_ptr",
783
783
  "typeString": "string"
@@ -790,10 +790,10 @@
790
790
  "id": 34817,
791
791
  "mutability": "mutable",
792
792
  "name": "fieldNames",
793
- "nameLocation": "422:10:60",
793
+ "nameLocation": "420:10:60",
794
794
  "nodeType": "VariableDeclaration",
795
795
  "scope": 34820,
796
- "src": "404:28:60",
796
+ "src": "402:28:60",
797
797
  "stateVariable": false,
798
798
  "storageLocation": "calldata",
799
799
  "typeDescriptions": {
@@ -805,7 +805,7 @@
805
805
  "id": 34815,
806
806
  "name": "string",
807
807
  "nodeType": "ElementaryTypeName",
808
- "src": "404:6:60",
808
+ "src": "402:6:60",
809
809
  "typeDescriptions": {
810
810
  "typeIdentifier": "t_string_storage_ptr",
811
811
  "typeString": "string"
@@ -813,7 +813,7 @@
813
813
  },
814
814
  "id": 34816,
815
815
  "nodeType": "ArrayTypeName",
816
- "src": "404:8:60",
816
+ "src": "402:8:60",
817
817
  "typeDescriptions": {
818
818
  "typeIdentifier": "t_array$_t_string_storage_$dyn_storage_ptr",
819
819
  "typeString": "string[]"
@@ -822,13 +822,13 @@
822
822
  "visibility": "internal"
823
823
  }
824
824
  ],
825
- "src": "359:74:60"
825
+ "src": "357:74:60"
826
826
  },
827
827
  "returnParameters": {
828
828
  "id": 34819,
829
829
  "nodeType": "ParameterList",
830
830
  "parameters": [],
831
- "src": "442:0:60"
831
+ "src": "440:0:60"
832
832
  },
833
833
  "scope": 34829,
834
834
  "stateMutability": "nonpayable",
@@ -838,14 +838,14 @@
838
838
  {
839
839
  "id": 34828,
840
840
  "nodeType": "FunctionDefinition",
841
- "src": "447:70:60",
841
+ "src": "445:70:60",
842
842
  "nodes": [],
843
843
  "functionSelector": "6e81fd71",
844
844
  "implemented": false,
845
845
  "kind": "function",
846
846
  "modifiers": [],
847
847
  "name": "registerStoreHook",
848
- "nameLocation": "456:17:60",
848
+ "nameLocation": "454:17:60",
849
849
  "parameters": {
850
850
  "id": 34826,
851
851
  "nodeType": "ParameterList",
@@ -855,10 +855,10 @@
855
855
  "id": 34822,
856
856
  "mutability": "mutable",
857
857
  "name": "tableId",
858
- "nameLocation": "482:7:60",
858
+ "nameLocation": "480:7:60",
859
859
  "nodeType": "VariableDeclaration",
860
860
  "scope": 34828,
861
- "src": "474:15:60",
861
+ "src": "472:15:60",
862
862
  "stateVariable": false,
863
863
  "storageLocation": "default",
864
864
  "typeDescriptions": {
@@ -869,7 +869,7 @@
869
869
  "id": 34821,
870
870
  "name": "bytes32",
871
871
  "nodeType": "ElementaryTypeName",
872
- "src": "474:7:60",
872
+ "src": "472:7:60",
873
873
  "typeDescriptions": {
874
874
  "typeIdentifier": "t_bytes32",
875
875
  "typeString": "bytes32"
@@ -882,10 +882,10 @@
882
882
  "id": 34825,
883
883
  "mutability": "mutable",
884
884
  "name": "hook",
885
- "nameLocation": "502:4:60",
885
+ "nameLocation": "500:4:60",
886
886
  "nodeType": "VariableDeclaration",
887
887
  "scope": 34828,
888
- "src": "491:15:60",
888
+ "src": "489:15:60",
889
889
  "stateVariable": false,
890
890
  "storageLocation": "default",
891
891
  "typeDescriptions": {
@@ -900,10 +900,10 @@
900
900
  "name": "IStoreHook",
901
901
  "nodeType": "IdentifierPath",
902
902
  "referencedDeclaration": 18472,
903
- "src": "491:10:60"
903
+ "src": "489:10:60"
904
904
  },
905
905
  "referencedDeclaration": 18472,
906
- "src": "491:10:60",
906
+ "src": "489:10:60",
907
907
  "typeDescriptions": {
908
908
  "typeIdentifier": "t_contract$_IStoreHook_$18472",
909
909
  "typeString": "contract IStoreHook"
@@ -912,13 +912,13 @@
912
912
  "visibility": "internal"
913
913
  }
914
914
  ],
915
- "src": "473:34:60"
915
+ "src": "471:34:60"
916
916
  },
917
917
  "returnParameters": {
918
918
  "id": 34827,
919
919
  "nodeType": "ParameterList",
920
920
  "parameters": [],
921
- "src": "516:0:60"
921
+ "src": "514:0:60"
922
922
  },
923
923
  "scope": 34829,
924
924
  "stateMutability": "nonpayable",
@@ -936,7 +936,7 @@
936
936
  34829
937
937
  ],
938
938
  "name": "IStoreRegistrationSystem",
939
- "nameLocation": "218:24:60",
939
+ "nameLocation": "216:24:60",
940
940
  "scope": 34830,
941
941
  "usedErrors": []
942
942
  }
@@ -0,0 +1,2 @@
1
+ import{f as o}from"./chunk-XSZNAEUO.js";import"@latticexyz/store/register";import{mudConfig as c,mudCoreConfig as C,resolveTableId as g}from"@latticexyz/store/register";import{extendMUDCoreConfig as t,fromZodErrorCustom as i}from"@latticexyz/config";import{ZodError as n}from"zod";t(r=>{try{return o.parse(r)}catch(e){throw e instanceof n?i(e,"WorldConfig Validation Error"):e}});import"@latticexyz/store/register";export{c as a,C as b,g as c};
2
+ //# sourceMappingURL=chunk-KXMVYZUU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../ts/register/index.ts","../ts/register/configExtensions.ts","../ts/register/typeExtensions.ts"],"sourcesContent":["// Importing this file has side-effects for MUD config,\n// and the order of imports is important in relation to other plugins\n// (store should usually be the first plugin, followed by world)\n\n// For convenience register and reexport store (which does the same for core config),\n// to reduce the number of needed imports for users\nimport \"@latticexyz/store/register\";\nexport { mudConfig, mudCoreConfig, resolveTableId } from \"@latticexyz/store/register\";\n// Extend core config and types\nimport \"./configExtensions\";\nimport \"./typeExtensions\";\n","import { extendMUDCoreConfig, fromZodErrorCustom } from \"@latticexyz/config\";\nimport { ZodError } from \"zod\";\nimport { zPluginWorldConfig } from \"../library\";\n\nextendMUDCoreConfig((config) => {\n // This function gets called within mudConfig.\n // The call order of config extenders depends on the order of their imports.\n // Any config validation and transformation should be placed here.\n try {\n return zPluginWorldConfig.parse(config);\n } catch (error) {\n if (error instanceof ZodError) {\n throw fromZodErrorCustom(error, \"WorldConfig Validation Error\");\n } else {\n throw error;\n }\n }\n});\n","import { OrDefaults } from \"@latticexyz/common/type-utils\";\nimport { MUDCoreUserConfig } from \"@latticexyz/config\";\nimport { ExpandSystemsConfig, WorldConfig, WorldUserConfig, WORLD_DEFAULTS } from \"../library\";\n\nimport \"@latticexyz/store/register\";\n\n// Inject the plugin options into the core config.\n// Re-exporting an interface of an existing module merges them, adding new options to the interface.\n// (typescript has no way to override types)\ndeclare module \"@latticexyz/config\" {\n // Extend the user config type, which represents the config as written by the users.\n // Most things are optional here.\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface MUDCoreUserConfig extends WorldUserConfig {}\n\n // Also extend the config type, which represents the configuration after it has been resolved.\n // It should not have any optional properties, with the default values applied instead.\n // Other plugins may receive this resolved config as their input.\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface MUDCoreConfig extends WorldConfig {}\n}\n\ndeclare module \"@latticexyz/store/register\" {\n export interface ExpandMUDUserConfig<T extends MUDCoreUserConfig>\n extends OrDefaults<\n T,\n {\n worldContractName: typeof WORLD_DEFAULTS.worldContractName;\n worldInterfaceName: typeof WORLD_DEFAULTS.worldInterfaceName;\n excludeSystems: typeof WORLD_DEFAULTS.excludeSystems;\n postDeployScript: typeof WORLD_DEFAULTS.postDeployScript;\n deploysDirectory: typeof WORLD_DEFAULTS.deploysDirectory;\n worldgenDirectory: typeof WORLD_DEFAULTS.worldgenDirectory;\n worldImportPath: typeof WORLD_DEFAULTS.worldImportPath;\n modules: typeof WORLD_DEFAULTS.modules;\n }\n > {\n overrideSystems: ExpandSystemsConfig<\n T[\"overrideSystems\"] extends Record<string, unknown> ? T[\"overrideSystems\"] : Record<string, never>\n >;\n }\n}\n"],"mappings":"wCAMA,MAAO,6BACP,OAAS,aAAAA,EAAW,iBAAAC,EAAe,kBAAAC,MAAsB,6BCPzD,OAAS,uBAAAC,EAAqB,sBAAAC,MAA0B,qBACxD,OAAS,YAAAC,MAAgB,MAGzBC,EAAqBC,GAAW,CAI9B,GAAI,CACF,OAAOC,EAAmB,MAAMD,CAAM,CACxC,OAASE,EAAP,CACA,MAAIA,aAAiBC,EACbC,EAAmBF,EAAO,8BAA8B,EAExDA,CAEV,CACF,CAAC,ECbD,MAAO","names":["mudConfig","mudCoreConfig","resolveTableId","extendMUDCoreConfig","fromZodErrorCustom","ZodError","extendMUDCoreConfig","config","zPluginWorldConfig","error","ZodError","fromZodErrorCustom"]}
@@ -0,0 +1,30 @@
1
+ var S={registerFunctionSelector:!0,openAccess:!0,accessList:[]},l={worldContractName:void 0,worldInterfaceName:"IWorld",overrideSystems:{},excludeSystems:[],postDeployScript:"PostDeploy",deploysDirectory:"./deploys",worldgenDirectory:"world",worldImportPath:"@latticexyz/world/src/",modules:[]};import{getDuplicates as j,MUDError as T,STORE_SELECTOR_MAX_LENGTH as z,UnrecognizedSystemErrorFactory as I}from"@latticexyz/config";function b(r,o){let c=o?.filter(e=>e.endsWith("System")&&e!=="System"&&!e.match(/^I[A-Z]/))??[],n=Object.keys(r.overrideSystems);if(o){for(let e of n)if(!o.includes(e)||e==="World")throw I(["overrideSystems",e],e)}let m=[...new Set([...c,...n])].filter(e=>!r.excludeSystems.includes(e)).reduce((e,p)=>({...e,[p]:O(p,r.overrideSystems[p],o)}),{}),s=Object.values(r.tables).map(({name:e})=>e),a=Object.values(m).map(({name:e})=>e),d=j([...s,...a]);if(d.length>0)throw new T(`Table and system names must be unique: ${d.join(", ")}`);return{systems:m}}function O(r,o,c){let n=o?.name??r.slice(0,z),i=o?.registerFunctionSelectors??!0,m=o?.openAccess??!0,s=[],a=[],d=o&&!o.openAccess?o.accessList:[];for(let e of d)if(e.startsWith("0x"))s.push(e);else{if(c&&!c.includes(e))throw I(["overrideSystems",r,"accessList"],e);a.push(e)}return{name:n,registerFunctionSelectors:i,openAccess:m,accessListAddresses:s,accessListSystems:a}}import{z as t}from"zod";import{DynamicResolutionType as E,zEthereumAddress as F,zObjectName as w,zSelector as _}from"@latticexyz/config";var g=w,U=w,M=t.array(g.or(F)).default(S.accessList),B=t.intersection(t.object({name:_,registerFunctionSelectors:t.boolean().default(S.registerFunctionSelector)}),t.discriminatedUnion("openAccess",[t.object({openAccess:t.literal(!0).default(S.openAccess)}),t.object({openAccess:t.literal(!1),accessList:M})])),G=t.object({value:t.union([t.string(),t.number(),t.instanceof(Uint8Array)]),type:t.string()}),H=t.object({type:t.nativeEnum(E),input:t.string()}),k=t.object({name:U,root:t.boolean().default(!1),args:t.array(t.union([G,H])).default([])}),K=t.object({worldContractName:t.string().optional(),worldInterfaceName:t.string().default(l.worldInterfaceName),overrideSystems:t.record(g,B).default(l.overrideSystems),excludeSystems:t.array(g).default(l.excludeSystems),postDeployScript:t.string().default(l.postDeployScript),deploysDirectory:t.string().default(l.deploysDirectory),worldgenDirectory:t.string().default(l.worldgenDirectory),worldImportPath:t.string().default(l.worldImportPath),modules:t.array(k).default(l.modules)}),me=K.catchall(t.any());import{renderArguments as h,renderList as W,renderedSolidityHeader as Y,renderImports as q}from"@latticexyz/common/codegen";function $(r){let{imports:o,name:c,functionPrefix:n,functions:i,errors:m}=r;return`${Y}
2
+
3
+ ${q(o)}
4
+
5
+ interface ${c} {
6
+ ${W(m,({name:s,parameters:a})=>`error ${s}(${h(a)});`)}
7
+
8
+ ${W(i,({name:s,parameters:a,stateMutability:d,returnParameters:e})=>`
9
+ function ${n}${s}(
10
+ ${h(a)}
11
+ ) external ${d} ${V(e)};
12
+ `)}
13
+ }
14
+
15
+ `}function V(r){return r.length>0?`returns (${h(r)})`:""}import{renderArguments as X,renderedSolidityHeader as Z,renderAbsoluteImports as J,renderRelativeImports as Q}from"@latticexyz/common/codegen";function v(r){let{interfaceName:o,storeImportPath:c,worldImportPath:n,imports:i}=r,m=o==="IBaseWorld"?[{symbol:"IStore",path:`${c}IStore.sol`},{symbol:"IWorldKernel",path:`${n}interfaces/IWorldKernel.sol`}]:[{symbol:"IBaseWorld",path:`${n}interfaces/IBaseWorld.sol`}],s=[...m,...i].map(({symbol:a})=>a);return`${Z}
16
+
17
+ ${J(m)}
18
+
19
+ ${Q(i)}
20
+
21
+ /**
22
+ * The ${o} interface includes all systems dynamically added to the World
23
+ * during the deploy process.
24
+ */
25
+ interface ${o} is ${X(s)} {
26
+
27
+ }
28
+
29
+ `}import{readFileSync as ee}from"fs";import u from"path";import{formatAndWriteSolidity as D,contractToInterface as te}from"@latticexyz/common/codegen";async function xe(r,o,c){let n=b(r,o.map(({basename:e})=>e)),i=u.join(c,r.worldgenDirectory),m=o.filter(({basename:e})=>Object.keys(n.systems).includes(e)),s=[];for(let e of m){let p=ee(e.path,"utf8"),{functions:x,errors:A,symbolImports:C}=te(p,e.basename),R=C.map(f=>f.path[0]==="."?{symbol:f.symbol,fromPath:u.join(u.dirname(e.path),f.path),usedInPath:i}:{symbol:f.symbol,path:f.path}),y=`I${e.basename}`,{name:L}=n.systems[e.basename],N=$({name:y,functionPrefix:r.namespace===""?"":`${r.namespace}_${L}_`,functions:x,errors:A,imports:R}),P=u.join(i,y+".sol");await D(N,P,"Generated system interface"),s.push({symbol:y,fromPath:`${y}.sol`,usedInPath:"./"})}let a=v({interfaceName:r.worldInterfaceName,imports:s,storeImportPath:r.storeImportPath,worldImportPath:r.worldImportPath}),d=u.join(i,r.worldInterfaceName+".sol");await D(a,d,"Generated system interface")}export{S as a,l as b,b as c,O as d,K as e,me as f,$ as g,v as h,xe as i};
30
+ //# sourceMappingURL=chunk-XSZNAEUO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../ts/library/config/defaults.ts","../ts/library/config/resolveWorldConfig.ts","../ts/library/config/worldConfig.ts","../ts/library/render-solidity/renderSystemInterface.ts","../ts/library/render-solidity/renderWorld.ts","../ts/library/render-solidity/worldgen.ts"],"sourcesContent":["export const SYSTEM_DEFAULTS = {\n registerFunctionSelector: true,\n openAccess: true,\n accessList: [] as string[],\n} as const;\n\nexport const WORLD_DEFAULTS = {\n worldContractName: undefined,\n worldInterfaceName: \"IWorld\",\n overrideSystems: {} as Record<string, never>,\n excludeSystems: [] as string[],\n postDeployScript: \"PostDeploy\",\n deploysDirectory: \"./deploys\",\n worldgenDirectory: \"world\",\n worldImportPath: \"@latticexyz/world/src/\",\n modules: [] as [],\n} as const;\n","import { getDuplicates, MUDError, STORE_SELECTOR_MAX_LENGTH, UnrecognizedSystemErrorFactory } from \"@latticexyz/config\";\nimport { StoreConfig } from \"@latticexyz/store\";\nimport { SystemConfig, WorldConfig } from \"./types\";\n\nexport type ResolvedSystemConfig = ReturnType<typeof resolveSystemConfig>;\n\nexport type ResolvedWorldConfig = ReturnType<typeof resolveWorldConfig>;\n\n/**\n * Resolves the world config by combining the default and overridden system configs,\n * filtering out excluded systems, validate system names refer to existing contracts, and\n * splitting the access list into addresses and system names.\n */\nexport function resolveWorldConfig(config: StoreConfig & WorldConfig, existingContracts?: string[]) {\n // Include contract names ending in \"System\", but not the base \"System\" contract, and not Interfaces\n const defaultSystemNames =\n existingContracts?.filter((name) => name.endsWith(\"System\") && name !== \"System\" && !name.match(/^I[A-Z]/)) ?? [];\n const overriddenSystemNames = Object.keys(config.overrideSystems);\n\n // Validate every key in overrideSystems refers to an existing system contract (and is not called \"World\")\n if (existingContracts) {\n for (const systemName of overriddenSystemNames) {\n if (!existingContracts.includes(systemName) || systemName === \"World\") {\n throw UnrecognizedSystemErrorFactory([\"overrideSystems\", systemName], systemName);\n }\n }\n }\n\n // Combine the default and overridden system names and filter out excluded systems\n const systemNames = [...new Set([...defaultSystemNames, ...overriddenSystemNames])].filter(\n (name) => !config.excludeSystems.includes(name)\n );\n\n // Resolve the config\n const resolvedSystems: Record<string, ResolvedSystemConfig> = systemNames.reduce((acc, systemName) => {\n return {\n ...acc,\n [systemName]: resolveSystemConfig(systemName, config.overrideSystems[systemName], existingContracts),\n };\n }, {});\n\n // Table and system names must be unique (because they're both used for world selectors)\n const tableNames = Object.values(config.tables).map(({ name }) => name);\n const configuredSystemNames = Object.values(resolvedSystems).map(({ name }) => name);\n const duplicateNames = getDuplicates([...tableNames, ...configuredSystemNames]);\n if (duplicateNames.length > 0) {\n throw new MUDError(`Table and system names must be unique: ${duplicateNames.join(\", \")}`);\n }\n\n return { systems: resolvedSystems };\n}\n\n/**\n * Resolves the system config by combining the default and overridden system configs,\n * @param systemName name of the system\n * @param config optional SystemConfig object, if none is provided the default config is used\n * @param existingContracts optional list of existing contract names, used to validate system names in the access list. If not provided, no validation is performed.\n * @returns ResolvedSystemConfig object\n * Default value for name is `systemName`\n * Default value for registerFunctionSelectors is true\n * Default value for openAccess is true\n * Default value for accessListAddresses is []\n * Default value for accessListSystems is []\n */\nexport function resolveSystemConfig(systemName: string, config?: SystemConfig, existingContracts?: string[]) {\n const name = config?.name ?? systemName.slice(0, STORE_SELECTOR_MAX_LENGTH);\n const registerFunctionSelectors = config?.registerFunctionSelectors ?? true;\n const openAccess = config?.openAccess ?? true;\n const accessListAddresses: string[] = [];\n const accessListSystems: string[] = [];\n const accessList = config && !config.openAccess ? config.accessList : [];\n\n // Split the access list into addresses and system names\n for (const accessListItem of accessList) {\n if (accessListItem.startsWith(\"0x\")) {\n accessListAddresses.push(accessListItem);\n } else {\n // Validate every system refers to an existing system contract\n if (existingContracts && !existingContracts.includes(accessListItem)) {\n throw UnrecognizedSystemErrorFactory([\"overrideSystems\", systemName, \"accessList\"], accessListItem);\n }\n accessListSystems.push(accessListItem);\n }\n }\n\n return { name, registerFunctionSelectors, openAccess, accessListAddresses, accessListSystems };\n}\n","import { z } from \"zod\";\nimport { DynamicResolutionType, zEthereumAddress, zObjectName, zSelector } from \"@latticexyz/config\";\nimport { SYSTEM_DEFAULTS, WORLD_DEFAULTS } from \"./defaults\";\n\nconst zSystemName = zObjectName;\nconst zModuleName = zObjectName;\nconst zSystemAccessList = z.array(zSystemName.or(zEthereumAddress)).default(SYSTEM_DEFAULTS.accessList);\n\n// The system config is a combination of a name config and access config\nconst zSystemConfig = z.intersection(\n z.object({\n name: zSelector,\n registerFunctionSelectors: z.boolean().default(SYSTEM_DEFAULTS.registerFunctionSelector),\n }),\n z.discriminatedUnion(\"openAccess\", [\n z.object({\n openAccess: z.literal(true).default(SYSTEM_DEFAULTS.openAccess),\n }),\n z.object({\n openAccess: z.literal(false),\n accessList: zSystemAccessList,\n }),\n ])\n);\n\nconst zValueWithType = z.object({\n value: z.union([z.string(), z.number(), z.instanceof(Uint8Array)]),\n type: z.string(),\n});\nconst zDynamicResolution = z.object({ type: z.nativeEnum(DynamicResolutionType), input: z.string() });\n\nconst zModuleConfig = z.object({\n name: zModuleName,\n root: z.boolean().default(false),\n args: z.array(z.union([zValueWithType, zDynamicResolution])).default([]),\n});\n\n// The parsed world config is the result of parsing the user config\nexport const zWorldConfig = z.object({\n worldContractName: z.string().optional(),\n worldInterfaceName: z.string().default(WORLD_DEFAULTS.worldInterfaceName),\n overrideSystems: z.record(zSystemName, zSystemConfig).default(WORLD_DEFAULTS.overrideSystems),\n excludeSystems: z.array(zSystemName).default(WORLD_DEFAULTS.excludeSystems),\n postDeployScript: z.string().default(WORLD_DEFAULTS.postDeployScript),\n deploysDirectory: z.string().default(WORLD_DEFAULTS.deploysDirectory),\n worldgenDirectory: z.string().default(WORLD_DEFAULTS.worldgenDirectory),\n worldImportPath: z.string().default(WORLD_DEFAULTS.worldImportPath),\n modules: z.array(zModuleConfig).default(WORLD_DEFAULTS.modules),\n});\n\n// Catchall preserves other plugins' options\nexport const zPluginWorldConfig = zWorldConfig.catchall(z.any());\n","import { renderArguments, renderList, renderedSolidityHeader, renderImports } from \"@latticexyz/common/codegen\";\nimport { RenderSystemInterfaceOptions } from \"./types\";\n\nexport function renderSystemInterface(options: RenderSystemInterfaceOptions) {\n const { imports, name, functionPrefix, functions, errors } = options;\n\n return `${renderedSolidityHeader}\n\n${renderImports(imports)}\n\ninterface ${name} {\n ${renderList(errors, ({ name, parameters }) => `error ${name}(${renderArguments(parameters)});`)}\n\n ${renderList(\n functions,\n ({ name, parameters, stateMutability, returnParameters }) => `\n function ${functionPrefix}${name}(\n ${renderArguments(parameters)}\n ) external ${stateMutability} ${renderReturnParameters(returnParameters)};\n `\n )}\n}\n\n`;\n}\n\nfunction renderReturnParameters(returnParameters: string[]) {\n if (returnParameters.length > 0) {\n return `returns (${renderArguments(returnParameters)})`;\n } else {\n return \"\";\n }\n}\n","import {\n renderArguments,\n renderedSolidityHeader,\n renderAbsoluteImports,\n renderRelativeImports,\n type AbsoluteImportDatum,\n} from \"@latticexyz/common/codegen\";\nimport type { RenderWorldOptions } from \"./types\";\n\nexport function renderWorld(options: RenderWorldOptions) {\n const { interfaceName, storeImportPath, worldImportPath, imports } = options;\n const baseImports: AbsoluteImportDatum[] =\n interfaceName === \"IBaseWorld\"\n ? [\n { symbol: \"IStore\", path: `${storeImportPath}IStore.sol` },\n { symbol: \"IWorldKernel\", path: `${worldImportPath}interfaces/IWorldKernel.sol` },\n ]\n : [\n {\n symbol: \"IBaseWorld\",\n path: `${worldImportPath}interfaces/IBaseWorld.sol`,\n },\n ];\n const importSymbols = [...baseImports, ...imports].map(({ symbol }) => symbol);\n\n return `${renderedSolidityHeader}\n\n${renderAbsoluteImports(baseImports)}\n\n${renderRelativeImports(imports)}\n\n/**\n * The ${interfaceName} interface includes all systems dynamically added to the World\n * during the deploy process.\n */\ninterface ${interfaceName} is ${renderArguments(importSymbols)} {\n\n}\n\n`;\n}\n","import { readFileSync } from \"fs\";\nimport path from \"path\";\nimport { formatAndWriteSolidity, contractToInterface, type RelativeImportDatum } from \"@latticexyz/common/codegen\";\nimport { StoreConfig } from \"@latticexyz/store\";\nimport { renderSystemInterface } from \"./renderSystemInterface\";\nimport { renderWorld } from \"./renderWorld\";\nimport { resolveWorldConfig, WorldConfig } from \"../config\";\n\nexport async function worldgen(\n config: StoreConfig & WorldConfig,\n existingContracts: { path: string; basename: string }[],\n outputBaseDirectory: string\n) {\n const resolvedConfig = resolveWorldConfig(\n config,\n existingContracts.map(({ basename }) => basename)\n );\n\n const worldgenBaseDirectory = path.join(outputBaseDirectory, config.worldgenDirectory);\n const systems = existingContracts.filter(({ basename }) => Object.keys(resolvedConfig.systems).includes(basename));\n\n const systemInterfaceImports: RelativeImportDatum[] = [];\n for (const system of systems) {\n const data = readFileSync(system.path, \"utf8\");\n // get external funcions from a contract\n const { functions, errors, symbolImports } = contractToInterface(data, system.basename);\n const imports = symbolImports.map((symbolImport) => {\n if (symbolImport.path[0] === \".\") {\n // relative import\n return {\n symbol: symbolImport.symbol,\n fromPath: path.join(path.dirname(system.path), symbolImport.path),\n usedInPath: worldgenBaseDirectory,\n };\n } else {\n // absolute import\n return {\n symbol: symbolImport.symbol,\n path: symbolImport.path,\n };\n }\n });\n const systemInterfaceName = `I${system.basename}`;\n // create an interface using the external functions and imports\n const { name } = resolvedConfig.systems[system.basename];\n const output = renderSystemInterface({\n name: systemInterfaceName,\n functionPrefix: config.namespace === \"\" ? \"\" : `${config.namespace}_${name}_`,\n functions,\n errors,\n imports,\n });\n // write to file\n const fullOutputPath = path.join(worldgenBaseDirectory, systemInterfaceName + \".sol\");\n await formatAndWriteSolidity(output, fullOutputPath, \"Generated system interface\");\n\n // prepare imports for IWorld\n systemInterfaceImports.push({\n symbol: systemInterfaceName,\n fromPath: `${systemInterfaceName}.sol`,\n usedInPath: \"./\",\n });\n }\n\n // render IWorld\n const output = renderWorld({\n interfaceName: config.worldInterfaceName,\n imports: systemInterfaceImports,\n storeImportPath: config.storeImportPath,\n worldImportPath: config.worldImportPath,\n });\n // write to file\n const fullOutputPath = path.join(worldgenBaseDirectory, config.worldInterfaceName + \".sol\");\n await formatAndWriteSolidity(output, fullOutputPath, \"Generated system interface\");\n}\n"],"mappings":"AAAO,IAAMA,EAAkB,CAC7B,yBAA0B,GAC1B,WAAY,GACZ,WAAY,CAAC,CACf,EAEaC,EAAiB,CAC5B,kBAAmB,OACnB,mBAAoB,SACpB,gBAAiB,CAAC,EAClB,eAAgB,CAAC,EACjB,iBAAkB,aAClB,iBAAkB,YAClB,kBAAmB,QACnB,gBAAiB,yBACjB,QAAS,CAAC,CACZ,EChBA,OAAS,iBAAAC,EAAe,YAAAC,EAAU,6BAAAC,EAA2B,kCAAAC,MAAsC,qBAa5F,SAASC,EAAmBC,EAAmCC,EAA8B,CAElG,IAAMC,EACJD,GAAmB,OAAQE,GAASA,EAAK,SAAS,QAAQ,GAAKA,IAAS,UAAY,CAACA,EAAK,MAAM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C,EAAQ,cAAAC,CAAc,EAAIC,GAAoBL,EAAMD,EAAO,QAAQ,EAChFO,EAAUF,EAAc,IAAKG,GAC7BA,EAAa,KAAK,CAAC,IAAM,IAEpB,CACL,OAAQA,EAAa,OACrB,SAAUX,EAAK,KAAKA,EAAK,QAAQG,EAAO,IAAI,EAAGQ,EAAa,IAAI,EAChE,WAAYZ,CACd,EAGO,CACL,OAAQY,EAAa,OACrB,KAAMA,EAAa,IACrB,CAEH,EACKC,EAAsB,IAAIT,EAAO,WAEjC,CAAE,KAAAU,CAAK,EAAIjB,EAAe,QAAQO,EAAO,QAAQ,EACjDW,EAASC,EAAsB,CACnC,KAAMH,EACN,eAAgBnB,EAAO,YAAc,GAAK,GAAK,GAAGA,EAAO,aAAaoB,KACtE,UAAAP,EACA,OAAAC,EACA,QAAAG,CACF,CAAC,EAEKM,EAAiBhB,EAAK,KAAKD,EAAuBa,EAAsB,MAAM,EACpF,MAAMK,EAAuBH,EAAQE,EAAgB,4BAA4B,EAGjFd,EAAuB,KAAK,CAC1B,OAAQU,EACR,SAAU,GAAGA,QACb,WAAY,IACd,CAAC,EAIH,IAAME,EAASI,EAAY,CACzB,cAAezB,EAAO,mBACtB,QAASS,EACT,gBAAiBT,EAAO,gBACxB,gBAAiBA,EAAO,eAC1B,CAAC,EAEKuB,EAAiBhB,EAAK,KAAKD,EAAuBN,EAAO,mBAAqB,MAAM,EAC1F,MAAMwB,EAAuBH,EAAQE,EAAgB,4BAA4B,CACnF","names":["SYSTEM_DEFAULTS","WORLD_DEFAULTS","getDuplicates","MUDError","STORE_SELECTOR_MAX_LENGTH","UnrecognizedSystemErrorFactory","resolveWorldConfig","config","existingContracts","defaultSystemNames","name","overriddenSystemNames","systemName","resolvedSystems","acc","resolveSystemConfig","tableNames","configuredSystemNames","duplicateNames","registerFunctionSelectors","openAccess","accessListAddresses","accessListSystems","accessList","accessListItem","z","DynamicResolutionType","zEthereumAddress","zObjectName","zSelector","zSystemName","zObjectName","zModuleName","zSystemAccessList","z","zEthereumAddress","SYSTEM_DEFAULTS","zSystemConfig","zSelector","zValueWithType","zDynamicResolution","DynamicResolutionType","zModuleConfig","zWorldConfig","WORLD_DEFAULTS","zPluginWorldConfig","renderArguments","renderList","renderedSolidityHeader","renderImports","renderSystemInterface","options","imports","name","functionPrefix","functions","errors","parameters","stateMutability","returnParameters","renderReturnParameters","renderArguments","renderedSolidityHeader","renderAbsoluteImports","renderRelativeImports","renderWorld","options","interfaceName","storeImportPath","worldImportPath","imports","baseImports","importSymbols","symbol","readFileSync","path","formatAndWriteSolidity","contractToInterface","worldgen","config","existingContracts","outputBaseDirectory","resolvedConfig","resolveWorldConfig","basename","worldgenBaseDirectory","path","systems","systemInterfaceImports","system","data","readFileSync","functions","errors","symbolImports","contractToInterface","imports","symbolImport","systemInterfaceName","name","output","renderSystemInterface","fullOutputPath","formatAndWriteSolidity","renderWorld"]}
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-OSMORYKU.js";import"./chunk-QFDRX7VZ.js";var r=e({worldImportPath:"../",worldgenDirectory:"interfaces",worldInterfaceName:"IBaseWorld",codegenDirectory:"",tables:{NamespaceOwner:{primaryKeys:{namespace:"bytes16"},schema:{owner:"address"}},ResourceAccess:{primaryKeys:{resourceSelector:"bytes32",caller:"address"},schema:{access:"bool"}},InstalledModules:{primaryKeys:{moduleName:"bytes16",argumentsHash:"bytes32"},schema:{moduleAddress:"address"},dataStruct:!0},Systems:{directory:"modules/core/tables",primaryKeys:{resourceSelector:"bytes32"},schema:{system:"address",publicAccess:"bool"},dataStruct:!1},SystemRegistry:{directory:"modules/core/tables",primaryKeys:{system:"address"},schema:{resourceSelector:"bytes32"}},ResourceType:{directory:"modules/core/tables",primaryKeys:{resourceSelector:"bytes32"},schema:{resourceType:"Resource"}},FunctionSelectors:{directory:"modules/core/tables",primaryKeys:{functionSelector:"bytes4"},schema:{namespace:"bytes16",name:"bytes16",systemFunctionSelector:"bytes4"},dataStruct:!1},KeysWithValue:{directory:"modules/keyswithvalue/tables",primaryKeys:{valueHash:"bytes32"},schema:{keysWithValue:"bytes32[]"},tableIdArgument:!0},KeysInTable:{directory:"modules/keysintable/tables",primaryKeys:{sourceTable:"bytes32"},schema:{length:"uint32",keys:"bytes32[]"}},UsedKeysIndex:{directory:"modules/keysintable/tables",primaryKeys:{sourceTable:"bytes32",keysHash:"bytes32"},schema:{has:"bool",index:"uint32"},dataStruct:!1},UniqueEntity:{directory:"modules/uniqueentity/tables",primaryKeys:{},schema:"uint256",tableIdArgument:!0,storeArgument:!0},Bool:{directory:"../test/tables",primaryKeys:{},schema:{value:"bool"},tableIdArgument:!0},AddressArray:{directory:"../test/tables",schema:"address[]",tableIdArgument:!0}},enums:{Resource:["NONE","NAMESPACE","TABLE","SYSTEM"]},excludeSystems:["UniqueEntitySystem","StoreRegistrationSystem"]});export{r as default};
1
+ import{a as e}from"./chunk-KXMVYZUU.js";import"./chunk-XSZNAEUO.js";var r=e({worldImportPath:"../",worldgenDirectory:"interfaces",worldInterfaceName:"IBaseWorld",codegenDirectory:"",tables:{NamespaceOwner:{primaryKeys:{namespace:"bytes16"},schema:{owner:"address"}},ResourceAccess:{primaryKeys:{resourceSelector:"bytes32",caller:"address"},schema:{access:"bool"}},InstalledModules:{primaryKeys:{moduleName:"bytes16",argumentsHash:"bytes32"},schema:{moduleAddress:"address"},dataStruct:!0},Systems:{directory:"modules/core/tables",primaryKeys:{resourceSelector:"bytes32"},schema:{system:"address",publicAccess:"bool"},dataStruct:!1},SystemRegistry:{directory:"modules/core/tables",primaryKeys:{system:"address"},schema:{resourceSelector:"bytes32"}},ResourceType:{directory:"modules/core/tables",primaryKeys:{resourceSelector:"bytes32"},schema:{resourceType:"Resource"}},FunctionSelectors:{directory:"modules/core/tables",primaryKeys:{functionSelector:"bytes4"},schema:{namespace:"bytes16",name:"bytes16",systemFunctionSelector:"bytes4"},dataStruct:!1},KeysWithValue:{directory:"modules/keyswithvalue/tables",primaryKeys:{valueHash:"bytes32"},schema:{keysWithValue:"bytes32[]"},tableIdArgument:!0},KeysInTable:{directory:"modules/keysintable/tables",primaryKeys:{sourceTable:"bytes32"},schema:{length:"uint32",keys:"bytes32[]"}},UsedKeysIndex:{directory:"modules/keysintable/tables",primaryKeys:{sourceTable:"bytes32",keysHash:"bytes32"},schema:{has:"bool",index:"uint32"},dataStruct:!1},UniqueEntity:{directory:"modules/uniqueentity/tables",primaryKeys:{},schema:"uint256",tableIdArgument:!0,storeArgument:!0},Bool:{directory:"../test/tables",primaryKeys:{},schema:{value:"bool"},tableIdArgument:!0},AddressArray:{directory:"../test/tables",schema:"address[]",tableIdArgument:!0}},enums:{Resource:["NONE","NAMESPACE","TABLE","SYSTEM"]},excludeSystems:["UniqueEntitySystem","StoreRegistrationSystem"]});export{r as default};
2
2
  //# sourceMappingURL=mud.config.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g}from"../../chunk-QFDRX7VZ.js";export{e as renderSystemInterface,f as renderWorld,b as resolveSystemConfig,a as resolveWorldConfig,g as worldgen,d as zPluginWorldConfig,c as zWorldConfig};
1
+ import{a,b,c,d,e,f,g,h,i}from"../../chunk-XSZNAEUO.js";export{a as SYSTEM_DEFAULTS,b as WORLD_DEFAULTS,g as renderSystemInterface,h as renderWorld,d as resolveSystemConfig,c as resolveWorldConfig,i as worldgen,f as zPluginWorldConfig,e as zWorldConfig};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c}from"../../chunk-OSMORYKU.js";import"../../chunk-QFDRX7VZ.js";export{a as mudConfig,b as mudCoreConfig,c as resolveTableId};
1
+ import{a,b,c}from"../../chunk-KXMVYZUU.js";import"../../chunk-XSZNAEUO.js";export{a as mudConfig,b as mudCoreConfig,c as resolveTableId};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latticexyz/world",
3
- "version": "2.0.0-alpha.1.61+31628925",
3
+ "version": "2.0.0-alpha.1.63+158de9e8",
4
4
  "description": "World framework",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,7 +13,8 @@
13
13
  ".": "./dist/ts/library/index.js",
14
14
  "./register": "./dist/ts/register/index.js",
15
15
  "./mud.config.js": "./dist/mud.config.js",
16
- "./abi/*": "./abi/*"
16
+ "./abi/*": "./abi/*",
17
+ "./types/*": "./types/*"
17
18
  },
18
19
  "typesVersions": {
19
20
  "*": {
@@ -45,10 +46,10 @@
45
46
  "dependencies": {
46
47
  "@ethersproject/abi": "^5.7.0",
47
48
  "@ethersproject/providers": "^5.7.2",
48
- "@latticexyz/common": "2.0.0-alpha.1.61+31628925",
49
- "@latticexyz/config": "2.0.0-alpha.1.61+31628925",
50
- "@latticexyz/schema-type": "2.0.0-alpha.1.61+31628925",
51
- "@latticexyz/store": "2.0.0-alpha.1.61+31628925",
49
+ "@latticexyz/common": "2.0.0-alpha.1.63+158de9e8",
50
+ "@latticexyz/config": "2.0.0-alpha.1.63+158de9e8",
51
+ "@latticexyz/schema-type": "2.0.0-alpha.1.63+158de9e8",
52
+ "@latticexyz/store": "2.0.0-alpha.1.63+158de9e8",
52
53
  "ethers": "^5.7.2",
53
54
  "zod": "^3.21.4"
54
55
  },
@@ -73,5 +74,5 @@
73
74
  "typescript": "^4.9.5",
74
75
  "vitest": "0.30.1"
75
76
  },
76
- "gitHead": "31628925fdfb188d8f3a922542e4ad60f0937a5c"
77
+ "gitHead": "158de9e83ff4212e34c79b166d8336377972922f"
77
78
  }
@@ -3,7 +3,7 @@ pragma solidity >=0.8.0;
3
3
 
4
4
  /* Autogenerated file. Do not edit manually. */
5
5
 
6
- import { Schema, IStoreHook } from "./../modules/core/implementations/StoreRegistrationSystem.sol";
6
+ import { Schema, IStoreHook } from "../modules/core/implementations/StoreRegistrationSystem.sol";
7
7
 
8
8
  interface IStoreRegistrationSystem {
9
9
  function registerSchema(bytes32 tableId, Schema valueSchema, Schema keySchema) external;
@@ -0,0 +1,17 @@
1
+ export const SYSTEM_DEFAULTS = {
2
+ registerFunctionSelector: true,
3
+ openAccess: true,
4
+ accessList: [] as string[],
5
+ } as const;
6
+
7
+ export const WORLD_DEFAULTS = {
8
+ worldContractName: undefined,
9
+ worldInterfaceName: "IWorld",
10
+ overrideSystems: {} as Record<string, never>,
11
+ excludeSystems: [] as string[],
12
+ postDeployScript: "PostDeploy",
13
+ deploysDirectory: "./deploys",
14
+ worldgenDirectory: "world",
15
+ worldImportPath: "@latticexyz/world/src/",
16
+ modules: [] as [],
17
+ } as const;
@@ -1,3 +1,4 @@
1
+ export * from "./defaults";
1
2
  export * from "./resolveWorldConfig";
2
3
  export * from "./types";
3
4
  export * from "./worldConfig";
@@ -1,6 +1,8 @@
1
1
  import { z } from "zod";
2
2
  import { DynamicResolution, ValueWithType } from "@latticexyz/config";
3
+ import { OrDefaults } from "@latticexyz/common/type-utils";
3
4
  import { zWorldConfig } from "./worldConfig";
5
+ import { SYSTEM_DEFAULTS } from "./defaults";
4
6
 
5
7
  // zod doesn't preserve doc comments
6
8
  export type SystemUserConfig =
@@ -18,7 +20,7 @@ export type SystemUserConfig =
18
20
  } & (
19
21
  | {
20
22
  /** If openAccess is true, any address can call the system */
21
- openAccess: true;
23
+ openAccess?: true;
22
24
  }
23
25
  | {
24
26
  /** If openAccess is false, only the addresses or systems in `access` can call the system */
@@ -28,6 +30,24 @@ export type SystemUserConfig =
28
30
  }
29
31
  );
30
32
 
33
+ export interface ExpandSystemConfig<T extends SystemUserConfig, SystemName extends string>
34
+ extends OrDefaults<
35
+ T,
36
+ {
37
+ name: SystemName;
38
+ registerFunctionSelectors: typeof SYSTEM_DEFAULTS.registerFunctionSelector;
39
+ openAccess: typeof SYSTEM_DEFAULTS.openAccess;
40
+ }
41
+ > {
42
+ accessList: T extends { accessList: string[] } ? T["accessList"] : typeof SYSTEM_DEFAULTS.accessList;
43
+ }
44
+
45
+ export type SystemsUserConfig = Record<string, SystemUserConfig>;
46
+
47
+ export type ExpandSystemsConfig<T extends SystemsUserConfig> = {
48
+ [SystemName in keyof T]: ExpandSystemConfig<T[SystemName], SystemName extends string ? SystemName : never>;
49
+ };
50
+
31
51
  export type ModuleConfig = {
32
52
  /** The name of the module */
33
53
  name: string;
@@ -39,8 +59,6 @@ export type ModuleConfig = {
39
59
 
40
60
  // zod doesn't preserve doc comments
41
61
  export interface WorldUserConfig {
42
- /** The namespace to register tables and systems at. Defaults to the root namespace (empty string) */
43
- namespace?: string;
44
62
  /** The name of the World contract to deploy. If no name is provided, a vanilla World is deployed */
45
63
  worldContractName?: string;
46
64
  /** The name of the World interface to generate. (Default `IWorld`) */
@@ -52,7 +70,7 @@ export interface WorldUserConfig {
52
70
  * The key is the system name (capitalized).
53
71
  * The value is a SystemConfig object.
54
72
  */
55
- overrideSystems?: Record<string, SystemUserConfig>;
73
+ overrideSystems?: SystemsUserConfig;
56
74
  /** Systems to exclude from automatic deployment */
57
75
  excludeSystems?: string[];
58
76
  /**
@@ -1,19 +1,20 @@
1
1
  import { z } from "zod";
2
2
  import { DynamicResolutionType, zEthereumAddress, zObjectName, zSelector } from "@latticexyz/config";
3
+ import { SYSTEM_DEFAULTS, WORLD_DEFAULTS } from "./defaults";
3
4
 
4
5
  const zSystemName = zObjectName;
5
6
  const zModuleName = zObjectName;
6
- const zSystemAccessList = z.array(zSystemName.or(zEthereumAddress)).default([]);
7
+ const zSystemAccessList = z.array(zSystemName.or(zEthereumAddress)).default(SYSTEM_DEFAULTS.accessList);
7
8
 
8
9
  // The system config is a combination of a name config and access config
9
10
  const zSystemConfig = z.intersection(
10
11
  z.object({
11
12
  name: zSelector,
12
- registerFunctionSelectors: z.boolean().default(true),
13
+ registerFunctionSelectors: z.boolean().default(SYSTEM_DEFAULTS.registerFunctionSelector),
13
14
  }),
14
15
  z.discriminatedUnion("openAccess", [
15
16
  z.object({
16
- openAccess: z.literal(true),
17
+ openAccess: z.literal(true).default(SYSTEM_DEFAULTS.openAccess),
17
18
  }),
18
19
  z.object({
19
20
  openAccess: z.literal(false),
@@ -36,16 +37,15 @@ const zModuleConfig = z.object({
36
37
 
37
38
  // The parsed world config is the result of parsing the user config
38
39
  export const zWorldConfig = z.object({
39
- namespace: zSelector.default(""),
40
40
  worldContractName: z.string().optional(),
41
- worldInterfaceName: z.string().default("IWorld"),
42
- overrideSystems: z.record(zSystemName, zSystemConfig).default({}),
43
- excludeSystems: z.array(zSystemName).default([]),
44
- postDeployScript: z.string().default("PostDeploy"),
45
- deploysDirectory: z.string().default("./deploys"),
46
- worldgenDirectory: z.string().default("world"),
47
- worldImportPath: z.string().default("@latticexyz/world/src/"),
48
- modules: z.array(zModuleConfig).default([]),
41
+ worldInterfaceName: z.string().default(WORLD_DEFAULTS.worldInterfaceName),
42
+ overrideSystems: z.record(zSystemName, zSystemConfig).default(WORLD_DEFAULTS.overrideSystems),
43
+ excludeSystems: z.array(zSystemName).default(WORLD_DEFAULTS.excludeSystems),
44
+ postDeployScript: z.string().default(WORLD_DEFAULTS.postDeployScript),
45
+ deploysDirectory: z.string().default(WORLD_DEFAULTS.deploysDirectory),
46
+ worldgenDirectory: z.string().default(WORLD_DEFAULTS.worldgenDirectory),
47
+ worldImportPath: z.string().default(WORLD_DEFAULTS.worldImportPath),
48
+ modules: z.array(zModuleConfig).default(WORLD_DEFAULTS.modules),
49
49
  });
50
50
 
51
51
  // Catchall preserves other plugins' options
@@ -1,4 +1,8 @@
1
- import { WorldConfig, WorldUserConfig } from "../library";
1
+ import { OrDefaults } from "@latticexyz/common/type-utils";
2
+ import { MUDCoreUserConfig } from "@latticexyz/config";
3
+ import { ExpandSystemsConfig, WorldConfig, WorldUserConfig, WORLD_DEFAULTS } from "../library";
4
+
5
+ import "@latticexyz/store/register";
2
6
 
3
7
  // Inject the plugin options into the core config.
4
8
  // Re-exporting an interface of an existing module merges them, adding new options to the interface.
@@ -15,3 +19,24 @@ declare module "@latticexyz/config" {
15
19
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
16
20
  export interface MUDCoreConfig extends WorldConfig {}
17
21
  }
22
+
23
+ declare module "@latticexyz/store/register" {
24
+ export interface ExpandMUDUserConfig<T extends MUDCoreUserConfig>
25
+ extends OrDefaults<
26
+ T,
27
+ {
28
+ worldContractName: typeof WORLD_DEFAULTS.worldContractName;
29
+ worldInterfaceName: typeof WORLD_DEFAULTS.worldInterfaceName;
30
+ excludeSystems: typeof WORLD_DEFAULTS.excludeSystems;
31
+ postDeployScript: typeof WORLD_DEFAULTS.postDeployScript;
32
+ deploysDirectory: typeof WORLD_DEFAULTS.deploysDirectory;
33
+ worldgenDirectory: typeof WORLD_DEFAULTS.worldgenDirectory;
34
+ worldImportPath: typeof WORLD_DEFAULTS.worldImportPath;
35
+ modules: typeof WORLD_DEFAULTS.modules;
36
+ }
37
+ > {
38
+ overrideSystems: ExpandSystemsConfig<
39
+ T["overrideSystems"] extends Record<string, unknown> ? T["overrideSystems"] : Record<string, never>
40
+ >;
41
+ }
42
+ }
@@ -1,2 +0,0 @@
1
- import{d as o}from"./chunk-QFDRX7VZ.js";import"@latticexyz/store/register";import{mudConfig as g,mudCoreConfig as s,resolveTableId as u}from"@latticexyz/store/register";import{extendMUDCoreConfig as t,fromZodErrorCustom as e}from"@latticexyz/config";import{ZodError as m}from"zod";t(i=>{try{return o.parse(i)}catch(r){throw r instanceof m?e(r,"WorldConfig Validation Error"):r}});export{g as a,s as b,u as c};
2
- //# sourceMappingURL=chunk-OSMORYKU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../ts/register/index.ts","../ts/register/configExtensions.ts"],"sourcesContent":["// Importing this file has side-effects for MUD config,\n// and the order of imports is important in relation to other plugins\n// (store should usually be the first plugin, followed by world)\n\n// For convenience register and reexport store (which does the same for core config),\n// to reduce the number of needed imports for users\nimport \"@latticexyz/store/register\";\nexport { mudConfig, mudCoreConfig, resolveTableId } from \"@latticexyz/store/register\";\n// Extend core config and types\nimport \"./configExtensions\";\nimport \"./typeExtensions\";\n","import { extendMUDCoreConfig, fromZodErrorCustom } from \"@latticexyz/config\";\nimport { ZodError } from \"zod\";\nimport { zPluginWorldConfig } from \"../library\";\n\nextendMUDCoreConfig((config) => {\n // This function gets called within mudConfig.\n // The call order of config extenders depends on the order of their imports.\n // Any config validation and transformation should be placed here.\n try {\n return zPluginWorldConfig.parse(config);\n } catch (error) {\n if (error instanceof ZodError) {\n throw fromZodErrorCustom(error, \"WorldConfig Validation Error\");\n } else {\n throw error;\n }\n }\n});\n"],"mappings":"wCAMA,MAAO,6BACP,OAAS,aAAAA,EAAW,iBAAAC,EAAe,kBAAAC,MAAsB,6BCPzD,OAAS,uBAAAC,EAAqB,sBAAAC,MAA0B,qBACxD,OAAS,YAAAC,MAAgB,MAGzBC,EAAqBC,GAAW,CAI9B,GAAI,CACF,OAAOC,EAAmB,MAAMD,CAAM,CACxC,OAASE,EAAP,CACA,MAAIA,aAAiBC,EACbC,EAAmBF,EAAO,8BAA8B,EAExDA,CAEV,CACF,CAAC","names":["mudConfig","mudCoreConfig","resolveTableId","extendMUDCoreConfig","fromZodErrorCustom","ZodError","extendMUDCoreConfig","config","zPluginWorldConfig","error","ZodError","fromZodErrorCustom"]}
@@ -1,30 +0,0 @@
1
- import{getDuplicates as z,MUDError as D,STORE_SELECTOR_MAX_LENGTH as O,UnrecognizedSystemErrorFactory as h}from"@latticexyz/config";function g(r,o){let l=o?.filter(e=>e.endsWith("System")&&e!=="System"&&!e.match(/^I[A-Z]/))??[],n=Object.keys(r.overrideSystems);if(o){for(let e of n)if(!o.includes(e)||e==="World")throw h(["overrideSystems",e],e)}let i=[...new Set([...l,...n])].filter(e=>!r.excludeSystems.includes(e)).reduce((e,d)=>({...e,[d]:L(d,r.overrideSystems[d],o)}),{}),s=Object.values(r.tables).map(({name:e})=>e),a=Object.values(i).map(({name:e})=>e),c=z([...s,...a]);if(c.length>0)throw new D(`Table and system names must be unique: ${c.join(", ")}`);return{systems:i}}function L(r,o,l){let n=o?.name??r.slice(0,O),m=o?.registerFunctionSelectors??!0,i=o?.openAccess??!0,s=[],a=[],c=o&&!o.openAccess?o.accessList:[];for(let e of c)if(e.startsWith("0x"))s.push(e);else{if(l&&!l.includes(e))throw h(["overrideSystems",r,"accessList"],e);a.push(e)}return{name:n,registerFunctionSelectors:m,openAccess:i,accessListAddresses:s,accessListSystems:a}}import{z as t}from"zod";import{DynamicResolutionType as T,zEthereumAddress as E,zObjectName as I,zSelector as b}from"@latticexyz/config";var y=I,F=I,_=t.array(y.or(E)).default([]),B=t.intersection(t.object({name:b,registerFunctionSelectors:t.boolean().default(!0)}),t.discriminatedUnion("openAccess",[t.object({openAccess:t.literal(!0)}),t.object({openAccess:t.literal(!1),accessList:_})])),M=t.object({value:t.union([t.string(),t.number(),t.instanceof(Uint8Array)]),type:t.string()}),U=t.object({type:t.nativeEnum(T),input:t.string()}),G=t.object({name:F,root:t.boolean().default(!1),args:t.array(t.union([M,U])).default([])}),H=t.object({namespace:b.default(""),worldContractName:t.string().optional(),worldInterfaceName:t.string().default("IWorld"),overrideSystems:t.record(y,B).default({}),excludeSystems:t.array(y).default([]),postDeployScript:t.string().default("PostDeploy"),deploysDirectory:t.string().default("./deploys"),worldgenDirectory:t.string().default("world"),worldImportPath:t.string().default("@latticexyz/world/src/"),modules:t.array(G).default([])}),se=H.catchall(t.any());import{renderArguments as S,renderList as $,renderedSolidityHeader as k,renderImports as K}from"@latticexyz/common/codegen";function W(r){let{imports:o,name:l,functionPrefix:n,functions:m,errors:i}=r;return`${k}
2
-
3
- ${K(o)}
4
-
5
- interface ${l} {
6
- ${$(i,({name:s,parameters:a})=>`error ${s}(${S(a)});`)}
7
-
8
- ${$(m,({name:s,parameters:a,stateMutability:c,returnParameters:e})=>`
9
- function ${n}${s}(
10
- ${S(a)}
11
- ) external ${c} ${q(e)};
12
- `)}
13
- }
14
-
15
- `}function q(r){return r.length>0?`returns (${S(r)})`:""}import{renderArguments as V,renderedSolidityHeader as X,renderAbsoluteImports as Z,renderRelativeImports as J}from"@latticexyz/common/codegen";function v(r){let{interfaceName:o,storeImportPath:l,worldImportPath:n,imports:m}=r,i=o==="IBaseWorld"?[{symbol:"IStore",path:`${l}IStore.sol`},{symbol:"IWorldKernel",path:`${n}interfaces/IWorldKernel.sol`}]:[{symbol:"IBaseWorld",path:`${n}interfaces/IBaseWorld.sol`}],s=[...i,...m].map(({symbol:a})=>a);return`${X}
16
-
17
- ${Z(i)}
18
-
19
- ${J(m)}
20
-
21
- /**
22
- * The ${o} interface includes all systems dynamically added to the World
23
- * during the deploy process.
24
- */
25
- interface ${o} is ${V(s)} {
26
-
27
- }
28
-
29
- `}import{readFileSync as Q}from"fs";import f from"path";import{formatAndWriteSolidity as w,contractToInterface as Y}from"@latticexyz/common/codegen";async function $e(r,o,l){let n=g(r,o.map(({basename:e})=>e)),m=f.join(l,r.worldgenDirectory),i=o.filter(({basename:e})=>Object.keys(n.systems).includes(e)),s=[];for(let e of i){let d=Q(e.path,"utf8"),{functions:x,errors:C,symbolImports:A}=Y(d,e.basename),R=A.map(p=>p.path[0]==="."?{symbol:p.symbol,fromPath:f.join(f.dirname(e.path),p.path),usedInPath:m}:{symbol:p.symbol,path:p.path}),u=`I${e.basename}`,{name:j}=n.systems[e.basename],P=W({name:u,functionPrefix:r.namespace===""?"":`${r.namespace}_${j}_`,functions:x,errors:C,imports:R}),N=f.join(m,u+".sol");await w(P,N,"Generated system interface"),s.push({symbol:u,fromPath:`${u}.sol`,usedInPath:"./"})}let a=v({interfaceName:r.worldInterfaceName,imports:s,storeImportPath:r.storeImportPath,worldImportPath:r.worldImportPath}),c=f.join(m,r.worldInterfaceName+".sol");await w(a,c,"Generated system interface")}export{g as a,L as b,H as c,se as d,W as e,v as f,$e as g};
30
- //# sourceMappingURL=chunk-QFDRX7VZ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../ts/library/config/resolveWorldConfig.ts","../ts/library/config/worldConfig.ts","../ts/library/render-solidity/renderSystemInterface.ts","../ts/library/render-solidity/renderWorld.ts","../ts/library/render-solidity/worldgen.ts"],"sourcesContent":["import { getDuplicates, MUDError, STORE_SELECTOR_MAX_LENGTH, UnrecognizedSystemErrorFactory } from \"@latticexyz/config\";\nimport { StoreConfig } from \"@latticexyz/store\";\nimport { SystemConfig, WorldConfig } from \"./types\";\n\nexport type ResolvedSystemConfig = ReturnType<typeof resolveSystemConfig>;\n\nexport type ResolvedWorldConfig = ReturnType<typeof resolveWorldConfig>;\n\n/**\n * Resolves the world config by combining the default and overridden system configs,\n * filtering out excluded systems, validate system names refer to existing contracts, and\n * splitting the access list into addresses and system names.\n */\nexport function resolveWorldConfig(config: StoreConfig & WorldConfig, existingContracts?: string[]) {\n // Include contract names ending in \"System\", but not the base \"System\" contract, and not Interfaces\n const defaultSystemNames =\n existingContracts?.filter((name) => name.endsWith(\"System\") && name !== \"System\" && !name.match(/^I[A-Z]/)) ?? [];\n const overriddenSystemNames = Object.keys(config.overrideSystems);\n\n // Validate every key in overrideSystems refers to an existing system contract (and is not called \"World\")\n if (existingContracts) {\n for (const systemName of overriddenSystemNames) {\n if (!existingContracts.includes(systemName) || systemName === \"World\") {\n throw UnrecognizedSystemErrorFactory([\"overrideSystems\", systemName], systemName);\n }\n }\n }\n\n // Combine the default and overridden system names and filter out excluded systems\n const systemNames = [...new Set([...defaultSystemNames, ...overriddenSystemNames])].filter(\n (name) => !config.excludeSystems.includes(name)\n );\n\n // Resolve the config\n const resolvedSystems: Record<string, ResolvedSystemConfig> = systemNames.reduce((acc, systemName) => {\n return {\n ...acc,\n [systemName]: resolveSystemConfig(systemName, config.overrideSystems[systemName], existingContracts),\n };\n }, {});\n\n // Table and system names must be unique (because they're both used for world selectors)\n const tableNames = Object.values(config.tables).map(({ name }) => name);\n const configuredSystemNames = Object.values(resolvedSystems).map(({ name }) => name);\n const duplicateNames = getDuplicates([...tableNames, ...configuredSystemNames]);\n if (duplicateNames.length > 0) {\n throw new MUDError(`Table and system names must be unique: ${duplicateNames.join(\", \")}`);\n }\n\n return { systems: resolvedSystems };\n}\n\n/**\n * Resolves the system config by combining the default and overridden system configs,\n * @param systemName name of the system\n * @param config optional SystemConfig object, if none is provided the default config is used\n * @param existingContracts optional list of existing contract names, used to validate system names in the access list. If not provided, no validation is performed.\n * @returns ResolvedSystemConfig object\n * Default value for name is `systemName`\n * Default value for registerFunctionSelectors is true\n * Default value for openAccess is true\n * Default value for accessListAddresses is []\n * Default value for accessListSystems is []\n */\nexport function resolveSystemConfig(systemName: string, config?: SystemConfig, existingContracts?: string[]) {\n const name = config?.name ?? systemName.slice(0, STORE_SELECTOR_MAX_LENGTH);\n const registerFunctionSelectors = config?.registerFunctionSelectors ?? true;\n const openAccess = config?.openAccess ?? true;\n const accessListAddresses: string[] = [];\n const accessListSystems: string[] = [];\n const accessList = config && !config.openAccess ? config.accessList : [];\n\n // Split the access list into addresses and system names\n for (const accessListItem of accessList) {\n if (accessListItem.startsWith(\"0x\")) {\n accessListAddresses.push(accessListItem);\n } else {\n // Validate every system refers to an existing system contract\n if (existingContracts && !existingContracts.includes(accessListItem)) {\n throw UnrecognizedSystemErrorFactory([\"overrideSystems\", systemName, \"accessList\"], accessListItem);\n }\n accessListSystems.push(accessListItem);\n }\n }\n\n return { name, registerFunctionSelectors, openAccess, accessListAddresses, accessListSystems };\n}\n","import { z } from \"zod\";\nimport { DynamicResolutionType, zEthereumAddress, zObjectName, zSelector } from \"@latticexyz/config\";\n\nconst zSystemName = zObjectName;\nconst zModuleName = zObjectName;\nconst zSystemAccessList = z.array(zSystemName.or(zEthereumAddress)).default([]);\n\n// The system config is a combination of a name config and access config\nconst zSystemConfig = z.intersection(\n z.object({\n name: zSelector,\n registerFunctionSelectors: z.boolean().default(true),\n }),\n z.discriminatedUnion(\"openAccess\", [\n z.object({\n openAccess: z.literal(true),\n }),\n z.object({\n openAccess: z.literal(false),\n accessList: zSystemAccessList,\n }),\n ])\n);\n\nconst zValueWithType = z.object({\n value: z.union([z.string(), z.number(), z.instanceof(Uint8Array)]),\n type: z.string(),\n});\nconst zDynamicResolution = z.object({ type: z.nativeEnum(DynamicResolutionType), input: z.string() });\n\nconst zModuleConfig = z.object({\n name: zModuleName,\n root: z.boolean().default(false),\n args: z.array(z.union([zValueWithType, zDynamicResolution])).default([]),\n});\n\n// The parsed world config is the result of parsing the user config\nexport const zWorldConfig = z.object({\n namespace: zSelector.default(\"\"),\n worldContractName: z.string().optional(),\n worldInterfaceName: z.string().default(\"IWorld\"),\n overrideSystems: z.record(zSystemName, zSystemConfig).default({}),\n excludeSystems: z.array(zSystemName).default([]),\n postDeployScript: z.string().default(\"PostDeploy\"),\n deploysDirectory: z.string().default(\"./deploys\"),\n worldgenDirectory: z.string().default(\"world\"),\n worldImportPath: z.string().default(\"@latticexyz/world/src/\"),\n modules: z.array(zModuleConfig).default([]),\n});\n\n// Catchall preserves other plugins' options\nexport const zPluginWorldConfig = zWorldConfig.catchall(z.any());\n","import { renderArguments, renderList, renderedSolidityHeader, renderImports } from \"@latticexyz/common/codegen\";\nimport { RenderSystemInterfaceOptions } from \"./types\";\n\nexport function renderSystemInterface(options: RenderSystemInterfaceOptions) {\n const { imports, name, functionPrefix, functions, errors } = options;\n\n return `${renderedSolidityHeader}\n\n${renderImports(imports)}\n\ninterface ${name} {\n ${renderList(errors, ({ name, parameters }) => `error ${name}(${renderArguments(parameters)});`)}\n\n ${renderList(\n functions,\n ({ name, parameters, stateMutability, returnParameters }) => `\n function ${functionPrefix}${name}(\n ${renderArguments(parameters)}\n ) external ${stateMutability} ${renderReturnParameters(returnParameters)};\n `\n )}\n}\n\n`;\n}\n\nfunction renderReturnParameters(returnParameters: string[]) {\n if (returnParameters.length > 0) {\n return `returns (${renderArguments(returnParameters)})`;\n } else {\n return \"\";\n }\n}\n","import {\n renderArguments,\n renderedSolidityHeader,\n renderAbsoluteImports,\n renderRelativeImports,\n type AbsoluteImportDatum,\n} from \"@latticexyz/common/codegen\";\nimport type { RenderWorldOptions } from \"./types\";\n\nexport function renderWorld(options: RenderWorldOptions) {\n const { interfaceName, storeImportPath, worldImportPath, imports } = options;\n const baseImports: AbsoluteImportDatum[] =\n interfaceName === \"IBaseWorld\"\n ? [\n { symbol: \"IStore\", path: `${storeImportPath}IStore.sol` },\n { symbol: \"IWorldKernel\", path: `${worldImportPath}interfaces/IWorldKernel.sol` },\n ]\n : [\n {\n symbol: \"IBaseWorld\",\n path: `${worldImportPath}interfaces/IBaseWorld.sol`,\n },\n ];\n const importSymbols = [...baseImports, ...imports].map(({ symbol }) => symbol);\n\n return `${renderedSolidityHeader}\n\n${renderAbsoluteImports(baseImports)}\n\n${renderRelativeImports(imports)}\n\n/**\n * The ${interfaceName} interface includes all systems dynamically added to the World\n * during the deploy process.\n */\ninterface ${interfaceName} is ${renderArguments(importSymbols)} {\n\n}\n\n`;\n}\n","import { readFileSync } from \"fs\";\nimport path from \"path\";\nimport { formatAndWriteSolidity, contractToInterface, type RelativeImportDatum } from \"@latticexyz/common/codegen\";\nimport { StoreConfig } from \"@latticexyz/store\";\nimport { renderSystemInterface } from \"./renderSystemInterface\";\nimport { renderWorld } from \"./renderWorld\";\nimport { resolveWorldConfig, WorldConfig } from \"../config\";\n\nexport async function worldgen(\n config: StoreConfig & WorldConfig,\n existingContracts: { path: string; basename: string }[],\n outputBaseDirectory: string\n) {\n const resolvedConfig = resolveWorldConfig(\n config,\n existingContracts.map(({ basename }) => basename)\n );\n\n const worldgenBaseDirectory = path.join(outputBaseDirectory, config.worldgenDirectory);\n const systems = existingContracts.filter(({ basename }) => Object.keys(resolvedConfig.systems).includes(basename));\n\n const systemInterfaceImports: RelativeImportDatum[] = [];\n for (const system of systems) {\n const data = readFileSync(system.path, \"utf8\");\n // get external funcions from a contract\n const { functions, errors, symbolImports } = contractToInterface(data, system.basename);\n const imports = symbolImports.map((symbolImport) => {\n if (symbolImport.path[0] === \".\") {\n // relative import\n return {\n symbol: symbolImport.symbol,\n fromPath: path.join(path.dirname(system.path), symbolImport.path),\n usedInPath: worldgenBaseDirectory,\n };\n } else {\n // absolute import\n return {\n symbol: symbolImport.symbol,\n path: symbolImport.path,\n };\n }\n });\n const systemInterfaceName = `I${system.basename}`;\n // create an interface using the external functions and imports\n const { name } = resolvedConfig.systems[system.basename];\n const output = renderSystemInterface({\n name: systemInterfaceName,\n functionPrefix: config.namespace === \"\" ? \"\" : `${config.namespace}_${name}_`,\n functions,\n errors,\n imports,\n });\n // write to file\n const fullOutputPath = path.join(worldgenBaseDirectory, systemInterfaceName + \".sol\");\n await formatAndWriteSolidity(output, fullOutputPath, \"Generated system interface\");\n\n // prepare imports for IWorld\n systemInterfaceImports.push({\n symbol: systemInterfaceName,\n fromPath: `${systemInterfaceName}.sol`,\n usedInPath: \"./\",\n });\n }\n\n // render IWorld\n const output = renderWorld({\n interfaceName: config.worldInterfaceName,\n imports: systemInterfaceImports,\n storeImportPath: config.storeImportPath,\n worldImportPath: config.worldImportPath,\n });\n // write to file\n const fullOutputPath = path.join(worldgenBaseDirectory, config.worldInterfaceName + \".sol\");\n await formatAndWriteSolidity(output, fullOutputPath, \"Generated system interface\");\n}\n"],"mappings":"AAAA,OAAS,iBAAAA,EAAe,YAAAC,EAAU,6BAAAC,EAA2B,kCAAAC,MAAsC,qBAa5F,SAASC,EAAmBC,EAAmCC,EAA8B,CAElG,IAAMC,EACJD,GAAmB,OAAQE,GAASA,EAAK,SAAS,QAAQ,GAAKA,IAAS,UAAY,CAACA,EAAK,MAAM,SAAS,CAAC,GAAK,CAAC,EAC5GC,EAAwB,OAAO,KAAKJ,EAAO,eAAe,EAGhE,GAAIC,GACF,QAAWI,KAAcD,EACvB,GAAI,CAACH,EAAkB,SAASI,CAAU,GAAKA,IAAe,QAC5D,MAAMP,EAA+B,CAAC,kBAAmBO,CAAU,EAAGA,CAAU,EAWtF,IAAMC,EALc,CAAC,GAAG,IAAI,IAAI,CAAC,GAAGJ,EAAoB,GAAGE,CAAqB,CAAC,CAAC,EAAE,OACjFD,GAAS,CAACH,EAAO,eAAe,SAASG,CAAI,CAChD,EAG0E,OAAO,CAACI,EAAKF,KAC9E,CACL,GAAGE,EACH,CAACF,CAAU,EAAG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AAO,aAAaoB,KACtE,UAAAP,EACA,OAAAC,EACA,QAAAG,CACF,CAAC,EAEKM,EAAiBhB,EAAK,KAAKD,EAAuBa,EAAsB,MAAM,EACpF,MAAMK,EAAuBH,EAAQE,EAAgB,4BAA4B,EAGjFd,EAAuB,KAAK,CAC1B,OAAQU,EACR,SAAU,GAAGA,QACb,WAAY,IACd,CAAC,EAIH,IAAME,EAASI,EAAY,CACzB,cAAezB,EAAO,mBACtB,QAASS,EACT,gBAAiBT,EAAO,gBACxB,gBAAiBA,EAAO,eAC1B,CAAC,EAEKuB,EAAiBhB,EAAK,KAAKD,EAAuBN,EAAO,mBAAqB,MAAM,EAC1F,MAAMwB,EAAuBH,EAAQE,EAAgB,4BAA4B,CACnF","names":["getDuplicates","MUDError","STORE_SELECTOR_MAX_LENGTH","UnrecognizedSystemErrorFactory","resolveWorldConfig","config","existingContracts","defaultSystemNames","name","overriddenSystemNames","systemName","resolvedSystems","acc","resolveSystemConfig","tableNames","configuredSystemNames","duplicateNames","registerFunctionSelectors","openAccess","accessListAddresses","accessListSystems","accessList","accessListItem","z","DynamicResolutionType","zEthereumAddress","zObjectName","zSelector","zSystemName","zModuleName","zSystemAccessList","zSystemConfig","zValueWithType","zDynamicResolution","zModuleConfig","zWorldConfig","zPluginWorldConfig","renderArguments","renderList","renderedSolidityHeader","renderImports","renderSystemInterface","options","imports","name","functionPrefix","functions","errors","parameters","stateMutability","returnParameters","renderReturnParameters","renderArguments","renderedSolidityHeader","renderAbsoluteImports","renderRelativeImports","renderWorld","options","interfaceName","storeImportPath","worldImportPath","imports","baseImports","importSymbols","symbol","readFileSync","path","formatAndWriteSolidity","contractToInterface","worldgen","config","existingContracts","outputBaseDirectory","resolvedConfig","resolveWorldConfig","basename","worldgenBaseDirectory","path","systems","systemInterfaceImports","system","data","readFileSync","functions","errors","symbolImports","contractToInterface","imports","symbolImport","systemInterfaceName","name","output","renderSystemInterface","fullOutputPath","formatAndWriteSolidity","renderWorld"]}