@latticexyz/world-module-callwithsignature 2.2.17-03eae1330cef5cae129841958fb75541ef13fb43

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.
Files changed (384) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/internal.d.ts +20 -0
  4. package/dist/internal.js +2 -0
  5. package/dist/internal.js.map +1 -0
  6. package/dist/mud.config.d.ts +103 -0
  7. package/dist/mud.config.js +2 -0
  8. package/dist/mud.config.js.map +1 -0
  9. package/out/AccessControl.sol/AccessControl.abi.json +1 -0
  10. package/out/AccessControl.sol/AccessControl.json +1 -0
  11. package/out/AccessManagementSystem.sol/AccessManagementSystem.abi.json +256 -0
  12. package/out/AccessManagementSystem.sol/AccessManagementSystem.abi.json.d.ts +258 -0
  13. package/out/AccessManagementSystem.sol/AccessManagementSystem.json +1 -0
  14. package/out/AddressArray.sol/AddressArray.abi.json +1 -0
  15. package/out/AddressArray.sol/AddressArray.json +1 -0
  16. package/out/BalanceTransferSystem.sol/BalanceTransferSystem.abi.json +361 -0
  17. package/out/BalanceTransferSystem.sol/BalanceTransferSystem.abi.json.d.ts +363 -0
  18. package/out/BalanceTransferSystem.sol/BalanceTransferSystem.json +1 -0
  19. package/out/Balances.sol/Balances.abi.json +1 -0
  20. package/out/Balances.sol/Balances.json +1 -0
  21. package/out/Base.sol/CommonBase.abi.json +1 -0
  22. package/out/Base.sol/CommonBase.json +1 -0
  23. package/out/Base.sol/ScriptBase.abi.json +1 -0
  24. package/out/Base.sol/ScriptBase.json +1 -0
  25. package/out/Base.sol/TestBase.abi.json +1 -0
  26. package/out/Base.sol/TestBase.json +1 -0
  27. package/out/BatchCallSystem.sol/BatchCallSystem.abi.json +132 -0
  28. package/out/BatchCallSystem.sol/BatchCallSystem.abi.json.d.ts +134 -0
  29. package/out/BatchCallSystem.sol/BatchCallSystem.json +1 -0
  30. package/out/Bool.sol/Bool.abi.json +1 -0
  31. package/out/Bool.sol/Bool.json +1 -0
  32. package/out/Bytes.sol/Bytes.abi.json +1 -0
  33. package/out/Bytes.sol/Bytes.json +1 -0
  34. package/out/CallWithSignatureModule.sol/CallWithSignatureModule.abi.json +436 -0
  35. package/out/CallWithSignatureModule.sol/CallWithSignatureModule.abi.json.d.ts +438 -0
  36. package/out/CallWithSignatureModule.sol/CallWithSignatureModule.json +1 -0
  37. package/out/CallWithSignatureModule.t.sol/CallWithSignatureModuleTest.abi.json +541 -0
  38. package/out/CallWithSignatureModule.t.sol/CallWithSignatureModuleTest.abi.json.d.ts +543 -0
  39. package/out/CallWithSignatureModule.t.sol/CallWithSignatureModuleTest.json +1 -0
  40. package/out/CallWithSignatureNonces.sol/CallWithSignatureNonces.abi.json +1 -0
  41. package/out/CallWithSignatureNonces.sol/CallWithSignatureNonces.json +1 -0
  42. package/out/CallWithSignatureSystem.sol/CallWithSignatureSystem.abi.json +183 -0
  43. package/out/CallWithSignatureSystem.sol/CallWithSignatureSystem.abi.json.d.ts +185 -0
  44. package/out/CallWithSignatureSystem.sol/CallWithSignatureSystem.json +1 -0
  45. package/out/DecodeSlice.sol/DecodeSlice.abi.json +1 -0
  46. package/out/DecodeSlice.sol/DecodeSlice.json +1 -0
  47. package/out/Delegation.sol/Delegation.abi.json +1 -0
  48. package/out/Delegation.sol/Delegation.json +1 -0
  49. package/out/DelegationControl.sol/DelegationControl.abi.json +89 -0
  50. package/out/DelegationControl.sol/DelegationControl.abi.json.d.ts +91 -0
  51. package/out/DelegationControl.sol/DelegationControl.json +1 -0
  52. package/out/DelegationControlMock.sol/DelegationControlMock.abi.json +126 -0
  53. package/out/DelegationControlMock.sol/DelegationControlMock.abi.json.d.ts +128 -0
  54. package/out/DelegationControlMock.sol/DelegationControlMock.json +1 -0
  55. package/out/ECDSA.sol/ECDSA.abi.json +29 -0
  56. package/out/ECDSA.sol/ECDSA.abi.json.d.ts +31 -0
  57. package/out/ECDSA.sol/ECDSA.json +1 -0
  58. package/out/ERC165Checker.sol/ERC165Checker.abi.json +1 -0
  59. package/out/ERC165Checker.sol/ERC165Checker.json +1 -0
  60. package/out/EchoSubscriber.sol/EchoSubscriber.abi.json +303 -0
  61. package/out/EchoSubscriber.sol/EchoSubscriber.abi.json.d.ts +305 -0
  62. package/out/EchoSubscriber.sol/EchoSubscriber.json +1 -0
  63. package/out/EncodeArray.sol/EncodeArray.abi.json +1 -0
  64. package/out/EncodeArray.sol/EncodeArray.json +1 -0
  65. package/out/EncodedLengths.sol/EncodedLengthsInstance.abi.json +1 -0
  66. package/out/EncodedLengths.sol/EncodedLengthsInstance.json +1 -0
  67. package/out/EncodedLengths.sol/EncodedLengthsLib.abi.json +1 -0
  68. package/out/EncodedLengths.sol/EncodedLengthsLib.json +1 -0
  69. package/out/FieldLayout.sol/FieldLayoutInstance.abi.json +1 -0
  70. package/out/FieldLayout.sol/FieldLayoutInstance.json +1 -0
  71. package/out/FieldLayout.sol/FieldLayoutLib.abi.json +1 -0
  72. package/out/FieldLayout.sol/FieldLayoutLib.json +1 -0
  73. package/out/FieldLayoutEncodeHelper.sol/FieldLayoutEncodeHelper.abi.json +1 -0
  74. package/out/FieldLayoutEncodeHelper.sol/FieldLayoutEncodeHelper.json +1 -0
  75. package/out/FunctionSelectors.sol/FunctionSelectors.abi.json +1 -0
  76. package/out/FunctionSelectors.sol/FunctionSelectors.json +1 -0
  77. package/out/FunctionSignatures.sol/FunctionSignatures.abi.json +1 -0
  78. package/out/FunctionSignatures.sol/FunctionSignatures.json +1 -0
  79. package/out/GasReporter.sol/GasReporter.abi.json +520 -0
  80. package/out/GasReporter.sol/GasReporter.abi.json.d.ts +522 -0
  81. package/out/GasReporter.sol/GasReporter.json +1 -0
  82. package/out/Hook.sol/HookInstance.abi.json +1 -0
  83. package/out/Hook.sol/HookInstance.json +1 -0
  84. package/out/Hook.sol/HookLib.abi.json +1 -0
  85. package/out/Hook.sol/HookLib.json +1 -0
  86. package/out/Hooks.sol/Hooks.abi.json +1 -0
  87. package/out/Hooks.sol/Hooks.json +1 -0
  88. package/out/IAccessManagementSystem.sol/IAccessManagementSystem.abi.json +69 -0
  89. package/out/IAccessManagementSystem.sol/IAccessManagementSystem.abi.json.d.ts +71 -0
  90. package/out/IAccessManagementSystem.sol/IAccessManagementSystem.json +1 -0
  91. package/out/IBalanceTransferSystem.sol/IBalanceTransferSystem.abi.json +48 -0
  92. package/out/IBalanceTransferSystem.sol/IBalanceTransferSystem.abi.json.d.ts +50 -0
  93. package/out/IBalanceTransferSystem.sol/IBalanceTransferSystem.json +1 -0
  94. package/out/IBaseWorld.sol/IBaseWorld.abi.json +2008 -0
  95. package/out/IBaseWorld.sol/IBaseWorld.abi.json.d.ts +2010 -0
  96. package/out/IBaseWorld.sol/IBaseWorld.json +1 -0
  97. package/out/IBatchCallSystem.sol/IBatchCallSystem.abi.json +69 -0
  98. package/out/IBatchCallSystem.sol/IBatchCallSystem.abi.json.d.ts +71 -0
  99. package/out/IBatchCallSystem.sol/IBatchCallSystem.json +1 -0
  100. package/out/ICallWithSignatureErrors.sol/ICallWithSignatureErrors.abi.json +7 -0
  101. package/out/ICallWithSignatureErrors.sol/ICallWithSignatureErrors.abi.json.d.ts +9 -0
  102. package/out/ICallWithSignatureErrors.sol/ICallWithSignatureErrors.json +1 -0
  103. package/out/ICallWithSignatureSystem.sol/ICallWithSignatureSystem.abi.json +36 -0
  104. package/out/ICallWithSignatureSystem.sol/ICallWithSignatureSystem.abi.json.d.ts +38 -0
  105. package/out/ICallWithSignatureSystem.sol/ICallWithSignatureSystem.json +1 -0
  106. package/out/IDelegationControl.sol/IDelegationControl.abi.json +89 -0
  107. package/out/IDelegationControl.sol/IDelegationControl.abi.json.d.ts +91 -0
  108. package/out/IDelegationControl.sol/IDelegationControl.json +1 -0
  109. package/out/IERC1271.sol/IERC1271.abi.json +26 -0
  110. package/out/IERC1271.sol/IERC1271.abi.json.d.ts +28 -0
  111. package/out/IERC1271.sol/IERC1271.json +1 -0
  112. package/out/IERC165.sol/IERC165.abi.json +21 -0
  113. package/out/IERC165.sol/IERC165.abi.json.d.ts +23 -0
  114. package/out/IERC165.sol/IERC165.json +1 -0
  115. package/out/IEncodedLengthsErrors.sol/IEncodedLengthsErrors.abi.json +13 -0
  116. package/out/IEncodedLengthsErrors.sol/IEncodedLengthsErrors.abi.json.d.ts +15 -0
  117. package/out/IEncodedLengthsErrors.sol/IEncodedLengthsErrors.json +1 -0
  118. package/out/IFieldLayoutErrors.sol/IFieldLayoutErrors.abi.json +88 -0
  119. package/out/IFieldLayoutErrors.sol/IFieldLayoutErrors.abi.json.d.ts +90 -0
  120. package/out/IFieldLayoutErrors.sol/IFieldLayoutErrors.json +1 -0
  121. package/out/IModule.sol/IModule.abi.json +73 -0
  122. package/out/IModule.sol/IModule.abi.json.d.ts +75 -0
  123. package/out/IModule.sol/IModule.json +1 -0
  124. package/out/IModuleErrors.sol/IModuleErrors.abi.json +28 -0
  125. package/out/IModuleErrors.sol/IModuleErrors.abi.json.d.ts +30 -0
  126. package/out/IModuleErrors.sol/IModuleErrors.json +1 -0
  127. package/out/IModuleInstallationSystem.sol/IModuleInstallationSystem.abi.json +20 -0
  128. package/out/IModuleInstallationSystem.sol/IModuleInstallationSystem.abi.json.d.ts +22 -0
  129. package/out/IModuleInstallationSystem.sol/IModuleInstallationSystem.json +1 -0
  130. package/out/IMulticall3.sol/IMulticall3.abi.json +440 -0
  131. package/out/IMulticall3.sol/IMulticall3.abi.json.d.ts +442 -0
  132. package/out/IMulticall3.sol/IMulticall3.json +1 -0
  133. package/out/IRegistrationSystem.sol/IRegistrationSystem.abi.json +1 -0
  134. package/out/IRegistrationSystem.sol/IRegistrationSystem.json +1 -0
  135. package/out/ISchemaErrors.sol/ISchemaErrors.abi.json +18 -0
  136. package/out/ISchemaErrors.sol/ISchemaErrors.abi.json.d.ts +20 -0
  137. package/out/ISchemaErrors.sol/ISchemaErrors.json +1 -0
  138. package/out/ISliceErrors.sol/ISliceErrors.abi.json +23 -0
  139. package/out/ISliceErrors.sol/ISliceErrors.abi.json.d.ts +25 -0
  140. package/out/ISliceErrors.sol/ISliceErrors.json +1 -0
  141. package/out/IStore.sol/IStore.abi.json +1261 -0
  142. package/out/IStore.sol/IStore.abi.json.d.ts +1263 -0
  143. package/out/IStore.sol/IStore.json +1 -0
  144. package/out/IStoreErrors.sol/IStoreErrors.abi.json +204 -0
  145. package/out/IStoreErrors.sol/IStoreErrors.abi.json.d.ts +206 -0
  146. package/out/IStoreErrors.sol/IStoreErrors.json +1 -0
  147. package/out/IStoreEvents.sol/IStoreEvents.abi.json +151 -0
  148. package/out/IStoreEvents.sol/IStoreEvents.abi.json.d.ts +153 -0
  149. package/out/IStoreEvents.sol/IStoreEvents.json +1 -0
  150. package/out/IStoreHook.sol/IStoreHook.abi.json +290 -0
  151. package/out/IStoreHook.sol/IStoreHook.abi.json.d.ts +292 -0
  152. package/out/IStoreHook.sol/IStoreHook.json +1 -0
  153. package/out/IStoreKernel.sol/IStoreKernel.abi.json +1182 -0
  154. package/out/IStoreKernel.sol/IStoreKernel.abi.json.d.ts +1184 -0
  155. package/out/IStoreKernel.sol/IStoreKernel.json +1 -0
  156. package/out/IStoreRead.sol/IStoreRead.abi.json +389 -0
  157. package/out/IStoreRead.sol/IStoreRead.abi.json.d.ts +391 -0
  158. package/out/IStoreRead.sol/IStoreRead.json +1 -0
  159. package/out/IStoreRegistration.sol/IStoreRegistration.abi.json +81 -0
  160. package/out/IStoreRegistration.sol/IStoreRegistration.abi.json.d.ts +83 -0
  161. package/out/IStoreRegistration.sol/IStoreRegistration.json +1 -0
  162. package/out/IStoreWrite.sol/IStoreWrite.abi.json +446 -0
  163. package/out/IStoreWrite.sol/IStoreWrite.abi.json.d.ts +448 -0
  164. package/out/IStoreWrite.sol/IStoreWrite.json +1 -0
  165. package/out/ISystemHook.sol/ISystemHook.abi.json +67 -0
  166. package/out/ISystemHook.sol/ISystemHook.abi.json.d.ts +69 -0
  167. package/out/ISystemHook.sol/ISystemHook.json +1 -0
  168. package/out/IWorld.sol/IWorld.abi.json +2042 -0
  169. package/out/IWorld.sol/IWorld.abi.json.d.ts +2044 -0
  170. package/out/IWorld.sol/IWorld.json +1 -0
  171. package/out/IWorldContextConsumer.sol/IWorldContextConsumer.abi.json +60 -0
  172. package/out/IWorldContextConsumer.sol/IWorldContextConsumer.abi.json.d.ts +62 -0
  173. package/out/IWorldContextConsumer.sol/IWorldContextConsumer.json +1 -0
  174. package/out/IWorldErrors.sol/IWorldErrors.abi.json +200 -0
  175. package/out/IWorldErrors.sol/IWorldErrors.abi.json.d.ts +202 -0
  176. package/out/IWorldErrors.sol/IWorldErrors.json +1 -0
  177. package/out/IWorldEvents.sol/IWorldEvents.abi.json +15 -0
  178. package/out/IWorldEvents.sol/IWorldEvents.abi.json.d.ts +17 -0
  179. package/out/IWorldEvents.sol/IWorldEvents.json +1 -0
  180. package/out/IWorldKernel.sol/IWorldCall.abi.json +55 -0
  181. package/out/IWorldKernel.sol/IWorldCall.abi.json.d.ts +57 -0
  182. package/out/IWorldKernel.sol/IWorldCall.json +1 -0
  183. package/out/IWorldKernel.sol/IWorldKernel.abi.json +349 -0
  184. package/out/IWorldKernel.sol/IWorldKernel.abi.json.d.ts +351 -0
  185. package/out/IWorldKernel.sol/IWorldKernel.json +1 -0
  186. package/out/IWorldKernel.sol/IWorldModuleInstallation.abi.json +20 -0
  187. package/out/IWorldKernel.sol/IWorldModuleInstallation.abi.json.d.ts +22 -0
  188. package/out/IWorldKernel.sol/IWorldModuleInstallation.json +1 -0
  189. package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.abi.json +204 -0
  190. package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.abi.json.d.ts +206 -0
  191. package/out/IWorldRegistrationSystem.sol/IWorldRegistrationSystem.json +1 -0
  192. package/out/InitModule.sol/InitModule.abi.json +462 -0
  193. package/out/InitModule.sol/InitModule.abi.json.d.ts +464 -0
  194. package/out/InitModule.sol/InitModule.json +1 -0
  195. package/out/InitModuleAddress.sol/InitModuleAddress.abi.json +1 -0
  196. package/out/InitModuleAddress.sol/InitModuleAddress.json +1 -0
  197. package/out/InstalledModules.sol/InstalledModules.abi.json +1 -0
  198. package/out/InstalledModules.sol/InstalledModules.json +1 -0
  199. package/out/LimitedCallContext.sol/LimitedCallContext.abi.json +7 -0
  200. package/out/LimitedCallContext.sol/LimitedCallContext.abi.json.d.ts +9 -0
  201. package/out/LimitedCallContext.sol/LimitedCallContext.json +1 -0
  202. package/out/Memory.sol/Memory.abi.json +1 -0
  203. package/out/Memory.sol/Memory.json +1 -0
  204. package/out/Module.sol/Module.abi.json +112 -0
  205. package/out/Module.sol/Module.abi.json.d.ts +114 -0
  206. package/out/Module.sol/Module.json +1 -0
  207. package/out/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json +151 -0
  208. package/out/ModuleInstallationSystem.sol/ModuleInstallationSystem.abi.json.d.ts +153 -0
  209. package/out/ModuleInstallationSystem.sol/ModuleInstallationSystem.json +1 -0
  210. package/out/NamespaceDelegationControl.sol/NamespaceDelegationControl.abi.json +1 -0
  211. package/out/NamespaceDelegationControl.sol/NamespaceDelegationControl.json +1 -0
  212. package/out/NamespaceOwner.sol/NamespaceOwner.abi.json +1 -0
  213. package/out/NamespaceOwner.sol/NamespaceOwner.json +1 -0
  214. package/out/RegistrationSystem.sol/RegistrationSystem.abi.json +1018 -0
  215. package/out/RegistrationSystem.sol/RegistrationSystem.abi.json.d.ts +1020 -0
  216. package/out/RegistrationSystem.sol/RegistrationSystem.json +1 -0
  217. package/out/ResourceAccess.sol/ResourceAccess.abi.json +1 -0
  218. package/out/ResourceAccess.sol/ResourceAccess.json +1 -0
  219. package/out/ResourceId.sol/ResourceIdInstance.abi.json +1 -0
  220. package/out/ResourceId.sol/ResourceIdInstance.json +1 -0
  221. package/out/ResourceId.sol/ResourceIdLib.abi.json +1 -0
  222. package/out/ResourceId.sol/ResourceIdLib.json +1 -0
  223. package/out/ResourceIds.sol/ResourceIds.abi.json +1 -0
  224. package/out/ResourceIds.sol/ResourceIds.json +1 -0
  225. package/out/RevertSubscriber.sol/RevertSubscriber.abi.json +290 -0
  226. package/out/RevertSubscriber.sol/RevertSubscriber.abi.json.d.ts +292 -0
  227. package/out/RevertSubscriber.sol/RevertSubscriber.json +1 -0
  228. package/out/Schema.sol/SchemaInstance.abi.json +1 -0
  229. package/out/Schema.sol/SchemaInstance.json +1 -0
  230. package/out/Schema.sol/SchemaLib.abi.json +1 -0
  231. package/out/Schema.sol/SchemaLib.json +1 -0
  232. package/out/SchemaEncodeHelper.sol/SchemaEncodeHelper.abi.json +1 -0
  233. package/out/SchemaEncodeHelper.sol/SchemaEncodeHelper.json +1 -0
  234. package/out/SignatureChecker.sol/SignatureChecker.abi.json +1 -0
  235. package/out/SignatureChecker.sol/SignatureChecker.json +1 -0
  236. package/out/Slice.sol/SliceInstance.abi.json +1 -0
  237. package/out/Slice.sol/SliceInstance.json +1 -0
  238. package/out/Slice.sol/SliceLib.abi.json +1 -0
  239. package/out/Slice.sol/SliceLib.json +1 -0
  240. package/out/StdAssertions.sol/StdAssertions.abi.json +392 -0
  241. package/out/StdAssertions.sol/StdAssertions.abi.json.d.ts +394 -0
  242. package/out/StdAssertions.sol/StdAssertions.json +1 -0
  243. package/out/StdChains.sol/StdChains.abi.json +1 -0
  244. package/out/StdChains.sol/StdChains.json +1 -0
  245. package/out/StdCheats.sol/StdCheats.abi.json +1 -0
  246. package/out/StdCheats.sol/StdCheats.json +1 -0
  247. package/out/StdCheats.sol/StdCheatsSafe.abi.json +1 -0
  248. package/out/StdCheats.sol/StdCheatsSafe.json +1 -0
  249. package/out/StdError.sol/stdError.abi.json +119 -0
  250. package/out/StdError.sol/stdError.abi.json.d.ts +121 -0
  251. package/out/StdError.sol/stdError.json +1 -0
  252. package/out/StdInvariant.sol/StdInvariant.abi.json +130 -0
  253. package/out/StdInvariant.sol/StdInvariant.abi.json.d.ts +132 -0
  254. package/out/StdInvariant.sol/StdInvariant.json +1 -0
  255. package/out/StdJson.sol/stdJson.abi.json +1 -0
  256. package/out/StdJson.sol/stdJson.json +1 -0
  257. package/out/StdMath.sol/stdMath.abi.json +1 -0
  258. package/out/StdMath.sol/stdMath.json +1 -0
  259. package/out/StdStorage.sol/stdStorage.abi.json +1 -0
  260. package/out/StdStorage.sol/stdStorage.json +1 -0
  261. package/out/StdStorage.sol/stdStorageSafe.abi.json +52 -0
  262. package/out/StdStorage.sol/stdStorageSafe.abi.json.d.ts +54 -0
  263. package/out/StdStorage.sol/stdStorageSafe.json +1 -0
  264. package/out/StdStyle.sol/StdStyle.abi.json +1 -0
  265. package/out/StdStyle.sol/StdStyle.json +1 -0
  266. package/out/StdUtils.sol/StdUtils.abi.json +1 -0
  267. package/out/StdUtils.sol/StdUtils.json +1 -0
  268. package/out/Storage.sol/Storage.abi.json +1 -0
  269. package/out/Storage.sol/Storage.json +1 -0
  270. package/out/StoreCore.sol/StoreCore.abi.json +1 -0
  271. package/out/StoreCore.sol/StoreCore.json +1 -0
  272. package/out/StoreCore.sol/StoreCoreInternal.abi.json +1 -0
  273. package/out/StoreCore.sol/StoreCoreInternal.json +1 -0
  274. package/out/StoreHook.sol/StoreHook.abi.json +290 -0
  275. package/out/StoreHook.sol/StoreHook.abi.json.d.ts +292 -0
  276. package/out/StoreHook.sol/StoreHook.json +1 -0
  277. package/out/StoreHooks.sol/StoreHooks.abi.json +1 -0
  278. package/out/StoreHooks.sol/StoreHooks.json +1 -0
  279. package/out/StoreKernel.sol/StoreKernel.abi.json +1182 -0
  280. package/out/StoreKernel.sol/StoreKernel.abi.json.d.ts +1184 -0
  281. package/out/StoreKernel.sol/StoreKernel.json +1 -0
  282. package/out/StoreRead.sol/StoreRead.abi.json +437 -0
  283. package/out/StoreRead.sol/StoreRead.abi.json.d.ts +439 -0
  284. package/out/StoreRead.sol/StoreRead.json +1 -0
  285. package/out/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json +779 -0
  286. package/out/StoreRegistrationSystem.sol/StoreRegistrationSystem.abi.json.d.ts +781 -0
  287. package/out/StoreRegistrationSystem.sol/StoreRegistrationSystem.json +1 -0
  288. package/out/StoreSwitch.sol/StoreSwitch.abi.json +1 -0
  289. package/out/StoreSwitch.sol/StoreSwitch.json +1 -0
  290. package/out/System.sol/System.abi.json +60 -0
  291. package/out/System.sol/System.abi.json.d.ts +62 -0
  292. package/out/System.sol/System.json +1 -0
  293. package/out/SystemCall.sol/SystemCall.abi.json +1 -0
  294. package/out/SystemCall.sol/SystemCall.json +1 -0
  295. package/out/SystemHook.sol/SystemHook.abi.json +67 -0
  296. package/out/SystemHook.sol/SystemHook.abi.json.d.ts +69 -0
  297. package/out/SystemHook.sol/SystemHook.json +1 -0
  298. package/out/SystemHooks.sol/SystemHooks.abi.json +1 -0
  299. package/out/SystemHooks.sol/SystemHooks.json +1 -0
  300. package/out/SystemRegistry.sol/SystemRegistry.abi.json +1 -0
  301. package/out/SystemRegistry.sol/SystemRegistry.json +1 -0
  302. package/out/Systems.sol/Systems.abi.json +1 -0
  303. package/out/Systems.sol/Systems.json +1 -0
  304. package/out/Tables.sol/Tables.abi.json +1 -0
  305. package/out/Tables.sol/Tables.json +1 -0
  306. package/out/Test.sol/Test.abi.json +520 -0
  307. package/out/Test.sol/Test.abi.json.d.ts +522 -0
  308. package/out/Test.sol/Test.json +1 -0
  309. package/out/TightCoder.sol/TightCoder.abi.json +1 -0
  310. package/out/TightCoder.sol/TightCoder.json +1 -0
  311. package/out/TwoFields.sol/TwoFields.abi.json +1 -0
  312. package/out/TwoFields.sol/TwoFields.json +1 -0
  313. package/out/UserDelegationControl.sol/UserDelegationControl.abi.json +1 -0
  314. package/out/UserDelegationControl.sol/UserDelegationControl.json +1 -0
  315. package/out/Vm.sol/Vm.abi.json +3878 -0
  316. package/out/Vm.sol/Vm.abi.json.d.ts +3880 -0
  317. package/out/Vm.sol/Vm.json +1 -0
  318. package/out/Vm.sol/VmSafe.abi.json +2678 -0
  319. package/out/Vm.sol/VmSafe.abi.json.d.ts +2680 -0
  320. package/out/Vm.sol/VmSafe.json +1 -0
  321. package/out/World.sol/World.abi.json +1542 -0
  322. package/out/World.sol/World.abi.json.d.ts +1544 -0
  323. package/out/World.sol/World.json +1 -0
  324. package/out/World.t.sol/EchoSystemHook.abi.json +80 -0
  325. package/out/World.t.sol/EchoSystemHook.abi.json.d.ts +82 -0
  326. package/out/World.t.sol/EchoSystemHook.json +1 -0
  327. package/out/World.t.sol/IWorldTestSystem.abi.json +15 -0
  328. package/out/World.t.sol/IWorldTestSystem.abi.json.d.ts +17 -0
  329. package/out/World.t.sol/IWorldTestSystem.json +1 -0
  330. package/out/World.t.sol/PayableFallbackSystem.abi.json +64 -0
  331. package/out/World.t.sol/PayableFallbackSystem.abi.json.d.ts +66 -0
  332. package/out/World.t.sol/PayableFallbackSystem.json +1 -0
  333. package/out/World.t.sol/RevertSystemHook.abi.json +80 -0
  334. package/out/World.t.sol/RevertSystemHook.abi.json.d.ts +82 -0
  335. package/out/World.t.sol/RevertSystemHook.json +1 -0
  336. package/out/World.t.sol/WorldTest.abi.json +1029 -0
  337. package/out/World.t.sol/WorldTest.abi.json.d.ts +1031 -0
  338. package/out/World.t.sol/WorldTest.json +1 -0
  339. package/out/World.t.sol/WorldTestSystem.abi.json +277 -0
  340. package/out/World.t.sol/WorldTestSystem.abi.json.d.ts +279 -0
  341. package/out/World.t.sol/WorldTestSystem.json +1 -0
  342. package/out/WorldContext.sol/WorldContextConsumer.abi.json +60 -0
  343. package/out/WorldContext.sol/WorldContextConsumer.abi.json.d.ts +62 -0
  344. package/out/WorldContext.sol/WorldContextConsumer.json +1 -0
  345. package/out/WorldContext.sol/WorldContextConsumerLib.abi.json +1 -0
  346. package/out/WorldContext.sol/WorldContextConsumerLib.json +1 -0
  347. package/out/WorldContext.sol/WorldContextProviderLib.abi.json +1 -0
  348. package/out/WorldContext.sol/WorldContextProviderLib.json +1 -0
  349. package/out/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json +691 -0
  350. package/out/WorldRegistrationSystem.sol/WorldRegistrationSystem.abi.json.d.ts +693 -0
  351. package/out/WorldRegistrationSystem.sol/WorldRegistrationSystem.json +1 -0
  352. package/out/WorldResourceId.sol/WorldResourceIdInstance.abi.json +1 -0
  353. package/out/WorldResourceId.sol/WorldResourceIdInstance.json +1 -0
  354. package/out/WorldResourceId.sol/WorldResourceIdLib.abi.json +1 -0
  355. package/out/WorldResourceId.sol/WorldResourceIdLib.json +1 -0
  356. package/out/build-info/306c60bc5d3442ad78ed6293bddbefdd.json +1 -0
  357. package/out/console.sol/console.abi.json +1 -0
  358. package/out/console.sol/console.json +1 -0
  359. package/out/console2.sol/console2.abi.json +1 -0
  360. package/out/console2.sol/console2.json +1 -0
  361. package/out/constants.sol/LayoutOffsets.abi.json +1 -0
  362. package/out/constants.sol/LayoutOffsets.json +1 -0
  363. package/out/safeconsole.sol/safeconsole.abi.json +1 -0
  364. package/out/safeconsole.sol/safeconsole.json +1 -0
  365. package/out/src/IERC165.sol/IERC165.abi.json +21 -0
  366. package/out/src/IERC165.sol/IERC165.abi.json.d.ts +23 -0
  367. package/out/src/IERC165.sol/IERC165.json +1 -0
  368. package/out/test.sol/DSTest.abi.json +296 -0
  369. package/out/test.sol/DSTest.abi.json.d.ts +298 -0
  370. package/out/test.sol/DSTest.json +1 -0
  371. package/package.json +64 -0
  372. package/src/CallWithSignatureModule.sol +48 -0
  373. package/src/CallWithSignatureSystem.sol +36 -0
  374. package/src/ECDSA.sol +174 -0
  375. package/src/ICallWithSignatureErrors.sol +9 -0
  376. package/src/IERC1271.sol +17 -0
  377. package/src/SignatureChecker.sol +50 -0
  378. package/src/codegen/index.sol +6 -0
  379. package/src/codegen/tables/CallWithSignatureNonces.sol +199 -0
  380. package/src/codegen/world/ICallWithSignatureSystem.sol +20 -0
  381. package/src/codegen/world/IWorld.sol +16 -0
  382. package/src/constants.sol +10 -0
  383. package/src/getSignedMessageHash.sol +54 -0
  384. package/src/validateCallWithSignature.sol +31 -0
@@ -0,0 +1,9 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
+
4
+ interface ICallWithSignatureErrors {
5
+ /**
6
+ * @dev Mismatched signature.
7
+ */
8
+ error InvalidSignature();
9
+ }
@@ -0,0 +1,17 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)
3
+
4
+ pragma solidity ^0.8.24;
5
+
6
+ /**
7
+ * @dev Interface of the ERC-1271 standard signature validation method for
8
+ * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
9
+ */
10
+ interface IERC1271 {
11
+ /**
12
+ * @dev Should return whether the signature provided is valid for the provided data
13
+ * @param hash Hash of the data to be signed
14
+ * @param signature Signature byte array associated with _data
15
+ */
16
+ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
17
+ }
@@ -0,0 +1,50 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/SignatureChecker.sol)
3
+
4
+ pragma solidity ^0.8.24;
5
+
6
+ import { ECDSA } from "./ECDSA.sol";
7
+ import { IERC1271 } from "./IERC1271.sol";
8
+
9
+ /**
10
+ * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
11
+ * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like
12
+ * Argent and Safe Wallet (previously Gnosis Safe).
13
+ */
14
+ library SignatureChecker {
15
+ /**
16
+ * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
17
+ * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.
18
+ *
19
+ * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
20
+ * change through time. It could return true at block N and false at block N+1 (or the opposite).
21
+ */
22
+ function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
23
+ if (signer.code.length == 0) {
24
+ (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);
25
+ return err == ECDSA.RecoverError.NoError && recovered == signer;
26
+ } else {
27
+ return isValidERC1271SignatureNow(signer, hash, signature);
28
+ }
29
+ }
30
+
31
+ /**
32
+ * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated
33
+ * against the signer smart contract using ERC-1271.
34
+ *
35
+ * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
36
+ * change through time. It could return true at block N and false at block N+1 (or the opposite).
37
+ */
38
+ function isValidERC1271SignatureNow(
39
+ address signer,
40
+ bytes32 hash,
41
+ bytes memory signature
42
+ ) internal view returns (bool) {
43
+ (bool success, bytes memory result) = signer.staticcall(
44
+ abi.encodeCall(IERC1271.isValidSignature, (hash, signature))
45
+ );
46
+ return (success &&
47
+ result.length >= 32 &&
48
+ abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
49
+ }
50
+ }
@@ -0,0 +1,6 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
+
4
+ /* Autogenerated file. Do not edit manually. */
5
+
6
+ import { CallWithSignatureNonces } from "./tables/CallWithSignatureNonces.sol";
@@ -0,0 +1,199 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
+
4
+ /* Autogenerated file. Do not edit manually. */
5
+
6
+ // Import store internals
7
+ import { IStore } from "@latticexyz/store/src/IStore.sol";
8
+ import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
9
+ import { StoreCore } from "@latticexyz/store/src/StoreCore.sol";
10
+ import { Bytes } from "@latticexyz/store/src/Bytes.sol";
11
+ import { Memory } from "@latticexyz/store/src/Memory.sol";
12
+ import { SliceLib } from "@latticexyz/store/src/Slice.sol";
13
+ import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol";
14
+ import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol";
15
+ import { Schema } from "@latticexyz/store/src/Schema.sol";
16
+ import { EncodedLengths, EncodedLengthsLib } from "@latticexyz/store/src/EncodedLengths.sol";
17
+ import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
18
+
19
+ library CallWithSignatureNonces {
20
+ // Hex below is the result of `WorldResourceIdLib.encode({ namespace: "", name: "CallWithSignatur", typeId: RESOURCE_TABLE });`
21
+ ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000043616c6c576974685369676e61747572);
22
+
23
+ FieldLayout constant _fieldLayout =
24
+ FieldLayout.wrap(0x0020010020000000000000000000000000000000000000000000000000000000);
25
+
26
+ // Hex-encoded key schema of (address)
27
+ Schema constant _keySchema = Schema.wrap(0x0014010061000000000000000000000000000000000000000000000000000000);
28
+ // Hex-encoded value schema of (uint256)
29
+ Schema constant _valueSchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000);
30
+
31
+ /**
32
+ * @notice Get the table's key field names.
33
+ * @return keyNames An array of strings with the names of key fields.
34
+ */
35
+ function getKeyNames() internal pure returns (string[] memory keyNames) {
36
+ keyNames = new string[](1);
37
+ keyNames[0] = "signer";
38
+ }
39
+
40
+ /**
41
+ * @notice Get the table's value field names.
42
+ * @return fieldNames An array of strings with the names of value fields.
43
+ */
44
+ function getFieldNames() internal pure returns (string[] memory fieldNames) {
45
+ fieldNames = new string[](1);
46
+ fieldNames[0] = "nonce";
47
+ }
48
+
49
+ /**
50
+ * @notice Register the table with its config.
51
+ */
52
+ function register() internal {
53
+ StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
54
+ }
55
+
56
+ /**
57
+ * @notice Register the table with its config.
58
+ */
59
+ function _register() internal {
60
+ StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames());
61
+ }
62
+
63
+ /**
64
+ * @notice Get nonce.
65
+ */
66
+ function getNonce(address signer) internal view returns (uint256 nonce) {
67
+ bytes32[] memory _keyTuple = new bytes32[](1);
68
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
69
+
70
+ bytes32 _blob = StoreSwitch.getStaticField(_tableId, _keyTuple, 0, _fieldLayout);
71
+ return (uint256(bytes32(_blob)));
72
+ }
73
+
74
+ /**
75
+ * @notice Get nonce.
76
+ */
77
+ function _getNonce(address signer) internal view returns (uint256 nonce) {
78
+ bytes32[] memory _keyTuple = new bytes32[](1);
79
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
80
+
81
+ bytes32 _blob = StoreCore.getStaticField(_tableId, _keyTuple, 0, _fieldLayout);
82
+ return (uint256(bytes32(_blob)));
83
+ }
84
+
85
+ /**
86
+ * @notice Get nonce.
87
+ */
88
+ function get(address signer) internal view returns (uint256 nonce) {
89
+ bytes32[] memory _keyTuple = new bytes32[](1);
90
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
91
+
92
+ bytes32 _blob = StoreSwitch.getStaticField(_tableId, _keyTuple, 0, _fieldLayout);
93
+ return (uint256(bytes32(_blob)));
94
+ }
95
+
96
+ /**
97
+ * @notice Get nonce.
98
+ */
99
+ function _get(address signer) internal view returns (uint256 nonce) {
100
+ bytes32[] memory _keyTuple = new bytes32[](1);
101
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
102
+
103
+ bytes32 _blob = StoreCore.getStaticField(_tableId, _keyTuple, 0, _fieldLayout);
104
+ return (uint256(bytes32(_blob)));
105
+ }
106
+
107
+ /**
108
+ * @notice Set nonce.
109
+ */
110
+ function setNonce(address signer, uint256 nonce) internal {
111
+ bytes32[] memory _keyTuple = new bytes32[](1);
112
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
113
+
114
+ StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((nonce)), _fieldLayout);
115
+ }
116
+
117
+ /**
118
+ * @notice Set nonce.
119
+ */
120
+ function _setNonce(address signer, uint256 nonce) internal {
121
+ bytes32[] memory _keyTuple = new bytes32[](1);
122
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
123
+
124
+ StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((nonce)), _fieldLayout);
125
+ }
126
+
127
+ /**
128
+ * @notice Set nonce.
129
+ */
130
+ function set(address signer, uint256 nonce) internal {
131
+ bytes32[] memory _keyTuple = new bytes32[](1);
132
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
133
+
134
+ StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((nonce)), _fieldLayout);
135
+ }
136
+
137
+ /**
138
+ * @notice Set nonce.
139
+ */
140
+ function _set(address signer, uint256 nonce) internal {
141
+ bytes32[] memory _keyTuple = new bytes32[](1);
142
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
143
+
144
+ StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((nonce)), _fieldLayout);
145
+ }
146
+
147
+ /**
148
+ * @notice Delete all data for given keys.
149
+ */
150
+ function deleteRecord(address signer) internal {
151
+ bytes32[] memory _keyTuple = new bytes32[](1);
152
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
153
+
154
+ StoreSwitch.deleteRecord(_tableId, _keyTuple);
155
+ }
156
+
157
+ /**
158
+ * @notice Delete all data for given keys.
159
+ */
160
+ function _deleteRecord(address signer) internal {
161
+ bytes32[] memory _keyTuple = new bytes32[](1);
162
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
163
+
164
+ StoreCore.deleteRecord(_tableId, _keyTuple, _fieldLayout);
165
+ }
166
+
167
+ /**
168
+ * @notice Tightly pack static (fixed length) data using this table's schema.
169
+ * @return The static data, encoded into a sequence of bytes.
170
+ */
171
+ function encodeStatic(uint256 nonce) internal pure returns (bytes memory) {
172
+ return abi.encodePacked(nonce);
173
+ }
174
+
175
+ /**
176
+ * @notice Encode all of a record's fields.
177
+ * @return The static (fixed length) data, encoded into a sequence of bytes.
178
+ * @return The lengths of the dynamic fields (packed into a single bytes32 value).
179
+ * @return The dynamic (variable length) data, encoded into a sequence of bytes.
180
+ */
181
+ function encode(uint256 nonce) internal pure returns (bytes memory, EncodedLengths, bytes memory) {
182
+ bytes memory _staticData = encodeStatic(nonce);
183
+
184
+ EncodedLengths _encodedLengths;
185
+ bytes memory _dynamicData;
186
+
187
+ return (_staticData, _encodedLengths, _dynamicData);
188
+ }
189
+
190
+ /**
191
+ * @notice Encode keys as a bytes32 array using this table's field layout.
192
+ */
193
+ function encodeKeyTuple(address signer) internal pure returns (bytes32[] memory) {
194
+ bytes32[] memory _keyTuple = new bytes32[](1);
195
+ _keyTuple[0] = bytes32(uint256(uint160(signer)));
196
+
197
+ return _keyTuple;
198
+ }
199
+ }
@@ -0,0 +1,20 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
+
4
+ /* Autogenerated file. Do not edit manually. */
5
+
6
+ import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
7
+
8
+ /**
9
+ * @title ICallWithSignatureSystem
10
+ * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz)
11
+ * @dev This interface is automatically generated from the corresponding system contract. Do not edit manually.
12
+ */
13
+ interface ICallWithSignatureSystem {
14
+ function callWithSignature(
15
+ address signer,
16
+ ResourceId systemId,
17
+ bytes memory callData,
18
+ bytes memory signature
19
+ ) external payable returns (bytes memory);
20
+ }
@@ -0,0 +1,16 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
+
4
+ /* Autogenerated file. Do not edit manually. */
5
+
6
+ import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld.sol";
7
+ import { ICallWithSignatureSystem } from "./ICallWithSignatureSystem.sol";
8
+
9
+ /**
10
+ * @title IWorld
11
+ * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz)
12
+ * @notice This interface integrates all systems and associated function selectors
13
+ * that are dynamically registered in the World during deployment.
14
+ * @dev This is an autogenerated file; do not edit manually.
15
+ */
16
+ interface IWorld is IBaseWorld, ICallWithSignatureSystem {}
@@ -0,0 +1,10 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
+
4
+ import { ResourceId } from "@latticexyz/world/src/WorldResourceId.sol";
5
+ import { ROOT_NAMESPACE } from "@latticexyz/world/src/constants.sol";
6
+ import { RESOURCE_TABLE, RESOURCE_SYSTEM, RESOURCE_NAMESPACE } from "@latticexyz/world/src/worldResourceTypes.sol";
7
+
8
+ ResourceId constant DELEGATION_SYSTEM_ID = ResourceId.wrap(
9
+ (bytes32(abi.encodePacked(RESOURCE_SYSTEM, ROOT_NAMESPACE, "Delegation")))
10
+ );
@@ -0,0 +1,54 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
+
4
+ import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
5
+ import { WorldResourceIdLib, WorldResourceIdInstance } from "@latticexyz/world/src/WorldResourceId.sol";
6
+
7
+ using WorldResourceIdInstance for ResourceId;
8
+
9
+ // Note the intended value of the `salt` field is the chain ID.
10
+ // It is not included in `chainId`, to allow cross-chain signing without requiring wallets to switch networks.
11
+ // The value of this field should be the chain on which the world lives, rather than the chain the wallet is connected to.
12
+ bytes32 constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(address verifyingContract,bytes32 salt)");
13
+ bytes32 constant CALL_TYPEHASH = keccak256(
14
+ "Call(address signer,string systemNamespace,string systemName,bytes callData,uint256 nonce)"
15
+ );
16
+
17
+ /**
18
+ * @notice Generate the message hash for a given delegation signature.
19
+ * For EIP712 signatures https://eips.ethereum.org/EIPS/eip-712
20
+ * @dev We include the signer address to prevent generating a signature that recovers to a random address that didn't sign the message.
21
+ * @param signer The address on whose behalf the system is called.
22
+ * @param systemId The ID of the system to be called.
23
+ * @param callData The ABI data for the system call.
24
+ * @param nonce The nonce of the signer
25
+ * @param worldAddress The world address
26
+ * @return Return the message hash.
27
+ */
28
+ function getSignedMessageHash(
29
+ address signer,
30
+ ResourceId systemId,
31
+ bytes memory callData,
32
+ uint256 nonce,
33
+ address worldAddress
34
+ ) view returns (bytes32) {
35
+ bytes32 domainSeperator = keccak256(abi.encode(DOMAIN_TYPEHASH, worldAddress, bytes32(block.chainid)));
36
+
37
+ return
38
+ keccak256(
39
+ abi.encodePacked(
40
+ "\x19\x01",
41
+ domainSeperator,
42
+ keccak256(
43
+ abi.encode(
44
+ CALL_TYPEHASH,
45
+ signer,
46
+ keccak256(abi.encodePacked(WorldResourceIdLib.toTrimmedString(systemId.getNamespace()))),
47
+ keccak256(abi.encodePacked(WorldResourceIdLib.toTrimmedString(systemId.getName()))),
48
+ keccak256(callData),
49
+ nonce
50
+ )
51
+ )
52
+ )
53
+ );
54
+ }
@@ -0,0 +1,31 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.24;
3
+ import { ResourceId } from "@latticexyz/world/src/WorldResourceId.sol";
4
+ import { WorldContextConsumerLib } from "@latticexyz/world/src/WorldContext.sol";
5
+ import { CallWithSignatureNonces } from "./codegen/tables/CallWithSignatureNonces.sol";
6
+ import { getSignedMessageHash } from "./getSignedMessageHash.sol";
7
+ import { ECDSA } from "./ECDSA.sol";
8
+ import { ICallWithSignatureErrors } from "./ICallWithSignatureErrors.sol";
9
+ import { SignatureChecker } from "./SignatureChecker.sol";
10
+
11
+ /**
12
+ * @notice Verifies the given system call corresponds to the given signature.
13
+ * @param signer The address on whose behalf the system is called.
14
+ * @param systemId The ID of the system to be called.
15
+ * @param callData The ABI data for the system call.
16
+ * @param signature The EIP712 signature.
17
+ * @dev Reverts with InvalidSignature(recoveredSigner) if the signature is invalid.
18
+ */
19
+ function validateCallWithSignature(
20
+ address signer,
21
+ ResourceId systemId,
22
+ bytes memory callData,
23
+ bytes memory signature
24
+ ) view {
25
+ uint256 nonce = CallWithSignatureNonces._get(signer);
26
+ bytes32 hash = getSignedMessageHash(signer, systemId, callData, nonce, WorldContextConsumerLib._world());
27
+
28
+ if (!SignatureChecker.isValidSignatureNow(signer, hash, signature)) {
29
+ revert ICallWithSignatureErrors.InvalidSignature();
30
+ }
31
+ }