From 120c5764723214fb5f57809de9f3434bdba67ba2 Mon Sep 17 00:00:00 2001 From: alvrs Date: Thu, 14 Sep 2023 20:38:36 +0100 Subject: [PATCH] feat: rename key to keyTuple --- docs/pages/store/advanced-features.mdx | 12 +- docs/pages/store/reading-and-writing.mdx | 60 +- docs/pages/store/spec.mdx | 6 +- docs/pages/world/modules.mdx | 6 +- packages/block-logs-stream/README.md | 8 +- .../EchoSubscriber.abi.json | 202 +++ .../EchoSubscriber.abi.json.d.ts | 203 +++ packages/store/abi/IStore.sol/IStore.abi.json | 717 ++++++++++ .../store/abi/IStore.sol/IStore.abi.json.d.ts | 718 ++++++++++ .../store/abi/IStore.sol/IStoreData.abi.json | 463 +++++++ .../abi/IStore.sol/IStoreData.abi.json.d.ts | 464 +++++++ .../abi/IStore.sol/IStoreEphemeral.abi.json | 55 + .../IStore.sol/IStoreEphemeral.abi.json.d.ts | 56 + .../store/abi/IStore.sol/IStoreRead.abi.json | 200 +++ .../abi/IStore.sol/IStoreRead.abi.json.d.ts | 201 +++ .../store/abi/IStore.sol/IStoreWrite.abi.json | 265 ++++ .../abi/IStore.sol/IStoreWrite.abi.json.d.ts | 266 ++++ .../abi/IStoreHook.sol/IStoreHook.abi.json | 189 +++ .../IStoreHook.sol/IStoreHook.abi.json.d.ts | 190 +++ .../MirrorSubscriber.abi.json | 294 ++++ .../MirrorSubscriber.abi.json.d.ts | 295 ++++ .../abi/StoreCore.sol/StoreCore.abi.json | 102 ++ .../abi/StoreCore.sol/StoreCore.abi.json.d.ts | 103 ++ .../abi/StoreHook.sol/StoreHook.abi.json | 189 +++ .../abi/StoreHook.sol/StoreHook.abi.json.d.ts | 190 +++ .../abi/StoreMock.sol/StoreMock.abi.json | 791 +++++++++++ .../abi/StoreMock.sol/StoreMock.abi.json.d.ts | 792 +++++++++++ .../abi/StoreRead.sol/StoreRead.abi.json | 242 ++++ .../abi/StoreRead.sol/StoreRead.abi.json.d.ts | 243 ++++ packages/store/src/IStore.sol | 35 +- packages/store/src/IStoreHook.sol | 17 +- packages/store/src/StoreCore.sol | 182 +-- packages/store/src/StoreRead.sol | 16 +- packages/store/src/StoreSwitch.sol | 66 +- packages/store/test/EchoSubscriber.sol | 34 +- packages/store/test/MirrorSubscriber.sol | 26 +- packages/store/test/StoreCore.t.sol | 276 ++-- packages/store/test/StoreCoreDynamic.t.sol | 6 +- packages/store/test/StoreCoreGas.t.sol | 138 +- packages/store/test/StoreMock.sol | 28 +- packages/store/ts/storeEvents.ts | 8 +- .../abi/CoreSystem.sol/CoreSystem.abi.json | 757 ++++++++++ .../CoreSystem.sol/CoreSystem.abi.json.d.ts | 758 ++++++++++ .../EphemeralRecordSystem.abi.json | 166 +++ .../EphemeralRecordSystem.abi.json.d.ts | 167 +++ .../abi/IBaseWorld.sol/IBaseWorld.abi.json | 1231 ++++++++++++++++ .../IBaseWorld.sol/IBaseWorld.abi.json.d.ts | 1232 +++++++++++++++++ packages/world/abi/IStore.sol/IStore.abi.json | 717 ++++++++++ .../world/abi/IStore.sol/IStore.abi.json.d.ts | 718 ++++++++++ .../world/abi/IStore.sol/IStoreData.abi.json | 463 +++++++ .../abi/IStore.sol/IStoreData.abi.json.d.ts | 464 +++++++ .../abi/IStore.sol/IStoreEphemeral.abi.json | 55 + .../IStore.sol/IStoreEphemeral.abi.json.d.ts | 56 + .../world/abi/IStore.sol/IStoreRead.abi.json | 200 +++ .../abi/IStore.sol/IStoreRead.abi.json.d.ts | 201 +++ .../world/abi/IStore.sol/IStoreWrite.abi.json | 265 ++++ .../abi/IStore.sol/IStoreWrite.abi.json.d.ts | 266 ++++ .../abi/IStoreHook.sol/IStoreHook.abi.json | 189 +++ .../IStoreHook.sol/IStoreHook.abi.json.d.ts | 190 +++ .../KeysInTableHook.abi.json | 279 ++++ .../KeysInTableHook.abi.json.d.ts | 280 ++++ .../KeysWithValueHook.abi.json | 263 ++++ .../KeysWithValueHook.abi.json.d.ts | 264 ++++ .../abi/StoreCore.sol/StoreCore.abi.json | 102 ++ .../abi/StoreCore.sol/StoreCore.abi.json.d.ts | 103 ++ .../abi/StoreHook.sol/StoreHook.abi.json | 189 +++ .../abi/StoreHook.sol/StoreHook.abi.json.d.ts | 190 +++ .../abi/StoreRead.sol/StoreRead.abi.json | 242 ++++ .../abi/StoreRead.sol/StoreRead.abi.json.d.ts | 243 ++++ packages/world/abi/World.sol/World.abi.json | 820 +++++++++++ .../world/abi/World.sol/World.abi.json.d.ts | 821 +++++++++++ .../world/abi/src/IStore.sol/IStore.abi.json | 717 ++++++++++ .../abi/src/IStore.sol/IStore.abi.json.d.ts | 718 ++++++++++ .../abi/src/IStore.sol/IStoreData.abi.json | 463 +++++++ .../src/IStore.sol/IStoreData.abi.json.d.ts | 464 +++++++ .../src/IStore.sol/IStoreEphemeral.abi.json | 55 + .../IStore.sol/IStoreEphemeral.abi.json.d.ts | 56 + .../abi/src/IStore.sol/IStoreRead.abi.json | 200 +++ .../src/IStore.sol/IStoreRead.abi.json.d.ts | 201 +++ .../abi/src/IStore.sol/IStoreWrite.abi.json | 265 ++++ .../src/IStore.sol/IStoreWrite.abi.json.d.ts | 266 ++++ .../src/IStoreHook.sol/IStoreHook.abi.json | 189 +++ .../IStoreHook.sol/IStoreHook.abi.json.d.ts | 190 +++ .../abi/src/StoreCore.sol/StoreCore.abi.json | 102 ++ .../src/StoreCore.sol/StoreCore.abi.json.d.ts | 103 ++ .../abi/src/StoreHook.sol/StoreHook.abi.json | 189 +++ .../src/StoreHook.sol/StoreHook.abi.json.d.ts | 190 +++ packages/world/src/World.sol | 24 +- .../implementations/EphemeralRecordSystem.sol | 4 +- .../modules/keysintable/KeysInTableHook.sol | 69 +- .../world/src/modules/keysintable/hasKey.sol | 12 +- .../keyswithvalue/KeysWithValueHook.sol | 32 +- packages/world/test/World.t.sol | 6 +- packages/world/test/query.t.sol | 12 +- 94 files changed, 24250 insertions(+), 522 deletions(-) create mode 100644 packages/store/abi/EchoSubscriber.sol/EchoSubscriber.abi.json create mode 100644 packages/store/abi/EchoSubscriber.sol/EchoSubscriber.abi.json.d.ts create mode 100644 packages/store/abi/IStore.sol/IStore.abi.json create mode 100644 packages/store/abi/IStore.sol/IStore.abi.json.d.ts create mode 100644 packages/store/abi/IStore.sol/IStoreData.abi.json create mode 100644 packages/store/abi/IStore.sol/IStoreData.abi.json.d.ts create mode 100644 packages/store/abi/IStore.sol/IStoreEphemeral.abi.json create mode 100644 packages/store/abi/IStore.sol/IStoreEphemeral.abi.json.d.ts create mode 100644 packages/store/abi/IStore.sol/IStoreRead.abi.json create mode 100644 packages/store/abi/IStore.sol/IStoreRead.abi.json.d.ts create mode 100644 packages/store/abi/IStore.sol/IStoreWrite.abi.json create mode 100644 packages/store/abi/IStore.sol/IStoreWrite.abi.json.d.ts create mode 100644 packages/store/abi/IStoreHook.sol/IStoreHook.abi.json create mode 100644 packages/store/abi/IStoreHook.sol/IStoreHook.abi.json.d.ts create mode 100644 packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json create mode 100644 packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json.d.ts create mode 100644 packages/store/abi/StoreCore.sol/StoreCore.abi.json create mode 100644 packages/store/abi/StoreCore.sol/StoreCore.abi.json.d.ts create mode 100644 packages/store/abi/StoreHook.sol/StoreHook.abi.json create mode 100644 packages/store/abi/StoreHook.sol/StoreHook.abi.json.d.ts create mode 100644 packages/store/abi/StoreMock.sol/StoreMock.abi.json create mode 100644 packages/store/abi/StoreMock.sol/StoreMock.abi.json.d.ts create mode 100644 packages/store/abi/StoreRead.sol/StoreRead.abi.json create mode 100644 packages/store/abi/StoreRead.sol/StoreRead.abi.json.d.ts create mode 100644 packages/world/abi/CoreSystem.sol/CoreSystem.abi.json create mode 100644 packages/world/abi/CoreSystem.sol/CoreSystem.abi.json.d.ts create mode 100644 packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json create mode 100644 packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json.d.ts create mode 100644 packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json create mode 100644 packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json.d.ts create mode 100644 packages/world/abi/IStore.sol/IStore.abi.json create mode 100644 packages/world/abi/IStore.sol/IStore.abi.json.d.ts create mode 100644 packages/world/abi/IStore.sol/IStoreData.abi.json create mode 100644 packages/world/abi/IStore.sol/IStoreData.abi.json.d.ts create mode 100644 packages/world/abi/IStore.sol/IStoreEphemeral.abi.json create mode 100644 packages/world/abi/IStore.sol/IStoreEphemeral.abi.json.d.ts create mode 100644 packages/world/abi/IStore.sol/IStoreRead.abi.json create mode 100644 packages/world/abi/IStore.sol/IStoreRead.abi.json.d.ts create mode 100644 packages/world/abi/IStore.sol/IStoreWrite.abi.json create mode 100644 packages/world/abi/IStore.sol/IStoreWrite.abi.json.d.ts create mode 100644 packages/world/abi/IStoreHook.sol/IStoreHook.abi.json create mode 100644 packages/world/abi/IStoreHook.sol/IStoreHook.abi.json.d.ts create mode 100644 packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json create mode 100644 packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json.d.ts create mode 100644 packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json create mode 100644 packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json.d.ts create mode 100644 packages/world/abi/StoreCore.sol/StoreCore.abi.json create mode 100644 packages/world/abi/StoreCore.sol/StoreCore.abi.json.d.ts create mode 100644 packages/world/abi/StoreHook.sol/StoreHook.abi.json create mode 100644 packages/world/abi/StoreHook.sol/StoreHook.abi.json.d.ts create mode 100644 packages/world/abi/StoreRead.sol/StoreRead.abi.json create mode 100644 packages/world/abi/StoreRead.sol/StoreRead.abi.json.d.ts create mode 100644 packages/world/abi/World.sol/World.abi.json create mode 100644 packages/world/abi/World.sol/World.abi.json.d.ts create mode 100644 packages/world/abi/src/IStore.sol/IStore.abi.json create mode 100644 packages/world/abi/src/IStore.sol/IStore.abi.json.d.ts create mode 100644 packages/world/abi/src/IStore.sol/IStoreData.abi.json create mode 100644 packages/world/abi/src/IStore.sol/IStoreData.abi.json.d.ts create mode 100644 packages/world/abi/src/IStore.sol/IStoreEphemeral.abi.json create mode 100644 packages/world/abi/src/IStore.sol/IStoreEphemeral.abi.json.d.ts create mode 100644 packages/world/abi/src/IStore.sol/IStoreRead.abi.json create mode 100644 packages/world/abi/src/IStore.sol/IStoreRead.abi.json.d.ts create mode 100644 packages/world/abi/src/IStore.sol/IStoreWrite.abi.json create mode 100644 packages/world/abi/src/IStore.sol/IStoreWrite.abi.json.d.ts create mode 100644 packages/world/abi/src/IStoreHook.sol/IStoreHook.abi.json create mode 100644 packages/world/abi/src/IStoreHook.sol/IStoreHook.abi.json.d.ts create mode 100644 packages/world/abi/src/StoreCore.sol/StoreCore.abi.json create mode 100644 packages/world/abi/src/StoreCore.sol/StoreCore.abi.json.d.ts create mode 100644 packages/world/abi/src/StoreHook.sol/StoreHook.abi.json create mode 100644 packages/world/abi/src/StoreHook.sol/StoreHook.abi.json.d.ts diff --git a/docs/pages/store/advanced-features.mdx b/docs/pages/store/advanced-features.mdx index 6784d64b7b..c04efbdaa7 100644 --- a/docs/pages/store/advanced-features.mdx +++ b/docs/pages/store/advanced-features.mdx @@ -89,19 +89,19 @@ contract MirrorSubscriber is IStoreHook { _tableId = tableId; } - function onSetRecord(bytes32 tableId, bytes32[] memory key, bytes memory data) public { + function onSetRecord(bytes32 tableId, bytes32[] memory keyTuple, bytes memory data) public { if (_tableId != tableId) revert("invalid tableId"); - StoreSwitch.setRecord(indexerTableId, key, data); + StoreSwitch.setRecord(indexerTableId, keyTuple, data); } - function onSetField(bytes32 tableId, bytes32[] memory key, uint8 schemaIndex, bytes memory data) public { + function onSetField(bytes32 tableId, bytes32[] memory keyTuple, uint8 schemaIndex, bytes memory data) public { if (_tableId != tableId) revert("invalid tableId"); - StoreSwitch.setField(indexerTableId, key, schemaIndex, data); + StoreSwitch.setField(indexerTableId, keyTuple, schemaIndex, data); } - function onDeleteRecord(bytes32 tableId, bytes32[] memory key) public { + function onDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple) public { if (_tableId != tableId) revert("invalid tableId"); - StoreSwitch.deleteRecord(indexerTableId, key); + StoreSwitch.deleteRecord(indexerTableId, keyTuple); } } ``` diff --git a/docs/pages/store/reading-and-writing.mdx b/docs/pages/store/reading-and-writing.mdx index a2471147c2..e8bebae0c1 100644 --- a/docs/pages/store/reading-and-writing.mdx +++ b/docs/pages/store/reading-and-writing.mdx @@ -40,56 +40,56 @@ uint256[2] memory barArray; barArray[0] = 69; barArray[1] = 85; fooArray[0] = 42; -// args: key, foo, bar, fooArray, staticArray -MyTable.set(keccak256("some.key"), 45, false, fooArray, barArray); +// args: keyTuple, foo, bar, fooArray, staticArray +MyTable.set(keccak256("some.keyTuple"), 45, false, fooArray, barArray); ``` **Setting a field** ```solidity // Setting foo -MyTable.setFoo(keccak256("some.key"), 33); +MyTable.setFoo(keccak256("some.keyTuple"), 33); // Setting bar -MyTable.setBar(keccak256("some.key"), false); +MyTable.setBar(keccak256("some.keyTuple"), false); // Setting fooArray uint256[] memory fooArray = new uint256[](3); fooArray[0] = 42; fooArray[1] = 15; fooArray[2] = 3; -MyTable.setFooArray(keccak256("some.key"), fooArray); +MyTable.setFooArray(keccak256("some.keyTuple"), fooArray); ``` **Operations on dynamic arrays** ```solidity -MyTable.pushFooArray(keccak256("some.key"), 4242); // adds 4242 at end of fooArray -MyTable.popFooArray(keccak256("some.key")); // pop fooArray -MyTable.setItemFooArray(keccak256("some.key"), 0, 123); // set fooArray[0] to 123 +MyTable.pushFooArray(keccak256("some.keyTuple"), 4242); // adds 4242 at end of fooArray +MyTable.popFooArray(keccak256("some.keyTuple")); // pop fooArray +MyTable.setItemFooArray(keccak256("some.keyTuple"), 0, 123); // set fooArray[0] to 123 ``` **Retrieving a record** ```solidity // Retrieving a record -MyTable.get(keccak256("some.key")); +MyTable.get(keccak256("some.keyTuple")); ``` **Retrieving a field** ```solidity // Retrieve foo -MyTable.getFoo(keccak256("some.key")); +MyTable.getFoo(keccak256("some.keyTuple")); // Retrieve bar -MyTable.getBar(keccak256("some.key")); +MyTable.getBar(keccak256("some.keyTuple")); // Retrieve an element of fooArray -MyTable.getItemFooArray(keccak256("some.key"), 0); // get fooArray[0] +MyTable.getItemFooArray(keccak256("some.keyTuple"), 0); // get fooArray[0] ``` **Deleting a record** ```solidity // Deleting a record -MyTable.deleteRecord(keccak256("some.key")); +MyTable.deleteRecord(keccak256("some.keyTuple")); ``` ### Access to Store via low-level API @@ -120,10 +120,10 @@ tables: { uint256 tableId = uint256(keccak256("MyTable")); uint256 foo = 10; uint256 bar = 24; -bytes32[] memory key = new bytes32[](1); -key[0] = keccak256("some.key"); +bytes32[] memory keyTuple = new bytes32[](1); +keyTuple[0] = keccak256("some.keyTuple"); // Setting a record -StoreSwitch.setRecord(tableId, key, abi.encodePacked((foo, bar))); +StoreSwitch.setRecord(tableId, keyTuple, abi.encodePacked((foo, bar))); ``` **Setting a field** @@ -132,23 +132,23 @@ StoreSwitch.setRecord(tableId, key, abi.encodePacked((foo, bar))); uint256 tableId = uint256(keccak256("MyTable")); uint256 foo = 45; uint256 foo = 67; -bytes32[] memory key = new bytes32[](1); -key[0] = keccak256("some.key"); +bytes32[] memory keyTuple = new bytes32[](1); +keyTuple[0] = keccak256("some.keyTuple"); // Setting foo -StoreSwitch.setField(tableId, key, 0, abi.encodePacked((foo))); +StoreSwitch.setField(tableId, keyTuple, 0, abi.encodePacked((foo))); // Setting bar -StoreSwitch.setField(tableId, key, 1, abi.encodePacked((bar))); +StoreSwitch.setField(tableId, keyTuple, 1, abi.encodePacked((bar))); ``` **Retrieving a record** ```solidity uint256 tableId = uint256(keccak256("MyTable")); -bytes32[] memory key = new bytes32[](1); -key[0] = keccak256("some.key"); +bytes32[] memory keyTuple = new bytes32[](1); +keyTuple[0] = keccak256("some.keyTuple"); // Retrieve a record Schema valueSchema = SchemaLib.encode(SchemaType.UINT256, SchemaType.UINT256); -bytes memory loadedData = StoreCore.getRecord(tableId, key, valueSchema); +bytes memory loadedData = StoreCore.getRecord(tableId, keyTuple, valueSchema); uint256 foo = (uint256(Bytes.slice4(loadedData, 0))); uint256 bar = (uint256(Bytes.slice4(loadedData, 32))); ``` @@ -157,13 +157,13 @@ uint256 bar = (uint256(Bytes.slice4(loadedData, 32))); ```solidity uint256 tableId = uint256(keccak256("MyTable")); -bytes32[] memory key = new bytes32[](1); -key[0] = keccak256("some.key"); +bytes32[] memory keyTuple = new bytes32[](1); +keyTuple[0] = keccak256("some.keyTuple"); // Retrieve foo -bytes memory loadedDatafoo = StoreCore.getField(tableId, key, 0); +bytes memory loadedDatafoo = StoreCore.getField(tableId, keyTuple, 0); int32 foo = (uint32(Bytes.slice4(loadedDatafoo, 0))); // Retrieve bar -bytes memory loadedDatabar = StoreCore.getField(tableId, key, 1); +bytes memory loadedDatabar = StoreCore.getField(tableId, keyTuple, 1); int32 bar = (uint32(Bytes.slice4(loadedData, 0))); ``` @@ -171,8 +171,8 @@ int32 bar = (uint32(Bytes.slice4(loadedData, 0))); ```solidity uint256 tableId = uint256(keccak256("MyTable")); -bytes32[] memory key = new bytes32[](1); -key[0] = keccak256("some.key"); +bytes32[] memory keyTuple = new bytes32[](1); +keyTuple[0] = keccak256("some.keyTuple"); // Deleting a record -StoreCore.deleteRecord(tableId, key); +StoreCore.deleteRecord(tableId, keyTuple); ``` diff --git a/docs/pages/store/spec.mdx b/docs/pages/store/spec.mdx index cda5631000..41456d460a 100644 --- a/docs/pages/store/spec.mdx +++ b/docs/pages/store/spec.mdx @@ -7,9 +7,9 @@ import { Aside } from "../../components/Aside"; When a record or a single field is edited, or when a record is deleted, Store emits a standard event with enough information for off-chain actors to reconstruct the new version of the Store with event-sourcing. ```solidity -event StoreSetRecord(uint256 tableId, bytes32[] key, bytes data); -event StoreSetField(uint256 tableId, bytes32[] key, uint8 schemaIndex, bytes data); -event StoreDeleteRecord(uint256 tableId, bytes32[] key); +event StoreSetRecord(uint256 tableId, bytes32[] keyTuple, bytes data); +event StoreSetField(uint256 tableId, bytes32[] keyTuple, uint8 schemaIndex, bytes data); +event StoreDeleteRecord(uint256 tableId, bytes32[] keyTuple); ``` Each event includes the table ID and each key encoded as `bytes32`. diff --git a/docs/pages/world/modules.mdx b/docs/pages/world/modules.mdx index 5ae80689bb..f47a0a128f 100644 --- a/docs/pages/world/modules.mdx +++ b/docs/pages/world/modules.mdx @@ -48,7 +48,7 @@ For example, it can be used to fetch all keys in the "Position" table (if the ta It offers two methods: - `getKeysInTable(bytes32 tableId)` returns all keys in a table -- `hasKey(bytes32 tableId, bytes32[] memory key)` returns whether a given key is in a table (with O(1) gas) +- `hasKey(bytes32 tableId, bytes32[] memory keyTuple)` returns whether a given keyTuple is in a table (with O(1) gas) Using `getKeysInTable` to retrieve all keys in the Player table: @@ -62,7 +62,7 @@ import { Player, PlayerTableId } from "../codegen/tables/Player.sol"; bytes32[][] memory players = getKeysInTable(world, PlayerTableId); ``` -Using `hasKey` to check if a key is in the Player table: +Using `hasKey` to check if a keyTuple is in the Player table: ```solidity // assumes a boolean flag indicates a player: @@ -79,7 +79,7 @@ bool memory isPlayer = hasKey(world, PlayerTableId, keyTuple); Internally, it works by installing a [hook](https://v2.mud.dev/store/advanced-features#storage-hooks) that maintains: - an array of all keys in the table -- an index or "**reverse mapping**" of whether a given key is in the table +- an index or "**reverse mapping**" of whether a given keyTuple is in the table #### **`KeysWithValueModule`** diff --git a/packages/block-logs-stream/README.md b/packages/block-logs-stream/README.md index 692c02423f..14691644a6 100644 --- a/packages/block-logs-stream/README.md +++ b/packages/block-logs-stream/README.md @@ -26,10 +26,10 @@ latestBlockNumber$ publicClient, address, events: parseAbi([ - "event StoreDeleteRecord(bytes32 tableId, bytes32[] key)", - "event StoreSetField(bytes32 tableId, bytes32[] key, uint8 schemaIndex, bytes data)", - "event StoreSetRecord(bytes32 tableId, bytes32[] key, bytes data)", - "event StoreEphemeralRecord(bytes32 tableId, bytes32[] key, bytes data)", + "event StoreDeleteRecord(bytes32 tableId, bytes32[] keyTuple)", + "event StoreSetField(bytes32 tableId, bytes32[] keyTuple, uint8 schemaIndex, bytes data)", + "event StoreSetRecord(bytes32 tableId, bytes32[] keyTuple, bytes data)", + "event StoreEphemeralRecord(bytes32 tableId, bytes32[] keyTuple, bytes data)", ]), }), mergeMap(({ logs }) => from(groupLogsByBlockNumber(logs))) diff --git a/packages/store/abi/EchoSubscriber.sol/EchoSubscriber.abi.json b/packages/store/abi/EchoSubscriber.sol/EchoSubscriber.abi.json new file mode 100644 index 0000000000..e63888908d --- /dev/null +++ b/packages/store/abi/EchoSubscriber.sol/EchoSubscriber.abi.json @@ -0,0 +1,202 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "HookCalled", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/EchoSubscriber.sol/EchoSubscriber.abi.json.d.ts b/packages/store/abi/EchoSubscriber.sol/EchoSubscriber.abi.json.d.ts new file mode 100644 index 0000000000..dacb0ff8c4 --- /dev/null +++ b/packages/store/abi/EchoSubscriber.sol/EchoSubscriber.abi.json.d.ts @@ -0,0 +1,203 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + name: "HookCalled"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/IStore.sol/IStore.abi.json b/packages/store/abi/IStore.sol/IStore.abi.json new file mode 100644 index 0000000000..974e2e74fa --- /dev/null +++ b/packages/store/abi/IStore.sol/IStore.abi.json @@ -0,0 +1,717 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_DataIndexOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidFieldNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidKeyNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidValueSchemaLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotImplemented", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "enabledHooksBitmap", + "type": "uint8" + } + ], + "name": "registerStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + }, + { + "internalType": "string[]", + "name": "keyNames", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "fieldNames", + "type": "string[]" + } + ], + "name": "registerTable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + } + ], + "name": "unregisterStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStore.abi.json.d.ts b/packages/store/abi/IStore.sol/IStore.abi.json.d.ts new file mode 100644 index 0000000000..e939bc04ed --- /dev/null +++ b/packages/store/abi/IStore.sol/IStore.abi.json.d.ts @@ -0,0 +1,718 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_DataIndexOverflow"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidFieldNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidKeyNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidValueSchemaLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotImplemented"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableAlreadyExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableNotFound"; + type: "error"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + }, + { + internalType: "uint8"; + name: "enabledHooksBitmap"; + type: "uint8"; + } + ]; + name: "registerStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + }, + { + internalType: "string[]"; + name: "keyNames"; + type: "string[]"; + }, + { + internalType: "string[]"; + name: "fieldNames"; + type: "string[]"; + } + ]; + name: "registerTable"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + } + ]; + name: "unregisterStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/IStore.sol/IStoreData.abi.json b/packages/store/abi/IStore.sol/IStoreData.abi.json new file mode 100644 index 0000000000..f6db946f1c --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreData.abi.json @@ -0,0 +1,463 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStoreData.abi.json.d.ts b/packages/store/abi/IStore.sol/IStoreData.abi.json.d.ts new file mode 100644 index 0000000000..077b246517 --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreData.abi.json.d.ts @@ -0,0 +1,464 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/IStore.sol/IStoreEphemeral.abi.json b/packages/store/abi/IStore.sol/IStoreEphemeral.abi.json new file mode 100644 index 0000000000..f591aa2757 --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreEphemeral.abi.json @@ -0,0 +1,55 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStoreEphemeral.abi.json.d.ts b/packages/store/abi/IStore.sol/IStoreEphemeral.abi.json.d.ts new file mode 100644 index 0000000000..9b9186d587 --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreEphemeral.abi.json.d.ts @@ -0,0 +1,56 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/IStore.sol/IStoreRead.abi.json b/packages/store/abi/IStore.sol/IStoreRead.abi.json new file mode 100644 index 0000000000..5fb8e1bc53 --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreRead.abi.json @@ -0,0 +1,200 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStoreRead.abi.json.d.ts b/packages/store/abi/IStore.sol/IStoreRead.abi.json.d.ts new file mode 100644 index 0000000000..9ca275d41b --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreRead.abi.json.d.ts @@ -0,0 +1,201 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/IStore.sol/IStoreWrite.abi.json b/packages/store/abi/IStore.sol/IStoreWrite.abi.json new file mode 100644 index 0000000000..352fb8196a --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreWrite.abi.json @@ -0,0 +1,265 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/IStore.sol/IStoreWrite.abi.json.d.ts b/packages/store/abi/IStore.sol/IStoreWrite.abi.json.d.ts new file mode 100644 index 0000000000..04ce5d76ab --- /dev/null +++ b/packages/store/abi/IStore.sol/IStoreWrite.abi.json.d.ts @@ -0,0 +1,266 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/IStoreHook.sol/IStoreHook.abi.json b/packages/store/abi/IStoreHook.sol/IStoreHook.abi.json new file mode 100644 index 0000000000..9782a97c93 --- /dev/null +++ b/packages/store/abi/IStoreHook.sol/IStoreHook.abi.json @@ -0,0 +1,189 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/IStoreHook.sol/IStoreHook.abi.json.d.ts b/packages/store/abi/IStoreHook.sol/IStoreHook.abi.json.d.ts new file mode 100644 index 0000000000..d3e9224ef8 --- /dev/null +++ b/packages/store/abi/IStoreHook.sol/IStoreHook.abi.json.d.ts @@ -0,0 +1,190 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceID"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "view"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json new file mode 100644 index 0000000000..750e79f3bb --- /dev/null +++ b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json @@ -0,0 +1,294 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + }, + { + "internalType": "string[]", + "name": "keyNames", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "fieldNames", + "type": "string[]" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "PackedCounter_InvalidLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "Slice_OutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json.d.ts b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json.d.ts new file mode 100644 index 0000000000..6bd3d612aa --- /dev/null +++ b/packages/store/abi/MirrorSubscriber.sol/MirrorSubscriber.abi.json.d.ts @@ -0,0 +1,295 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + }, + { + internalType: "string[]"; + name: "keyNames"; + type: "string[]"; + }, + { + internalType: "string[]"; + name: "fieldNames"; + type: "string[]"; + } + ]; + stateMutability: "nonpayable"; + type: "constructor"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "PackedCounter_InvalidLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "Slice_OutOfBounds"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: ""; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: ""; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: ""; + type: "uint8"; + }, + { + internalType: "bytes"; + name: ""; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: ""; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/StoreCore.sol/StoreCore.abi.json b/packages/store/abi/StoreCore.sol/StoreCore.abi.json new file mode 100644 index 0000000000..3808909d9a --- /dev/null +++ b/packages/store/abi/StoreCore.sol/StoreCore.abi.json @@ -0,0 +1,102 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "fieldIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + } +] \ No newline at end of file diff --git a/packages/store/abi/StoreCore.sol/StoreCore.abi.json.d.ts b/packages/store/abi/StoreCore.sol/StoreCore.abi.json.d.ts new file mode 100644 index 0000000000..fa9de440d1 --- /dev/null +++ b/packages/store/abi/StoreCore.sol/StoreCore.abi.json.d.ts @@ -0,0 +1,103 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "fieldIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + } +]; +export default abi; diff --git a/packages/store/abi/StoreHook.sol/StoreHook.abi.json b/packages/store/abi/StoreHook.sol/StoreHook.abi.json new file mode 100644 index 0000000000..59ef8376aa --- /dev/null +++ b/packages/store/abi/StoreHook.sol/StoreHook.abi.json @@ -0,0 +1,189 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StoreHook.sol/StoreHook.abi.json.d.ts b/packages/store/abi/StoreHook.sol/StoreHook.abi.json.d.ts new file mode 100644 index 0000000000..4091c781ed --- /dev/null +++ b/packages/store/abi/StoreHook.sol/StoreHook.abi.json.d.ts @@ -0,0 +1,190 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/StoreMock.sol/StoreMock.abi.json b/packages/store/abi/StoreMock.sol/StoreMock.abi.json new file mode 100644 index 0000000000..7cd7dccb82 --- /dev/null +++ b/packages/store/abi/StoreMock.sol/StoreMock.abi.json @@ -0,0 +1,791 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "PackedCounter_InvalidLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "SchemaLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "SchemaLib_StaticTypeAfterDynamicType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "Slice_OutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_DataIndexOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidFieldNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidKeyNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidValueSchemaLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotImplemented", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "enabledHooksBitmap", + "type": "uint8" + } + ], + "name": "registerStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + }, + { + "internalType": "string[]", + "name": "keyNames", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "fieldNames", + "type": "string[]" + } + ], + "name": "registerTable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + } + ], + "name": "unregisterStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StoreMock.sol/StoreMock.abi.json.d.ts b/packages/store/abi/StoreMock.sol/StoreMock.abi.json.d.ts new file mode 100644 index 0000000000..0f24437cb3 --- /dev/null +++ b/packages/store/abi/StoreMock.sol/StoreMock.abi.json.d.ts @@ -0,0 +1,792 @@ +declare const abi: [ + { + inputs: []; + stateMutability: "nonpayable"; + type: "constructor"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "PackedCounter_InvalidLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "SchemaLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "SchemaLib_StaticTypeAfterDynamicType"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "Slice_OutOfBounds"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_DataIndexOverflow"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidFieldNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidKeyNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidValueSchemaLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotImplemented"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableAlreadyExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableNotFound"; + type: "error"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + }, + { + internalType: "uint8"; + name: "enabledHooksBitmap"; + type: "uint8"; + } + ]; + name: "registerStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + }, + { + internalType: "string[]"; + name: "keyNames"; + type: "string[]"; + }, + { + internalType: "string[]"; + name: "fieldNames"; + type: "string[]"; + } + ]; + name: "registerTable"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + } + ]; + name: "unregisterStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/abi/StoreRead.sol/StoreRead.abi.json b/packages/store/abi/StoreRead.sol/StoreRead.abi.json new file mode 100644 index 0000000000..7ac3c66a02 --- /dev/null +++ b/packages/store/abi/StoreRead.sol/StoreRead.abi.json @@ -0,0 +1,242 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/store/abi/StoreRead.sol/StoreRead.abi.json.d.ts b/packages/store/abi/StoreRead.sol/StoreRead.abi.json.d.ts new file mode 100644 index 0000000000..8a28178333 --- /dev/null +++ b/packages/store/abi/StoreRead.sol/StoreRead.abi.json.d.ts @@ -0,0 +1,243 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + } +]; +export default abi; diff --git a/packages/store/src/IStore.sol b/packages/store/src/IStore.sol index 86031f0c32..68df303f9e 100644 --- a/packages/store/src/IStore.sol +++ b/packages/store/src/IStore.sol @@ -16,14 +16,14 @@ interface IStoreRead { // Get full record (including full array) function getRecord( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, FieldLayout fieldLayout ) external view returns (bytes memory data); // Get partial data at schema index function getField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, FieldLayout fieldLayout ) external view returns (bytes memory data); @@ -31,7 +31,7 @@ interface IStoreRead { // Get field length at schema index function getFieldLength( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout ) external view returns (uint256); @@ -39,7 +39,7 @@ interface IStoreRead { // Get start:end slice of the field at schema index function getFieldSlice( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout, uint256 start, @@ -48,17 +48,22 @@ interface IStoreRead { } interface IStoreWrite { - event StoreSetRecord(bytes32 tableId, bytes32[] key, bytes data); - event StoreSetField(bytes32 tableId, bytes32[] key, uint8 schemaIndex, bytes data); - event StoreDeleteRecord(bytes32 tableId, bytes32[] key); + event StoreSetRecord(bytes32 tableId, bytes32[] keyTuple, bytes data); + event StoreSetField(bytes32 tableId, bytes32[] keyTuple, uint8 schemaIndex, bytes data); + event StoreDeleteRecord(bytes32 tableId, bytes32[] keyTuple); // Set full record (including full dynamic data) - function setRecord(bytes32 tableId, bytes32[] calldata key, bytes calldata data, FieldLayout fieldLayout) external; + function setRecord( + bytes32 tableId, + bytes32[] calldata keyTuple, + bytes calldata data, + FieldLayout fieldLayout + ) external; // Set partial data at schema index function setField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, bytes calldata data, FieldLayout fieldLayout @@ -67,7 +72,7 @@ interface IStoreWrite { // Push encoded items to the dynamic field at schema index function pushToField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, bytes calldata dataToPush, FieldLayout fieldLayout @@ -76,7 +81,7 @@ interface IStoreWrite { // Pop byte length from the dynamic field at schema index function popFromField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, uint256 byteLengthToPop, FieldLayout fieldLayout @@ -85,7 +90,7 @@ interface IStoreWrite { // Change encoded items within the dynamic field at schema index function updateInField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, uint256 startByteIndex, bytes calldata dataToSet, @@ -93,16 +98,16 @@ interface IStoreWrite { ) external; // Set full record (including full dynamic data) - function deleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) external; + function deleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) external; } interface IStoreEphemeral { - event StoreEphemeralRecord(bytes32 tableId, bytes32[] key, bytes data); + event StoreEphemeralRecord(bytes32 tableId, bytes32[] keyTuple, bytes data); // Emit the ephemeral event without modifying storage function emitEphemeralRecord( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, bytes calldata data, FieldLayout fieldLayout ) external; diff --git a/packages/store/src/IStoreHook.sol b/packages/store/src/IStoreHook.sol index dd75547967..fa65ff4cff 100644 --- a/packages/store/src/IStoreHook.sol +++ b/packages/store/src/IStoreHook.sol @@ -16,16 +16,21 @@ bytes4 constant STORE_HOOK_INTERFACE_ID = IStoreHook.onBeforeSetRecord.selector interface IStoreHook is IERC165 { function onBeforeSetRecord( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, bytes memory data, FieldLayout fieldLayout ) external; - function onAfterSetRecord(bytes32 tableId, bytes32[] memory key, bytes memory data, FieldLayout fieldLayout) external; + function onAfterSetRecord( + bytes32 tableId, + bytes32[] memory keyTuple, + bytes memory data, + FieldLayout fieldLayout + ) external; function onBeforeSetField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, bytes memory data, FieldLayout fieldLayout @@ -33,13 +38,13 @@ interface IStoreHook is IERC165 { function onAfterSetField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, bytes memory data, FieldLayout fieldLayout ) external; - function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) external; + function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) external; - function onAfterDeleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) external; + function onAfterDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) external; } diff --git a/packages/store/src/StoreCore.sol b/packages/store/src/StoreCore.sol index 112ab25a0f..c21a87125d 100644 --- a/packages/store/src/StoreCore.sol +++ b/packages/store/src/StoreCore.sol @@ -17,10 +17,10 @@ import { StoreHookLib, StoreHookType } from "./StoreHook.sol"; library StoreCore { // note: the preimage of the tuple of keys used to index is part of the event, so it can be used by indexers - event StoreSetRecord(bytes32 tableId, bytes32[] key, bytes data); - event StoreSetField(bytes32 tableId, bytes32[] key, uint8 fieldIndex, bytes data); - event StoreDeleteRecord(bytes32 tableId, bytes32[] key); - event StoreEphemeralRecord(bytes32 tableId, bytes32[] key, bytes data); + event StoreSetRecord(bytes32 tableId, bytes32[] keyTuple, bytes data); + event StoreSetField(bytes32 tableId, bytes32[] keyTuple, uint8 fieldIndex, bytes data); + event StoreDeleteRecord(bytes32 tableId, bytes32[] keyTuple); + event StoreEphemeralRecord(bytes32 tableId, bytes32[] keyTuple, bytes data); /** * Intialize the store address to use in StoreSwitch. @@ -89,7 +89,7 @@ library StoreCore { } /** - * Register a new table with key field layout, value field layout, key names, and value names + * Register a new table the given config */ function registerTable( bytes32 tableId, @@ -164,7 +164,7 @@ library StoreCore { /** * Set full data record for the given tableId and key tuple and field layout */ - function setRecord(bytes32 tableId, bytes32[] memory key, bytes memory data, FieldLayout fieldLayout) internal { + function setRecord(bytes32 tableId, bytes32[] memory keyTuple, bytes memory data, FieldLayout fieldLayout) internal { // verify the value has the correct length for the tableId (based on the tableId's field layout) // to prevent invalid data from being stored @@ -172,19 +172,19 @@ library StoreCore { (uint256 staticLength, PackedCounter dynamicLength) = StoreCoreInternal._validateDataLength(fieldLayout, data); // Emit event to notify indexers - emit StoreSetRecord(tableId, key, data); + emit StoreSetRecord(tableId, keyTuple, data); // Call onBeforeSetRecord hooks (before actually modifying the state, so observers have access to the previous state if needed) bytes21[] memory hooks = StoreHooks.get(tableId); for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.BEFORE_SET_RECORD))) { - IStoreHook(hook.getAddress()).onBeforeSetRecord(tableId, key, data, fieldLayout); + IStoreHook(hook.getAddress()).onBeforeSetRecord(tableId, keyTuple, data, fieldLayout); } } // Store the static data at the static data location - uint256 staticDataLocation = StoreCoreInternal._getStaticDataLocation(tableId, key); + uint256 staticDataLocation = StoreCoreInternal._getStaticDataLocation(tableId, keyTuple); uint256 memoryPointer = Memory.dataPointer(data); Storage.store({ storagePointer: staticDataLocation, @@ -197,14 +197,14 @@ library StoreCore { // Set the dynamic data if there are dynamic fields if (fieldLayout.numDynamicFields() > 0) { // Store the dynamic data length at the dynamic data length location - uint256 dynamicDataLengthLocation = StoreCoreInternal._getDynamicDataLengthLocation(tableId, key); + uint256 dynamicDataLengthLocation = StoreCoreInternal._getDynamicDataLengthLocation(tableId, keyTuple); Storage.store({ storagePointer: dynamicDataLengthLocation, data: dynamicLength.unwrap() }); // For every dynamic element, slice off the dynamic data and store it at the dynamic location uint256 dynamicDataLocation; uint256 dynamicDataLength; for (uint8 i; i < fieldLayout.numDynamicFields(); ) { - dynamicDataLocation = StoreCoreInternal._getDynamicDataLocation(tableId, key, i); + dynamicDataLocation = StoreCoreInternal._getDynamicDataLocation(tableId, keyTuple, i); dynamicDataLength = dynamicLength.atIndex(i); Storage.store({ storagePointer: dynamicDataLocation, @@ -223,7 +223,7 @@ library StoreCore { for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.AFTER_SET_RECORD))) { - IStoreHook(hook.getAddress()).onAfterSetRecord(tableId, key, data, fieldLayout); + IStoreHook(hook.getAddress()).onAfterSetRecord(tableId, keyTuple, data, fieldLayout); } } } @@ -233,34 +233,34 @@ library StoreCore { */ function setField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, bytes memory data, FieldLayout fieldLayout ) internal { // Emit event to notify indexers - emit StoreSetField(tableId, key, schemaIndex, data); + emit StoreSetField(tableId, keyTuple, schemaIndex, data); // Call onBeforeSetField hooks (before modifying the state) bytes21[] memory hooks = StoreHooks.get(tableId); for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.BEFORE_SET_FIELD))) { - IStoreHook(hook.getAddress()).onBeforeSetField(tableId, key, schemaIndex, data, fieldLayout); + IStoreHook(hook.getAddress()).onBeforeSetField(tableId, keyTuple, schemaIndex, data, fieldLayout); } } if (schemaIndex < fieldLayout.numStaticFields()) { - StoreCoreInternal._setStaticField(tableId, key, fieldLayout, schemaIndex, data); + StoreCoreInternal._setStaticField(tableId, keyTuple, fieldLayout, schemaIndex, data); } else { - StoreCoreInternal._setDynamicField(tableId, key, fieldLayout, schemaIndex, data); + StoreCoreInternal._setDynamicField(tableId, keyTuple, fieldLayout, schemaIndex, data); } // Call onAfterSetField hooks (after modifying the state) for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.AFTER_SET_FIELD))) { - IStoreHook(hook.getAddress()).onAfterSetField(tableId, key, schemaIndex, data, fieldLayout); + IStoreHook(hook.getAddress()).onAfterSetField(tableId, keyTuple, schemaIndex, data, fieldLayout); } } } @@ -268,26 +268,26 @@ library StoreCore { /** * Delete a record for the given tableId, key tuple and value field layout */ - function deleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) internal { + function deleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) internal { // Emit event to notify indexers - emit StoreDeleteRecord(tableId, key); + emit StoreDeleteRecord(tableId, keyTuple); // Call onBeforeDeleteRecord hooks (before actually modifying the state, so observers have access to the previous state if needed) bytes21[] memory hooks = StoreHooks.get(tableId); for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.BEFORE_DELETE_RECORD))) { - IStoreHook(hook.getAddress()).onBeforeDeleteRecord(tableId, key, fieldLayout); + IStoreHook(hook.getAddress()).onBeforeDeleteRecord(tableId, keyTuple, fieldLayout); } } // Delete static data - uint256 staticDataLocation = StoreCoreInternal._getStaticDataLocation(tableId, key); + uint256 staticDataLocation = StoreCoreInternal._getStaticDataLocation(tableId, keyTuple); Storage.store({ storagePointer: staticDataLocation, offset: 0, data: new bytes(fieldLayout.staticDataLength()) }); // If there are dynamic fields, delete the dynamic data length if (fieldLayout.numDynamicFields() > 0) { - uint256 dynamicDataLengthLocation = StoreCoreInternal._getDynamicDataLengthLocation(tableId, key); + uint256 dynamicDataLengthLocation = StoreCoreInternal._getDynamicDataLengthLocation(tableId, keyTuple); Storage.store({ storagePointer: dynamicDataLengthLocation, data: bytes32(0) }); } @@ -295,17 +295,17 @@ library StoreCore { for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.AFTER_DELETE_RECORD))) { - IStoreHook(hook.getAddress()).onAfterDeleteRecord(tableId, key, fieldLayout); + IStoreHook(hook.getAddress()).onAfterDeleteRecord(tableId, keyTuple, fieldLayout); } } } /** - * Push data to a field in a table with the given tableId, key tuple and value field layout + * Push data to a field in a table with the given tableId, keyTuple tuple and value field layout */ function pushToField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, bytes memory dataToPush, FieldLayout fieldLayout @@ -316,29 +316,29 @@ library StoreCore { // TODO add push-specific event and hook to avoid the storage read? (https://github.com/latticexyz/mud/issues/444) bytes memory fullData = abi.encodePacked( - StoreCoreInternal._getDynamicField(tableId, key, schemaIndex, fieldLayout), + StoreCoreInternal._getDynamicField(tableId, keyTuple, schemaIndex, fieldLayout), dataToPush ); // Emit event to notify indexers - emit StoreSetField(tableId, key, schemaIndex, fullData); + emit StoreSetField(tableId, keyTuple, schemaIndex, fullData); // Call onBeforeSetField hooks (before modifying the state) bytes21[] memory hooks = StoreHooks.get(tableId); for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.BEFORE_SET_FIELD))) { - IStoreHook(hook.getAddress()).onBeforeSetField(tableId, key, schemaIndex, fullData, fieldLayout); + IStoreHook(hook.getAddress()).onBeforeSetField(tableId, keyTuple, schemaIndex, fullData, fieldLayout); } } - StoreCoreInternal._pushToDynamicField(tableId, key, fieldLayout, schemaIndex, dataToPush); + StoreCoreInternal._pushToDynamicField(tableId, keyTuple, fieldLayout, schemaIndex, dataToPush); // Call onAfterSetField hooks (after modifying the state) for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.AFTER_SET_FIELD))) { - IStoreHook(hook.getAddress()).onAfterSetField(tableId, key, schemaIndex, fullData, fieldLayout); + IStoreHook(hook.getAddress()).onAfterSetField(tableId, keyTuple, schemaIndex, fullData, fieldLayout); } } } @@ -348,7 +348,7 @@ library StoreCore { */ function popFromField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, uint256 byteLengthToPop, FieldLayout fieldLayout @@ -360,29 +360,29 @@ library StoreCore { // TODO add pop-specific event and hook to avoid the storage read? (https://github.com/latticexyz/mud/issues/444) bytes memory fullData; { - bytes memory oldData = StoreCoreInternal._getDynamicField(tableId, key, schemaIndex, fieldLayout); + bytes memory oldData = StoreCoreInternal._getDynamicField(tableId, keyTuple, schemaIndex, fieldLayout); fullData = SliceLib.getSubslice(oldData, 0, oldData.length - byteLengthToPop).toBytes(); } // Emit event to notify indexers - emit StoreSetField(tableId, key, schemaIndex, fullData); + emit StoreSetField(tableId, keyTuple, schemaIndex, fullData); // Call onBeforeSetField hooks (before modifying the state) bytes21[] memory hooks = StoreHooks.get(tableId); for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.BEFORE_SET_FIELD))) { - IStoreHook(hook.getAddress()).onBeforeSetField(tableId, key, schemaIndex, fullData, fieldLayout); + IStoreHook(hook.getAddress()).onBeforeSetField(tableId, keyTuple, schemaIndex, fullData, fieldLayout); } } - StoreCoreInternal._popFromDynamicField(tableId, key, fieldLayout, schemaIndex, byteLengthToPop); + StoreCoreInternal._popFromDynamicField(tableId, keyTuple, fieldLayout, schemaIndex, byteLengthToPop); // Call onAfterSetField hooks (after modifying the state) for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.AFTER_SET_FIELD))) { - IStoreHook(hook.getAddress()).onAfterSetField(tableId, key, schemaIndex, fullData, fieldLayout); + IStoreHook(hook.getAddress()).onAfterSetField(tableId, keyTuple, schemaIndex, fullData, fieldLayout); } } } @@ -392,7 +392,7 @@ library StoreCore { */ function updateInField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, uint256 startByteIndex, bytes memory dataToSet, @@ -410,7 +410,7 @@ library StoreCore { // TODO add setItem-specific event and hook to avoid the storage read? (https://github.com/latticexyz/mud/issues/444) bytes memory fullData; { - bytes memory oldData = StoreCoreInternal._getDynamicField(tableId, key, schemaIndex, fieldLayout); + bytes memory oldData = StoreCoreInternal._getDynamicField(tableId, keyTuple, schemaIndex, fieldLayout); fullData = abi.encodePacked( SliceLib.getSubslice(oldData, 0, startByteIndex).toBytes(), dataToSet, @@ -419,24 +419,24 @@ library StoreCore { } // Emit event to notify indexers - emit StoreSetField(tableId, key, schemaIndex, fullData); + emit StoreSetField(tableId, keyTuple, schemaIndex, fullData); // Call onBeforeSetField hooks (before modifying the state) bytes21[] memory hooks = StoreHooks.get(tableId); for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.BEFORE_SET_FIELD))) { - IStoreHook(hook.getAddress()).onBeforeSetField(tableId, key, schemaIndex, fullData, fieldLayout); + IStoreHook(hook.getAddress()).onBeforeSetField(tableId, keyTuple, schemaIndex, fullData, fieldLayout); } } - StoreCoreInternal._setDynamicFieldItem(tableId, key, fieldLayout, schemaIndex, startByteIndex, dataToSet); + StoreCoreInternal._setDynamicFieldItem(tableId, keyTuple, fieldLayout, schemaIndex, startByteIndex, dataToSet); // Call onAfterSetField hooks (after modifying the state) for (uint256 i; i < hooks.length; i++) { Hook hook = Hook.wrap(hooks[i]); if (hook.isEnabled(uint8(StoreHookType.AFTER_SET_FIELD))) { - IStoreHook(hook.getAddress()).onAfterSetField(tableId, key, schemaIndex, fullData, fieldLayout); + IStoreHook(hook.getAddress()).onAfterSetField(tableId, keyTuple, schemaIndex, fullData, fieldLayout); } } } @@ -452,7 +452,7 @@ library StoreCore { */ function emitEphemeralRecord( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, bytes memory data, FieldLayout fieldLayout ) internal { @@ -460,7 +460,7 @@ library StoreCore { StoreCoreInternal._validateDataLength(fieldLayout, data); // Emit event to notify indexers - emit StoreEphemeralRecord(tableId, key, data); + emit StoreEphemeralRecord(tableId, keyTuple, data); } /************************************************************************ @@ -474,7 +474,7 @@ library StoreCore { */ function getRecord( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, FieldLayout fieldLayout ) internal view returns (bytes memory) { // Get the static data length @@ -485,7 +485,7 @@ library StoreCore { PackedCounter dynamicDataLength; uint256 numDynamicFields = fieldLayout.numDynamicFields(); if (numDynamicFields > 0) { - dynamicDataLength = StoreCoreInternal._loadEncodedDynamicDataLength(tableId, key); + dynamicDataLength = StoreCoreInternal._loadEncodedDynamicDataLength(tableId, keyTuple); // TODO should total output include dynamic data length even if it's 0? if (dynamicDataLength.total() > 0) { outputLength += 32 + dynamicDataLength.total(); // encoded length + data @@ -497,7 +497,7 @@ library StoreCore { uint256 memoryPointer = Memory.dataPointer(data); // Load the static data from storage - StoreCoreInternal._getStaticData(tableId, key, staticLength, memoryPointer); + StoreCoreInternal._getStaticData(tableId, keyTuple, staticLength, memoryPointer); // Early return if there are no dynamic fields if (dynamicDataLength.total() == 0) return data; @@ -513,7 +513,7 @@ library StoreCore { // Append dynamic data for (uint8 i; i < numDynamicFields; i++) { - uint256 dynamicDataLocation = StoreCoreInternal._getDynamicDataLocation(tableId, key, i); + uint256 dynamicDataLocation = StoreCoreInternal._getDynamicDataLocation(tableId, keyTuple, i); uint256 length = dynamicDataLength.atIndex(i); Storage.load({ storagePointer: dynamicDataLocation, length: length, offset: 0, memoryPointer: memoryPointer }); // Advance memoryPointer by the length of this dynamic field @@ -529,14 +529,14 @@ library StoreCore { */ function getField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout ) internal view returns (bytes memory) { if (schemaIndex < fieldLayout.numStaticFields()) { - return StoreCoreInternal._getStaticField(tableId, key, schemaIndex, fieldLayout); + return StoreCoreInternal._getStaticField(tableId, keyTuple, schemaIndex, fieldLayout); } else { - return StoreCoreInternal._getDynamicField(tableId, key, schemaIndex, fieldLayout); + return StoreCoreInternal._getDynamicField(tableId, keyTuple, schemaIndex, fieldLayout); } } @@ -545,7 +545,7 @@ library StoreCore { */ function getFieldLength( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout ) internal view returns (uint256) { @@ -555,7 +555,7 @@ library StoreCore { } else { // Get the length and storage location of the dynamic field uint8 dynamicFieldLayoutIndex = schemaIndex - numStaticFields; - return StoreCoreInternal._loadEncodedDynamicDataLength(tableId, key).atIndex(dynamicFieldLayoutIndex); + return StoreCoreInternal._loadEncodedDynamicDataLength(tableId, keyTuple).atIndex(dynamicFieldLayoutIndex); } } @@ -565,7 +565,7 @@ library StoreCore { */ function getFieldSlice( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout, uint256 start, @@ -578,7 +578,7 @@ library StoreCore { // Get the length and storage location of the dynamic field uint8 dynamicSchemaIndex = schemaIndex - numStaticFields; - uint256 location = StoreCoreInternal._getDynamicDataLocation(tableId, key, dynamicSchemaIndex); + uint256 location = StoreCoreInternal._getDynamicDataLocation(tableId, keyTuple, dynamicSchemaIndex); return Storage.load({ storagePointer: location, length: end - start, offset: start }); } @@ -595,7 +595,7 @@ library StoreCoreInternal { function _setStaticField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, FieldLayout fieldLayout, uint8 schemaIndex, bytes memory data @@ -607,14 +607,14 @@ library StoreCoreInternal { } // Store the provided value in storage - uint256 location = _getStaticDataLocation(tableId, key); + uint256 location = _getStaticDataLocation(tableId, keyTuple); uint256 offset = _getStaticDataOffset(fieldLayout, schemaIndex); Storage.store({ storagePointer: location, offset: offset, data: data }); } function _setDynamicField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, FieldLayout fieldLayout, uint8 schemaIndex, bytes memory data @@ -622,16 +622,16 @@ library StoreCoreInternal { uint8 dynamicSchemaIndex = schemaIndex - uint8(fieldLayout.numStaticFields()); // Update the dynamic data length - _setDynamicDataLengthAtIndex(tableId, key, dynamicSchemaIndex, data.length); + _setDynamicDataLengthAtIndex(tableId, keyTuple, dynamicSchemaIndex, data.length); // Store the provided value in storage - uint256 dynamicDataLocation = _getDynamicDataLocation(tableId, key, dynamicSchemaIndex); + uint256 dynamicDataLocation = _getDynamicDataLocation(tableId, keyTuple, dynamicSchemaIndex); Storage.store({ storagePointer: dynamicDataLocation, offset: 0, data: data }); } function _pushToDynamicField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, FieldLayout fieldLayout, uint8 schemaIndex, bytes memory dataToPush @@ -639,7 +639,7 @@ library StoreCoreInternal { uint8 dynamicSchemaIndex = schemaIndex - uint8(fieldLayout.numStaticFields()); // Load dynamic data length from storage - uint256 dynamicDataLengthSlot = _getDynamicDataLengthLocation(tableId, key); + uint256 dynamicDataLengthSlot = _getDynamicDataLengthLocation(tableId, keyTuple); PackedCounter encodedLengths = PackedCounter.wrap(Storage.load({ storagePointer: dynamicDataLengthSlot })); // Update the encoded length @@ -650,12 +650,12 @@ library StoreCoreInternal { Storage.store({ storagePointer: dynamicDataLengthSlot, data: encodedLengths.unwrap() }); // Append `dataToPush` to the end of the data in storage - _setPartialDynamicData(tableId, key, dynamicSchemaIndex, oldFieldLength, dataToPush); + _setPartialDynamicData(tableId, keyTuple, dynamicSchemaIndex, oldFieldLength, dataToPush); } function _popFromDynamicField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, FieldLayout fieldLayout, uint8 schemaIndex, uint256 byteLengthToPop @@ -663,7 +663,7 @@ library StoreCoreInternal { uint8 dynamicSchemaIndex = schemaIndex - uint8(fieldLayout.numStaticFields()); // Load dynamic data length from storage - uint256 dynamicDataLengthSlot = _getDynamicDataLengthLocation(tableId, key); + uint256 dynamicDataLengthSlot = _getDynamicDataLengthLocation(tableId, keyTuple); PackedCounter encodedLengths = PackedCounter.wrap(Storage.load({ storagePointer: dynamicDataLengthSlot })); // Update the encoded length @@ -679,7 +679,7 @@ library StoreCoreInternal { // startOffset is measured in bytes function _setDynamicFieldItem( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, FieldLayout fieldLayout, uint8 schemaIndex, uint256 startByteIndex, @@ -688,7 +688,7 @@ library StoreCoreInternal { uint8 dynamicSchemaIndex = schemaIndex - uint8(fieldLayout.numStaticFields()); // Set `dataToSet` at the given index - _setPartialDynamicData(tableId, key, dynamicSchemaIndex, startByteIndex, dataToSet); + _setPartialDynamicData(tableId, keyTuple, dynamicSchemaIndex, startByteIndex, dataToSet); } /************************************************************************ @@ -700,11 +700,16 @@ library StoreCoreInternal { /** * Get full static data for the given tableId and key tuple, with the given static length */ - function _getStaticData(bytes32 tableId, bytes32[] memory key, uint256 length, uint256 memoryPointer) internal view { + function _getStaticData( + bytes32 tableId, + bytes32[] memory keyTuple, + uint256 length, + uint256 memoryPointer + ) internal view { if (length == 0) return; // Load the data from storage - uint256 location = _getStaticDataLocation(tableId, key); + uint256 location = _getStaticDataLocation(tableId, keyTuple); Storage.load({ storagePointer: location, length: length, offset: 0, memoryPointer: memoryPointer }); } @@ -713,13 +718,13 @@ library StoreCoreInternal { */ function _getStaticField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout ) internal view returns (bytes memory) { // Get the length, storage location and offset of the static field uint256 staticByteLength = fieldLayout.atIndex(schemaIndex); - uint256 location = _getStaticDataLocation(tableId, key); + uint256 location = _getStaticDataLocation(tableId, keyTuple); uint256 offset = _getStaticDataOffset(fieldLayout, schemaIndex); // Load the data from storage @@ -732,14 +737,14 @@ library StoreCoreInternal { */ function _getDynamicField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout ) internal view returns (bytes memory) { // Get the length and storage location of the dynamic field uint8 dynamicSchemaIndex = schemaIndex - uint8(fieldLayout.numStaticFields()); - uint256 location = _getDynamicDataLocation(tableId, key, dynamicSchemaIndex); - uint256 dataLength = _loadEncodedDynamicDataLength(tableId, key).atIndex(dynamicSchemaIndex); + uint256 location = _getDynamicDataLocation(tableId, keyTuple, dynamicSchemaIndex); + uint256 dataLength = _loadEncodedDynamicDataLength(tableId, keyTuple).atIndex(dynamicSchemaIndex); return Storage.load({ storagePointer: location, length: dataLength, offset: 0 }); } @@ -779,8 +784,8 @@ library StoreCoreInternal { /** * Compute the storage location based on tableId id and index tuple */ - function _getStaticDataLocation(bytes32 tableId, bytes32[] memory key) internal pure returns (uint256) { - return uint256(keccak256(abi.encode(SLOT, tableId, key))); + function _getStaticDataLocation(bytes32 tableId, bytes32[] memory keyTuple) internal pure returns (uint256) { + return uint256(keccak256(abi.encode(SLOT, tableId, keyTuple))); } /** @@ -803,25 +808,28 @@ library StoreCoreInternal { */ function _getDynamicDataLocation( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex ) internal pure returns (uint256) { - return uint256(keccak256(abi.encode(SLOT, tableId, key, schemaIndex))); + return uint256(keccak256(abi.encode(SLOT, tableId, keyTuple, schemaIndex))); } /** * Compute the storage location for the length of the dynamic data */ - function _getDynamicDataLengthLocation(bytes32 tableId, bytes32[] memory key) internal pure returns (uint256) { - return uint256(keccak256(abi.encode(SLOT, tableId, key, "length"))); + function _getDynamicDataLengthLocation(bytes32 tableId, bytes32[] memory keyTuple) internal pure returns (uint256) { + return uint256(keccak256(abi.encode(SLOT, tableId, keyTuple, "length"))); } /** * Get the length of the dynamic data for the given value field layout and index */ - function _loadEncodedDynamicDataLength(bytes32 tableId, bytes32[] memory key) internal view returns (PackedCounter) { + function _loadEncodedDynamicDataLength( + bytes32 tableId, + bytes32[] memory keyTuple + ) internal view returns (PackedCounter) { // Load dynamic data length from storage - uint256 dynamicDataLengthSlot = _getDynamicDataLengthLocation(tableId, key); + uint256 dynamicDataLengthSlot = _getDynamicDataLengthLocation(tableId, keyTuple); return PackedCounter.wrap(Storage.load({ storagePointer: dynamicDataLengthSlot })); } @@ -830,12 +838,12 @@ library StoreCoreInternal { */ function _setDynamicDataLengthAtIndex( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 dynamicSchemaIndex, // schemaIndex - numStaticFields uint256 newLengthAtIndex ) internal { // Load dynamic data length from storage - uint256 dynamicDataLengthSlot = _getDynamicDataLengthLocation(tableId, key); + uint256 dynamicDataLengthSlot = _getDynamicDataLengthLocation(tableId, keyTuple); PackedCounter encodedLengths = PackedCounter.wrap(Storage.load({ storagePointer: dynamicDataLengthSlot })); // Update the encoded lengths @@ -850,12 +858,12 @@ library StoreCoreInternal { */ function _setPartialDynamicData( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 dynamicSchemaIndex, uint256 startByteIndex, bytes memory partialData ) internal { - uint256 dynamicDataLocation = _getDynamicDataLocation(tableId, key, dynamicSchemaIndex); + uint256 dynamicDataLocation = _getDynamicDataLocation(tableId, keyTuple, dynamicSchemaIndex); // start index is in bytes, whereas storage slots are in 32-byte words dynamicDataLocation += startByteIndex / 32; // partial storage slot offset (there is no inherent offset, as each dynamic field starts at its own storage slot) diff --git a/packages/store/src/StoreRead.sol b/packages/store/src/StoreRead.sol index a4c35672b9..ced24eb297 100644 --- a/packages/store/src/StoreRead.sol +++ b/packages/store/src/StoreRead.sol @@ -22,39 +22,39 @@ contract StoreRead is IStoreRead { // Get full record (static and dynamic data) function getRecord( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, FieldLayout fieldLayout ) public view virtual returns (bytes memory data) { - data = StoreCore.getRecord(tableId, key, fieldLayout); + data = StoreCore.getRecord(tableId, keyTuple, fieldLayout); } // Get partial data at schema index function getField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, FieldLayout fieldLayout ) public view virtual returns (bytes memory data) { - data = StoreCore.getField(tableId, key, schemaIndex, fieldLayout); + data = StoreCore.getField(tableId, keyTuple, schemaIndex, fieldLayout); } function getFieldLength( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout ) public view virtual returns (uint256) { - return StoreCore.getFieldLength(tableId, key, schemaIndex, fieldLayout); + return StoreCore.getFieldLength(tableId, keyTuple, schemaIndex, fieldLayout); } function getFieldSlice( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, FieldLayout fieldLayout, uint256 start, uint256 end ) public view virtual returns (bytes memory) { - return StoreCore.getFieldSlice(tableId, key, schemaIndex, fieldLayout, start, end); + return StoreCore.getFieldSlice(tableId, keyTuple, schemaIndex, fieldLayout, start, end); } } diff --git a/packages/store/src/StoreSwitch.sol b/packages/store/src/StoreSwitch.sol index 86ddb3b22e..86aa1e311d 100644 --- a/packages/store/src/StoreSwitch.sol +++ b/packages/store/src/StoreSwitch.sol @@ -107,63 +107,63 @@ library StoreSwitch { } } - function setRecord(bytes32 tableId, bytes32[] memory key, bytes memory data, FieldLayout fieldLayout) internal { + function setRecord(bytes32 tableId, bytes32[] memory keyTuple, bytes memory data, FieldLayout fieldLayout) internal { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); } else { - IStore(_storeAddress).setRecord(tableId, key, data, fieldLayout); + IStore(_storeAddress).setRecord(tableId, keyTuple, data, fieldLayout); } } function setField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 fieldIndex, bytes memory data, FieldLayout fieldLayout ) internal { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - StoreCore.setField(tableId, key, fieldIndex, data, fieldLayout); + StoreCore.setField(tableId, keyTuple, fieldIndex, data, fieldLayout); } else { - IStore(_storeAddress).setField(tableId, key, fieldIndex, data, fieldLayout); + IStore(_storeAddress).setField(tableId, keyTuple, fieldIndex, data, fieldLayout); } } function pushToField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 fieldIndex, bytes memory dataToPush, FieldLayout fieldLayout ) internal { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - StoreCore.pushToField(tableId, key, fieldIndex, dataToPush, fieldLayout); + StoreCore.pushToField(tableId, keyTuple, fieldIndex, dataToPush, fieldLayout); } else { - IStore(_storeAddress).pushToField(tableId, key, fieldIndex, dataToPush, fieldLayout); + IStore(_storeAddress).pushToField(tableId, keyTuple, fieldIndex, dataToPush, fieldLayout); } } function popFromField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 fieldIndex, uint256 byteLengthToPop, FieldLayout fieldLayout ) internal { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - StoreCore.popFromField(tableId, key, fieldIndex, byteLengthToPop, fieldLayout); + StoreCore.popFromField(tableId, keyTuple, fieldIndex, byteLengthToPop, fieldLayout); } else { - IStore(_storeAddress).popFromField(tableId, key, fieldIndex, byteLengthToPop, fieldLayout); + IStore(_storeAddress).popFromField(tableId, keyTuple, fieldIndex, byteLengthToPop, fieldLayout); } } function updateInField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 fieldIndex, uint256 startByteIndex, bytes memory dataToSet, @@ -171,79 +171,79 @@ library StoreSwitch { ) internal { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - StoreCore.updateInField(tableId, key, fieldIndex, startByteIndex, dataToSet, fieldLayout); + StoreCore.updateInField(tableId, keyTuple, fieldIndex, startByteIndex, dataToSet, fieldLayout); } else { - IStore(_storeAddress).updateInField(tableId, key, fieldIndex, startByteIndex, dataToSet, fieldLayout); + IStore(_storeAddress).updateInField(tableId, keyTuple, fieldIndex, startByteIndex, dataToSet, fieldLayout); } } - function deleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) internal { + function deleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) internal { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - StoreCore.deleteRecord(tableId, key, fieldLayout); + StoreCore.deleteRecord(tableId, keyTuple, fieldLayout); } else { - IStore(_storeAddress).deleteRecord(tableId, key, fieldLayout); + IStore(_storeAddress).deleteRecord(tableId, keyTuple, fieldLayout); } } function emitEphemeralRecord( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, bytes memory data, FieldLayout fieldLayout ) internal { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - StoreCore.emitEphemeralRecord(tableId, key, data, fieldLayout); + StoreCore.emitEphemeralRecord(tableId, keyTuple, data, fieldLayout); } else { - IStore(_storeAddress).emitEphemeralRecord(tableId, key, data, fieldLayout); + IStore(_storeAddress).emitEphemeralRecord(tableId, keyTuple, data, fieldLayout); } } function getRecord( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, FieldLayout fieldLayout ) internal view returns (bytes memory) { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - return StoreCore.getRecord(tableId, key, fieldLayout); + return StoreCore.getRecord(tableId, keyTuple, fieldLayout); } else { - return IStore(_storeAddress).getRecord(tableId, key, fieldLayout); + return IStore(_storeAddress).getRecord(tableId, keyTuple, fieldLayout); } } function getField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 fieldIndex, FieldLayout fieldLayout ) internal view returns (bytes memory) { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - return StoreCore.getField(tableId, key, fieldIndex, fieldLayout); + return StoreCore.getField(tableId, keyTuple, fieldIndex, fieldLayout); } else { - return IStore(_storeAddress).getField(tableId, key, fieldIndex, fieldLayout); + return IStore(_storeAddress).getField(tableId, keyTuple, fieldIndex, fieldLayout); } } function getFieldLength( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 fieldIndex, FieldLayout fieldLayout ) internal view returns (uint256) { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - return StoreCore.getFieldLength(tableId, key, fieldIndex, fieldLayout); + return StoreCore.getFieldLength(tableId, keyTuple, fieldIndex, fieldLayout); } else { - return IStore(_storeAddress).getFieldLength(tableId, key, fieldIndex, fieldLayout); + return IStore(_storeAddress).getFieldLength(tableId, keyTuple, fieldIndex, fieldLayout); } } function getFieldSlice( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 fieldIndex, FieldLayout fieldLayout, uint256 start, @@ -251,9 +251,9 @@ library StoreSwitch { ) internal view returns (bytes memory) { address _storeAddress = getStoreAddress(); if (_storeAddress == address(this)) { - return StoreCore.getFieldSlice(tableId, key, fieldIndex, fieldLayout, start, end); + return StoreCore.getFieldSlice(tableId, keyTuple, fieldIndex, fieldLayout, start, end); } else { - return IStore(_storeAddress).getFieldSlice(tableId, key, fieldIndex, fieldLayout, start, end); + return IStore(_storeAddress).getFieldSlice(tableId, keyTuple, fieldIndex, fieldLayout, start, end); } } } diff --git a/packages/store/test/EchoSubscriber.sol b/packages/store/test/EchoSubscriber.sol index b9e23c6b41..505502dcde 100644 --- a/packages/store/test/EchoSubscriber.sol +++ b/packages/store/test/EchoSubscriber.sol @@ -7,39 +7,49 @@ import { StoreHook } from "../src/StoreHook.sol"; contract EchoSubscriber is StoreHook { event HookCalled(bytes); - function onBeforeSetRecord(bytes32 tableId, bytes32[] memory key, bytes memory data, FieldLayout fieldLayout) public { - emit HookCalled(abi.encode(tableId, key, data, fieldLayout)); + function onBeforeSetRecord( + bytes32 tableId, + bytes32[] memory keyTuple, + bytes memory data, + FieldLayout fieldLayout + ) public { + emit HookCalled(abi.encode(tableId, keyTuple, data, fieldLayout)); } - function onAfterSetRecord(bytes32 tableId, bytes32[] memory key, bytes memory data, FieldLayout fieldLayout) public { - emit HookCalled(abi.encode(tableId, key, data, fieldLayout)); + function onAfterSetRecord( + bytes32 tableId, + bytes32[] memory keyTuple, + bytes memory data, + FieldLayout fieldLayout + ) public { + emit HookCalled(abi.encode(tableId, keyTuple, data, fieldLayout)); } function onBeforeSetField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, bytes memory data, FieldLayout fieldLayout ) public { - emit HookCalled(abi.encode(tableId, key, schemaIndex, data, fieldLayout)); + emit HookCalled(abi.encode(tableId, keyTuple, schemaIndex, data, fieldLayout)); } function onAfterSetField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, bytes memory data, FieldLayout fieldLayout ) public { - emit HookCalled(abi.encode(tableId, key, schemaIndex, data, fieldLayout)); + emit HookCalled(abi.encode(tableId, keyTuple, schemaIndex, data, fieldLayout)); } - function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) public { - emit HookCalled(abi.encode(tableId, key, fieldLayout)); + function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) public { + emit HookCalled(abi.encode(tableId, keyTuple, fieldLayout)); } - function onAfterDeleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) public { - emit HookCalled(abi.encode(tableId, key, fieldLayout)); + function onAfterDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) public { + emit HookCalled(abi.encode(tableId, keyTuple, fieldLayout)); } } diff --git a/packages/store/test/MirrorSubscriber.sol b/packages/store/test/MirrorSubscriber.sol index d30b615679..34d6179682 100644 --- a/packages/store/test/MirrorSubscriber.sol +++ b/packages/store/test/MirrorSubscriber.sol @@ -24,36 +24,46 @@ contract MirrorSubscriber is StoreHook { _tableId = tableId; } - function onBeforeSetRecord(bytes32 tableId, bytes32[] memory key, bytes memory data, FieldLayout fieldLayout) public { + function onBeforeSetRecord( + bytes32 tableId, + bytes32[] memory keyTuple, + bytes memory data, + FieldLayout fieldLayout + ) public { if (tableId != tableId) revert("invalid tableId"); - StoreSwitch.setRecord(indexerTableId, key, data, fieldLayout); + StoreSwitch.setRecord(indexerTableId, keyTuple, data, fieldLayout); } - function onAfterSetRecord(bytes32 tableId, bytes32[] memory key, bytes memory data, FieldLayout fieldLayout) public { + function onAfterSetRecord( + bytes32 tableId, + bytes32[] memory keyTuple, + bytes memory data, + FieldLayout fieldLayout + ) public { // NOOP } function onBeforeSetField( bytes32 tableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8 schemaIndex, bytes memory data, FieldLayout fieldLayout ) public { if (tableId != tableId) revert("invalid tableId"); - StoreSwitch.setField(indexerTableId, key, schemaIndex, data, fieldLayout); + StoreSwitch.setField(indexerTableId, keyTuple, schemaIndex, data, fieldLayout); } function onAfterSetField(bytes32, bytes32[] memory, uint8, bytes memory, FieldLayout) public { // NOOP } - function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) public { + function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) public { if (tableId != tableId) revert("invalid tableId"); - StoreSwitch.deleteRecord(indexerTableId, key, fieldLayout); + StoreSwitch.deleteRecord(indexerTableId, keyTuple, fieldLayout); } - function onAfterDeleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) public { + function onAfterDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) public { // NOOP } } diff --git a/packages/store/test/StoreCore.t.sol b/packages/store/test/StoreCore.t.sol index 2737f417f2..8599ff755b 100644 --- a/packages/store/test/StoreCore.t.sol +++ b/packages/store/test/StoreCore.t.sol @@ -58,12 +58,12 @@ contract StoreCoreTest is Test, StoreMock { bytes32 tableId = keccak256("some.tableId"); // Expect a StoreSetRecord event to be emitted - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32(tableId); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32(tableId); vm.expectEmit(true, true, true, true); emit StoreSetRecord( TablesTableId, - key, + keyTuple, Tables.encode( fieldLayout.unwrap(), keySchema.unwrap(), @@ -91,7 +91,7 @@ contract StoreCoreTest is Test, StoreMock { IStore(this).registerTable( keccak256("tableId"), FieldLayout.wrap(keccak256("random bytes as value field layout")), - Schema.wrap(keccak256("random bytes as key schema")), + Schema.wrap(keccak256("random bytes as keyTuple schema")), Schema.wrap(keccak256("random bytes as value schema")), keyNames, fieldNames @@ -160,7 +160,7 @@ contract StoreCoreTest is Test, StoreMock { string[] memory fourNames = new string[](4); string[] memory oneName = new string[](1); - // Register tableId with invalid key names + // Register tableId with invalid keyTuple names vm.expectRevert(abi.encodeWithSelector(IStoreErrors.StoreCore_InvalidKeyNamesLength.selector, 4, 1)); IStore(this).registerTable(tableId, fieldLayout, keySchema, valueSchema, oneName, oneName); @@ -184,30 +184,30 @@ contract StoreCoreTest is Test, StoreMock { // Register tableId IStore(this).registerTable(tableId, fieldLayout, defaultKeySchema, valueSchema, new string[](1), new string[](5)); - // Create some key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some key"); + // Create some keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some keyTuple"); // Set dynamic data length of dynamic index 0 - StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, key, 0, 10); + StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, keyTuple, 0, 10); - PackedCounter encodedLength = StoreCoreInternal._loadEncodedDynamicDataLength(tableId, key); + PackedCounter encodedLength = StoreCoreInternal._loadEncodedDynamicDataLength(tableId, keyTuple); assertEq(encodedLength.atIndex(0), 10); assertEq(encodedLength.atIndex(1), 0); assertEq(encodedLength.total(), 10); // Set dynamic data length of dynamic index 1 - StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, key, 1, 99); + StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, keyTuple, 1, 99); - encodedLength = StoreCoreInternal._loadEncodedDynamicDataLength(tableId, key); + encodedLength = StoreCoreInternal._loadEncodedDynamicDataLength(tableId, keyTuple); assertEq(encodedLength.atIndex(0), 10); assertEq(encodedLength.atIndex(1), 99); assertEq(encodedLength.total(), 109); // Reduce dynamic data length of dynamic index 0 again - StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, key, 0, 5); + StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, keyTuple, 0, 5); - encodedLength = StoreCoreInternal._loadEncodedDynamicDataLength(tableId, key); + encodedLength = StoreCoreInternal._loadEncodedDynamicDataLength(tableId, keyTuple); assertEq(encodedLength.atIndex(0), 5); assertEq(encodedLength.atIndex(1), 99); assertEq(encodedLength.total(), 104); @@ -229,17 +229,17 @@ contract StoreCoreTest is Test, StoreMock { // Set data bytes memory data = abi.encodePacked(bytes1(0x01), bytes2(0x0203), bytes1(0x04), bytes2(0x0506)); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some.key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some.keyTuple"); // Expect a StoreSetRecord event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetRecord(tableId, key, data); + emit StoreSetRecord(tableId, keyTuple, data); - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); // Get data - bytes memory loadedData = IStore(this).getRecord(tableId, key, fieldLayout); + bytes memory loadedData = IStore(this).getRecord(tableId, keyTuple, fieldLayout); assertTrue(Bytes.equals(data, loadedData)); } @@ -259,11 +259,11 @@ contract StoreCoreTest is Test, StoreMock { // Set data bytes memory data = abi.encodePacked(bytes1(0x01), bytes2(0x0203), bytes1(0x04)); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some.key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some.keyTuple"); // This should fail because the data is not 6 bytes long - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); } function testSetAndGetStaticDataSpanningWords() public { @@ -279,17 +279,17 @@ contract StoreCoreTest is Test, StoreMock { bytes32(0x1112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f30) ); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some.key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some.keyTuple"); // Expect a StoreSetRecord event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetRecord(tableId, key, data); + emit StoreSetRecord(tableId, keyTuple, data); - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); // Get data - bytes memory loadedData = IStore(this).getRecord(tableId, key, fieldLayout); + bytes memory loadedData = IStore(this).getRecord(tableId, keyTuple, fieldLayout); assertTrue(Bytes.equals(data, loadedData)); } @@ -338,19 +338,19 @@ contract StoreCoreTest is Test, StoreMock { thirdDataBytes ); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); // Expect a StoreSetRecord event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetRecord(tableId, key, data); + emit StoreSetRecord(tableId, keyTuple, data); // Set data - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); // Get data - bytes memory loadedData = IStore(this).getRecord(tableId, key, fieldLayout); + bytes memory loadedData = IStore(this).getRecord(tableId, keyTuple, fieldLayout); assertEq(loadedData.length, data.length); assertEq(keccak256(loadedData), keccak256(data)); @@ -384,32 +384,32 @@ contract StoreCoreTest is Test, StoreMock { bytes16 firstDataBytes = bytes16(0x0102030405060708090a0b0c0d0e0f10); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); bytes memory firstDataPacked = abi.encodePacked(firstDataBytes); // Expect a StoreSetField event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetField(tableId, key, 0, firstDataPacked); + emit StoreSetField(tableId, keyTuple, 0, firstDataPacked); // Set first field - IStore(this).setField(tableId, key, 0, firstDataPacked, fieldLayout); + IStore(this).setField(tableId, keyTuple, 0, firstDataPacked, fieldLayout); //////////////// // Static data //////////////// // Get first field - bytes memory loadedData = IStore(this).getField(tableId, key, 0, fieldLayout); + bytes memory loadedData = IStore(this).getField(tableId, keyTuple, 0, fieldLayout); // Verify loaded data is correct assertEq(loadedData.length, 16); assertEq(bytes16(loadedData), bytes16(firstDataBytes)); // Verify the second index is not set yet - assertEq(uint256(bytes32(IStore(this).getField(tableId, key, 1, fieldLayout))), 0); + assertEq(uint256(bytes32(IStore(this).getField(tableId, keyTuple, 1, fieldLayout))), 0); // Set second field bytes32 secondDataBytes = keccak256("some data"); @@ -418,27 +418,27 @@ contract StoreCoreTest is Test, StoreMock { // Expect a StoreSetField event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetField(tableId, key, 1, secondDataPacked); + emit StoreSetField(tableId, keyTuple, 1, secondDataPacked); - IStore(this).setField(tableId, key, 1, secondDataPacked, fieldLayout); + IStore(this).setField(tableId, keyTuple, 1, secondDataPacked, fieldLayout); // Get second field - loadedData = IStore(this).getField(tableId, key, 1, fieldLayout); + loadedData = IStore(this).getField(tableId, keyTuple, 1, fieldLayout); // Verify loaded data is correct assertEq(loadedData.length, 32); assertEq(bytes32(loadedData), secondDataBytes); // Verify the first field didn't change - assertEq(bytes16(IStore(this).getField(tableId, key, 0, fieldLayout)), bytes16(firstDataBytes)); + assertEq(bytes16(IStore(this).getField(tableId, keyTuple, 0, fieldLayout)), bytes16(firstDataBytes)); // Verify the full static data is correct assertEq(IStore(this).getFieldLayout(tableId).staticDataLength(), 48); assertEq(IStore(this).getValueSchema(tableId).staticDataLength(), 48); - assertEq(Bytes.slice16(IStore(this).getRecord(tableId, key, fieldLayout), 0), firstDataBytes); - assertEq(Bytes.slice32(IStore(this).getRecord(tableId, key, fieldLayout), 16), secondDataBytes); + assertEq(Bytes.slice16(IStore(this).getRecord(tableId, keyTuple, fieldLayout), 0), firstDataBytes); + assertEq(Bytes.slice32(IStore(this).getRecord(tableId, keyTuple, fieldLayout), 16), secondDataBytes); assertEq( - keccak256(SliceLib.getSubslice(IStore(this).getRecord(tableId, key, fieldLayout), 0, 48).toBytes()), + keccak256(SliceLib.getSubslice(IStore(this).getRecord(tableId, keyTuple, fieldLayout), 0, 48).toBytes()), keccak256(abi.encodePacked(firstDataBytes, secondDataBytes)) ); @@ -465,13 +465,13 @@ contract StoreCoreTest is Test, StoreMock { // Expect a StoreSetField event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetField(tableId, key, 2, thirdDataBytes); + emit StoreSetField(tableId, keyTuple, 2, thirdDataBytes); // Set third field - IStore(this).setField(tableId, key, 2, thirdDataBytes, fieldLayout); + IStore(this).setField(tableId, keyTuple, 2, thirdDataBytes, fieldLayout); // Get third field - loadedData = IStore(this).getField(tableId, key, 2, fieldLayout); + loadedData = IStore(this).getField(tableId, keyTuple, 2, fieldLayout); // Verify loaded data is correct assertEq(SliceLib.fromBytes(loadedData).decodeArray_uint32().length, 2); @@ -479,21 +479,21 @@ contract StoreCoreTest is Test, StoreMock { assertEq(keccak256(loadedData), keccak256(thirdDataBytes)); // Verify the fourth field is not set yet - assertEq(IStore(this).getField(tableId, key, 3, fieldLayout).length, 0); + assertEq(IStore(this).getField(tableId, keyTuple, 3, fieldLayout).length, 0); // Verify none of the previous fields were impacted - assertEq(bytes16(IStore(this).getField(tableId, key, 0, fieldLayout)), bytes16(firstDataBytes)); - assertEq(bytes32(IStore(this).getField(tableId, key, 1, fieldLayout)), bytes32(secondDataBytes)); + assertEq(bytes16(IStore(this).getField(tableId, keyTuple, 0, fieldLayout)), bytes16(firstDataBytes)); + assertEq(bytes32(IStore(this).getField(tableId, keyTuple, 1, fieldLayout)), bytes32(secondDataBytes)); // Expect a StoreSetField event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetField(tableId, key, 3, fourthDataBytes); + emit StoreSetField(tableId, keyTuple, 3, fourthDataBytes); // Set fourth field - IStore(this).setField(tableId, key, 3, fourthDataBytes, fieldLayout); + IStore(this).setField(tableId, keyTuple, 3, fourthDataBytes, fieldLayout); // Get fourth field - loadedData = IStore(this).getField(tableId, key, 3, fieldLayout); + loadedData = IStore(this).getField(tableId, keyTuple, 3, fieldLayout); // Verify loaded data is correct assertEq(loadedData.length, fourthDataBytes.length); @@ -502,7 +502,7 @@ contract StoreCoreTest is Test, StoreMock { // Verify all fields are correct PackedCounter encodedLengths = PackedCounterLib.pack(uint40(thirdDataBytes.length), uint40(fourthDataBytes.length)); assertEq( - keccak256(IStore(this).getRecord(tableId, key, fieldLayout)), + keccak256(IStore(this).getRecord(tableId, keyTuple, fieldLayout)), keccak256( abi.encodePacked(firstDataBytes, secondDataBytes, encodedLengths.unwrap(), thirdDataBytes, fourthDataBytes) ) @@ -553,34 +553,34 @@ contract StoreCoreTest is Test, StoreMock { thirdDataBytes ); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); // Set data - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); // Get data - bytes memory loadedData = IStore(this).getRecord(tableId, key, fieldLayout); + bytes memory loadedData = IStore(this).getRecord(tableId, keyTuple, fieldLayout); assertEq(loadedData.length, data.length); assertEq(keccak256(loadedData), keccak256(data)); // Expect a StoreDeleteRecord event to be emitted vm.expectEmit(true, true, true, true); - emit StoreDeleteRecord(tableId, key); + emit StoreDeleteRecord(tableId, keyTuple); // Delete data - IStore(this).deleteRecord(tableId, key, fieldLayout); + IStore(this).deleteRecord(tableId, keyTuple, fieldLayout); // Verify data is deleted - loadedData = IStore(this).getRecord(tableId, key, fieldLayout); + loadedData = IStore(this).getRecord(tableId, keyTuple, fieldLayout); assertEq(keccak256(loadedData), keccak256(new bytes(fieldLayout.staticDataLength()))); } struct TestPushToFieldData { bytes32 tableId; - bytes32[] key; + bytes32[] keyTuple; bytes32 firstDataBytes; bytes secondDataBytes; bytes thirdDataBytes; @@ -612,9 +612,9 @@ contract StoreCoreTest is Test, StoreMock { new string[](3) ); - // Create key - data.key = new bytes32[](1); - data.key[0] = bytes32("some.key"); + // Create keyTuple + data.keyTuple = new bytes32[](1); + data.keyTuple[0] = bytes32("some.keyTuple"); // Create data data.firstDataBytes = keccak256("some data"); @@ -634,10 +634,10 @@ contract StoreCoreTest is Test, StoreMock { } // Set fields - IStore(this).setField(data.tableId, data.key, 0, abi.encodePacked(data.firstDataBytes), fieldLayout); - IStore(this).setField(data.tableId, data.key, 1, data.secondDataBytes, fieldLayout); + IStore(this).setField(data.tableId, data.keyTuple, 0, abi.encodePacked(data.firstDataBytes), fieldLayout); + IStore(this).setField(data.tableId, data.keyTuple, 1, data.secondDataBytes, fieldLayout); // Initialize a field with push - IStore(this).pushToField(data.tableId, data.key, 2, data.thirdDataBytes, fieldLayout); + IStore(this).pushToField(data.tableId, data.keyTuple, 2, data.thirdDataBytes, fieldLayout); // Create data to push { @@ -649,13 +649,13 @@ contract StoreCoreTest is Test, StoreMock { // Expect a StoreSetField event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetField(data.tableId, data.key, 1, data.newSecondDataBytes); + emit StoreSetField(data.tableId, data.keyTuple, 1, data.newSecondDataBytes); // Push to second field - IStore(this).pushToField(data.tableId, data.key, 1, data.secondDataToPush, fieldLayout); + IStore(this).pushToField(data.tableId, data.keyTuple, 1, data.secondDataToPush, fieldLayout); // Get second field - data.loadedData = IStore(this).getField(data.tableId, data.key, 1, fieldLayout); + data.loadedData = IStore(this).getField(data.tableId, data.keyTuple, 1, fieldLayout); // Verify loaded data is correct assertEq(SliceLib.fromBytes(data.loadedData).decodeArray_uint32().length, 2 + 1); @@ -663,8 +663,8 @@ contract StoreCoreTest is Test, StoreMock { assertEq(data.loadedData, data.newSecondDataBytes); // Verify none of the other fields were impacted - assertEq(bytes32(IStore(this).getField(data.tableId, data.key, 0, fieldLayout)), data.firstDataBytes); - assertEq(IStore(this).getField(data.tableId, data.key, 2, fieldLayout), data.thirdDataBytes); + assertEq(bytes32(IStore(this).getField(data.tableId, data.keyTuple, 0, fieldLayout)), data.firstDataBytes); + assertEq(IStore(this).getField(data.tableId, data.keyTuple, 2, fieldLayout), data.thirdDataBytes); // Create data to push { @@ -685,13 +685,13 @@ contract StoreCoreTest is Test, StoreMock { // Expect a StoreSetField event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetField(data.tableId, data.key, 2, data.newThirdDataBytes); + emit StoreSetField(data.tableId, data.keyTuple, 2, data.newThirdDataBytes); // Push to third field - IStore(this).pushToField(data.tableId, data.key, 2, data.thirdDataToPush, fieldLayout); + IStore(this).pushToField(data.tableId, data.keyTuple, 2, data.thirdDataToPush, fieldLayout); // Get third field - data.loadedData = IStore(this).getField(data.tableId, data.key, 2, fieldLayout); + data.loadedData = IStore(this).getField(data.tableId, data.keyTuple, 2, fieldLayout); // Verify loaded data is correct assertEq(SliceLib.fromBytes(data.loadedData).decodeArray_uint32().length, 3 + 10); @@ -699,13 +699,13 @@ contract StoreCoreTest is Test, StoreMock { assertEq(data.loadedData, data.newThirdDataBytes); // Verify none of the other fields were impacted - assertEq(bytes32(IStore(this).getField(data.tableId, data.key, 0, fieldLayout)), data.firstDataBytes); - assertEq(IStore(this).getField(data.tableId, data.key, 1, fieldLayout), data.newSecondDataBytes); + assertEq(bytes32(IStore(this).getField(data.tableId, data.keyTuple, 0, fieldLayout)), data.firstDataBytes); + assertEq(IStore(this).getField(data.tableId, data.keyTuple, 1, fieldLayout), data.newSecondDataBytes); } struct TestUpdateInFieldData { bytes32 tableId; - bytes32[] key; + bytes32[] keyTuple; bytes32 firstDataBytes; uint32[] secondData; bytes secondDataBytes; @@ -752,9 +752,9 @@ contract StoreCoreTest is Test, StoreMock { new string[](3) ); - // Create key - data.key = new bytes32[](1); - data.key[0] = bytes32("some.key"); + // Create keyTuple + data.keyTuple = new bytes32[](1); + data.keyTuple[0] = bytes32("some.keyTuple"); // Create data data.firstDataBytes = keccak256("some data"); @@ -773,9 +773,9 @@ contract StoreCoreTest is Test, StoreMock { data.thirdDataBytes = EncodeArray.encode(data.thirdData); // Set fields - IStore(this).setField(data.tableId, data.key, 0, abi.encodePacked(data.firstDataBytes), fieldLayout); - IStore(this).setField(data.tableId, data.key, 1, data.secondDataBytes, fieldLayout); - IStore(this).setField(data.tableId, data.key, 2, data.thirdDataBytes, fieldLayout); + IStore(this).setField(data.tableId, data.keyTuple, 0, abi.encodePacked(data.firstDataBytes), fieldLayout); + IStore(this).setField(data.tableId, data.keyTuple, 1, data.secondDataBytes, fieldLayout); + IStore(this).setField(data.tableId, data.keyTuple, 2, data.thirdDataBytes, fieldLayout); // Create data to use for the update { @@ -788,13 +788,13 @@ contract StoreCoreTest is Test, StoreMock { // Expect a StoreSetField event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetField(data.tableId, data.key, 1, data.newSecondDataBytes); + emit StoreSetField(data.tableId, data.keyTuple, 1, data.newSecondDataBytes); // Update index 1 in second field (4 = byte length of uint32) - IStore(this).updateInField(data.tableId, data.key, 1, 4 * 1, data.secondDataForUpdate, fieldLayout); + IStore(this).updateInField(data.tableId, data.keyTuple, 1, 4 * 1, data.secondDataForUpdate, fieldLayout); // Get second field - data.loadedData = IStore(this).getField(data.tableId, data.key, 1, fieldLayout); + data.loadedData = IStore(this).getField(data.tableId, data.keyTuple, 1, fieldLayout); // Verify loaded data is correct assertEq(SliceLib.fromBytes(data.loadedData).decodeArray_uint32().length, data.secondData.length); @@ -802,8 +802,8 @@ contract StoreCoreTest is Test, StoreMock { assertEq(data.loadedData, data.newSecondDataBytes); // Verify none of the other fields were impacted - assertEq(bytes32(IStore(this).getField(data.tableId, data.key, 0, fieldLayout)), data.firstDataBytes); - assertEq(IStore(this).getField(data.tableId, data.key, 2, fieldLayout), data.thirdDataBytes); + assertEq(bytes32(IStore(this).getField(data.tableId, data.keyTuple, 0, fieldLayout)), data.firstDataBytes); + assertEq(IStore(this).getField(data.tableId, data.keyTuple, 2, fieldLayout), data.thirdDataBytes); // Create data for update { @@ -826,13 +826,13 @@ contract StoreCoreTest is Test, StoreMock { // Expect a StoreSetField event to be emitted vm.expectEmit(true, true, true, true); - emit StoreSetField(data.tableId, data.key, 2, data.newThirdDataBytes); + emit StoreSetField(data.tableId, data.keyTuple, 2, data.newThirdDataBytes); // Update indexes 1,2,3,4 in third field (8 = byte length of uint64) - IStore(this).updateInField(data.tableId, data.key, 2, 8 * 1, data.thirdDataForUpdate, fieldLayout); + IStore(this).updateInField(data.tableId, data.keyTuple, 2, 8 * 1, data.thirdDataForUpdate, fieldLayout); // Get third field - data.loadedData = IStore(this).getField(data.tableId, data.key, 2, fieldLayout); + data.loadedData = IStore(this).getField(data.tableId, data.keyTuple, 2, fieldLayout); // Verify loaded data is correct assertEq(SliceLib.fromBytes(data.loadedData).decodeArray_uint64().length, data.thirdData.length); @@ -840,14 +840,14 @@ contract StoreCoreTest is Test, StoreMock { assertEq(data.loadedData, data.newThirdDataBytes); // Verify none of the other fields were impacted - assertEq(bytes32(IStore(this).getField(data.tableId, data.key, 0, fieldLayout)), data.firstDataBytes); - assertEq(IStore(this).getField(data.tableId, data.key, 1, fieldLayout), data.newSecondDataBytes); + assertEq(bytes32(IStore(this).getField(data.tableId, data.keyTuple, 0, fieldLayout)), data.firstDataBytes); + assertEq(IStore(this).getField(data.tableId, data.keyTuple, 1, fieldLayout), data.newSecondDataBytes); // startByteIndex must not overflow vm.expectRevert( abi.encodeWithSelector(IStoreErrors.StoreCore_DataIndexOverflow.selector, type(uint40).max, type(uint56).max) ); - IStore(this).updateInField(data.tableId, data.key, 2, type(uint56).max, data.thirdDataForUpdate, fieldLayout); + IStore(this).updateInField(data.tableId, data.keyTuple, 2, type(uint56).max, data.thirdDataForUpdate, fieldLayout); } function testAccessEmptyData() public { @@ -857,30 +857,30 @@ contract StoreCoreTest is Test, StoreMock { IStore(this).registerTable(tableId, fieldLayout, defaultKeySchema, valueSchema, new string[](1), new string[](2)); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); - bytes memory data1 = IStore(this).getRecord(tableId, key, fieldLayout); + bytes memory data1 = IStore(this).getRecord(tableId, keyTuple, fieldLayout); assertEq(data1.length, fieldLayout.staticDataLength()); - bytes memory data2 = IStore(this).getField(tableId, key, 0, fieldLayout); + bytes memory data2 = IStore(this).getField(tableId, keyTuple, 0, fieldLayout); assertEq(data2.length, fieldLayout.staticDataLength()); - bytes memory data3 = IStore(this).getField(tableId, key, 1, fieldLayout); + bytes memory data3 = IStore(this).getField(tableId, keyTuple, 1, fieldLayout); assertEq(data3.length, 0); - uint256 data3Length = IStore(this).getFieldLength(tableId, key, 1, fieldLayout); + uint256 data3Length = IStore(this).getFieldLength(tableId, keyTuple, 1, fieldLayout); assertEq(data3Length, 0); - bytes memory data3Slice = IStore(this).getFieldSlice(tableId, key, 1, fieldLayout, 0, 0); + bytes memory data3Slice = IStore(this).getFieldSlice(tableId, keyTuple, 1, fieldLayout, 0, 0); assertEq(data3Slice.length, 0); } function testRegisterHook() public { bytes32 tableId = keccak256("some.tableId"); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some keyTuple"); // Register tableId FieldLayout fieldLayout = FieldLayoutEncodeHelper.encode(16, 0); @@ -912,31 +912,31 @@ contract StoreCoreTest is Test, StoreMock { bytes memory data = abi.encodePacked(bytes16(0x0102030405060708090a0b0c0d0e0f10)); - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); // Get data from indexed tableId - the indexer should have mirrored the data there - bytes memory indexedData = IStore(this).getRecord(indexerTableId, key, fieldLayout); + bytes memory indexedData = IStore(this).getRecord(indexerTableId, keyTuple, fieldLayout); assertEq(keccak256(data), keccak256(indexedData)); data = abi.encodePacked(bytes16(0x1112131415161718191a1b1c1d1e1f20)); - IStore(this).setField(tableId, key, 0, data, fieldLayout); + IStore(this).setField(tableId, keyTuple, 0, data, fieldLayout); // Get data from indexed tableId - the indexer should have mirrored the data there - indexedData = IStore(this).getRecord(indexerTableId, key, fieldLayout); + indexedData = IStore(this).getRecord(indexerTableId, keyTuple, fieldLayout); assertEq(keccak256(data), keccak256(indexedData)); - IStore(this).deleteRecord(tableId, key, fieldLayout); + IStore(this).deleteRecord(tableId, keyTuple, fieldLayout); // Get data from indexed tableId - the indexer should have mirrored the data there - indexedData = IStore(this).getRecord(indexerTableId, key, fieldLayout); + indexedData = IStore(this).getRecord(indexerTableId, keyTuple, fieldLayout); assertEq(keccak256(indexedData), keccak256(abi.encodePacked(bytes16(0)))); } function testUnregisterHook() public { bytes32 tableId = keccak256("some.tableId"); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some keyTuple"); // Register tableId's value schema FieldLayout fieldLayout = FieldLayoutEncodeHelper.encode(16, 0); @@ -978,54 +978,54 @@ contract StoreCoreTest is Test, StoreMock { // Expect a revert when the RevertSubscriber's onBeforeSetRecord hook is called vm.expectRevert(bytes("onBeforeSetRecord")); - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); // Expect a revert when the RevertSubscriber's onBeforeSetField hook is called vm.expectRevert(bytes("onBeforeSetField")); - IStore(this).setField(tableId, key, 0, data, fieldLayout); + IStore(this).setField(tableId, keyTuple, 0, data, fieldLayout); // Expect a revert when the RevertSubscriber's onBeforeDeleteRecord hook is called vm.expectRevert(bytes("onBeforeDeleteRecord")); - IStore(this).deleteRecord(tableId, key, fieldLayout); + IStore(this).deleteRecord(tableId, keyTuple, fieldLayout); // Unregister the RevertSubscriber IStore(this).unregisterStoreHook(tableId, revertSubscriber); // Expect a HookCalled event to be emitted when the EchoSubscriber's onBeforeSetRecord hook is called vm.expectEmit(true, true, true, true); - emit HookCalled(abi.encode(tableId, key, data, fieldLayout)); + emit HookCalled(abi.encode(tableId, keyTuple, data, fieldLayout)); // Expect a HookCalled event to be emitted when the EchoSubscriber's onAfterSetRecord hook is called vm.expectEmit(true, true, true, true); - emit HookCalled(abi.encode(tableId, key, data, fieldLayout)); + emit HookCalled(abi.encode(tableId, keyTuple, data, fieldLayout)); - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); // Expect a HookCalled event to be emitted when the EchoSubscriber's onBeforeSetField hook is called vm.expectEmit(true, true, true, true); - emit HookCalled(abi.encode(tableId, key, uint8(0), data, fieldLayout)); + emit HookCalled(abi.encode(tableId, keyTuple, uint8(0), data, fieldLayout)); // Expect a HookCalled event to be emitted when the EchoSubscriber's onAfterSetField hook is called vm.expectEmit(true, true, true, true); - emit HookCalled(abi.encode(tableId, key, uint8(0), data, fieldLayout)); + emit HookCalled(abi.encode(tableId, keyTuple, uint8(0), data, fieldLayout)); - IStore(this).setField(tableId, key, 0, data, fieldLayout); + IStore(this).setField(tableId, keyTuple, 0, data, fieldLayout); // Expect a HookCalled event to be emitted when the EchoSubscriber's onBeforeDeleteRecord hook is called vm.expectEmit(true, true, true, true); - emit HookCalled(abi.encode(tableId, key, fieldLayout)); + emit HookCalled(abi.encode(tableId, keyTuple, fieldLayout)); // Expect a HookCalled event to be emitted when the EchoSubscriber's onAfterDeleteRecord hook is called vm.expectEmit(true, true, true, true); - emit HookCalled(abi.encode(tableId, key, fieldLayout)); + emit HookCalled(abi.encode(tableId, keyTuple, fieldLayout)); - IStore(this).deleteRecord(tableId, key, fieldLayout); + IStore(this).deleteRecord(tableId, keyTuple, fieldLayout); } function testHooksDynamicData() public { bytes32 tableId = keccak256("some.tableId"); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some keyTuple"); // Register tableId FieldLayout fieldLayout = FieldLayoutEncodeHelper.encode(16, 1); @@ -1063,10 +1063,10 @@ contract StoreCoreTest is Test, StoreMock { bytes memory staticData = abi.encodePacked(bytes16(0x0102030405060708090a0b0c0d0e0f10)); bytes memory data = abi.encodePacked(staticData, dynamicData); - IStore(this).setRecord(tableId, key, data, fieldLayout); + IStore(this).setRecord(tableId, keyTuple, data, fieldLayout); // Get data from indexed tableId - the indexer should have mirrored the data there - bytes memory indexedData = IStore(this).getRecord(indexerTableId, key, fieldLayout); + bytes memory indexedData = IStore(this).getRecord(indexerTableId, keyTuple, fieldLayout); assertEq(keccak256(data), keccak256(indexedData)); // Update dynamic data @@ -1075,16 +1075,16 @@ contract StoreCoreTest is Test, StoreMock { dynamicData = abi.encodePacked(encodedArrayDataLength.unwrap(), arrayDataBytes); data = abi.encodePacked(staticData, dynamicData); - IStore(this).setField(tableId, key, 1, arrayDataBytes, fieldLayout); + IStore(this).setField(tableId, keyTuple, 1, arrayDataBytes, fieldLayout); // Get data from indexed tableId - the indexer should have mirrored the data there - indexedData = IStore(this).getRecord(indexerTableId, key, fieldLayout); + indexedData = IStore(this).getRecord(indexerTableId, keyTuple, fieldLayout); assertEq(keccak256(data), keccak256(indexedData)); - IStore(this).deleteRecord(tableId, key, fieldLayout); + IStore(this).deleteRecord(tableId, keyTuple, fieldLayout); // Get data from indexed tableId - the indexer should have mirrored the data there - indexedData = IStore(this).getRecord(indexerTableId, key, fieldLayout); + indexedData = IStore(this).getRecord(indexerTableId, keyTuple, fieldLayout); assertEq(keccak256(indexedData), keccak256(abi.encodePacked(bytes16(0)))); } } diff --git a/packages/store/test/StoreCoreDynamic.t.sol b/packages/store/test/StoreCoreDynamic.t.sol index c781320cf7..3af1a9bd01 100644 --- a/packages/store/test/StoreCoreDynamic.t.sol +++ b/packages/store/test/StoreCoreDynamic.t.sol @@ -28,12 +28,12 @@ contract StoreCoreDynamicTest is Test, GasReporter, StoreMock { // Expose an external popFromField function for testing purposes of indexers (see testHooks) function popFromField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, uint256 byteLengthToPop, FieldLayout fieldLayout ) public override { - StoreCore.popFromField(tableId, key, schemaIndex, byteLengthToPop, fieldLayout); + StoreCore.popFromField(tableId, keyTuple, schemaIndex, byteLengthToPop, fieldLayout); } function setUp() public { @@ -46,7 +46,7 @@ contract StoreCoreDynamicTest is Test, GasReporter, StoreMock { ); StoreCore.registerTable(_tableId, fieldLayout, defaultKeySchema, valueSchema, new string[](1), new string[](3)); - // Create key + // Create keyTuple _key = new bytes32[](1); _key[0] = bytes32("some.key"); diff --git a/packages/store/test/StoreCoreGas.t.sol b/packages/store/test/StoreCoreGas.t.sol index 122e0127cf..6c0eedc99d 100644 --- a/packages/store/test/StoreCoreGas.t.sol +++ b/packages/store/test/StoreCoreGas.t.sol @@ -64,7 +64,7 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { StoreCore.getValueSchema(tableId); endGasReport(); - startGasReport("StoreCore: get key schema (warm)"); + startGasReport("StoreCore: get keyTuple schema (warm)"); StoreCore.getKeySchema(tableId); endGasReport(); } @@ -107,22 +107,22 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { StoreCore.registerTable(tableId, fieldLayout, defaultKeySchema, valueSchema, new string[](1), new string[](5)); // Create some key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some key"); // Set dynamic data length of dynamic index 0 startGasReport("set dynamic length of dynamic index 0"); - StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, key, 0, 10); + StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, keyTuple, 0, 10); endGasReport(); // Set dynamic data length of dynamic index 1 startGasReport("set dynamic length of dynamic index 1"); - StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, key, 1, 99); + StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, keyTuple, 1, 99); endGasReport(); // Reduce dynamic data length of dynamic index 0 again startGasReport("reduce dynamic length of dynamic index 0"); - StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, key, 0, 5); + StoreCoreInternal._setDynamicDataLengthAtIndex(tableId, keyTuple, 0, 5); endGasReport(); } @@ -140,16 +140,16 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { // Set data bytes memory data = abi.encodePacked(bytes1(0x01), bytes2(0x0203), bytes1(0x04), bytes2(0x0506)); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some.key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some.keyTuple"); startGasReport("set static record (1 slot)"); - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); endGasReport(); // Get data startGasReport("get static record (1 slot)"); - StoreCore.getRecord(tableId, key, fieldLayout); + StoreCore.getRecord(tableId, keyTuple, fieldLayout); endGasReport(); } @@ -166,16 +166,16 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { bytes32(0x1112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f30) ); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some.key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some.keyTuple"); startGasReport("set static record (2 slots)"); - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); endGasReport(); // Get data startGasReport("get static record (2 slots)"); - StoreCore.getRecord(tableId, key, fieldLayout); + StoreCore.getRecord(tableId, keyTuple, fieldLayout); endGasReport(); } @@ -223,18 +223,18 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { thirdDataBytes ); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); // Set data startGasReport("set complex record with dynamic data (4 slots)"); - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); endGasReport(); // Get data startGasReport("get complex record with dynamic data (4 slots)"); - StoreCore.getRecord(tableId, key, fieldLayout); + StoreCore.getRecord(tableId, keyTuple, fieldLayout); endGasReport(); // Compare gas - setting the data as raw struct @@ -270,15 +270,15 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { bytes16 firstDataBytes = bytes16(0x0102030405060708090a0b0c0d0e0f10); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); bytes memory firstDataPacked = abi.encodePacked(firstDataBytes); // Set first field startGasReport("set static field (1 slot)"); - StoreCore.setField(tableId, key, 0, firstDataPacked, fieldLayout); + StoreCore.setField(tableId, keyTuple, 0, firstDataPacked, fieldLayout); endGasReport(); //////////////// @@ -287,7 +287,7 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { // Get first field startGasReport("get static field (1 slot)"); - StoreCore.getField(tableId, key, 0, fieldLayout); + StoreCore.getField(tableId, keyTuple, 0, fieldLayout); endGasReport(); // Set second field @@ -295,12 +295,12 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { bytes memory secondDataPacked = abi.encodePacked(secondDataBytes); startGasReport("set static field (overlap 2 slot)"); - StoreCore.setField(tableId, key, 1, secondDataPacked, fieldLayout); + StoreCore.setField(tableId, keyTuple, 1, secondDataPacked, fieldLayout); endGasReport(); // Get second field startGasReport("get static field (overlap 2 slot)"); - StoreCore.getField(tableId, key, 1, fieldLayout); + StoreCore.getField(tableId, keyTuple, 1, fieldLayout); endGasReport(); //////////////// @@ -326,22 +326,22 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { // Set third field startGasReport("set dynamic field (1 slot, first dynamic field)"); - StoreCore.setField(tableId, key, 2, thirdDataBytes, fieldLayout); + StoreCore.setField(tableId, keyTuple, 2, thirdDataBytes, fieldLayout); endGasReport(); // Get third field startGasReport("get dynamic field (1 slot, first dynamic field)"); - StoreCore.getField(tableId, key, 2, fieldLayout); + StoreCore.getField(tableId, keyTuple, 2, fieldLayout); endGasReport(); // Set fourth field startGasReport("set dynamic field (1 slot, second dynamic field)"); - StoreCore.setField(tableId, key, 3, fourthDataBytes, fieldLayout); + StoreCore.setField(tableId, keyTuple, 3, fourthDataBytes, fieldLayout); endGasReport(); // Get fourth field startGasReport("get dynamic field (1 slot, second dynamic field)"); - StoreCore.getField(tableId, key, 3, fieldLayout); + StoreCore.getField(tableId, keyTuple, 3, fieldLayout); endGasReport(); } @@ -389,16 +389,16 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { thirdDataBytes ); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); // Set data - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); // Delete data startGasReport("delete record (complex data, 3 slots)"); - StoreCore.deleteRecord(tableId, key, fieldLayout); + StoreCore.deleteRecord(tableId, keyTuple, fieldLayout); endGasReport(); } @@ -414,9 +414,9 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { ); StoreCore.registerTable(tableId, fieldLayout, defaultKeySchema, valueSchema, new string[](1), new string[](3)); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); // Create data bytes32 firstDataBytes = keccak256("some data"); @@ -437,10 +437,10 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { } // Set fields - StoreCore.setField(tableId, key, 0, abi.encodePacked(firstDataBytes), fieldLayout); - StoreCore.setField(tableId, key, 1, secondDataBytes, fieldLayout); + StoreCore.setField(tableId, keyTuple, 0, abi.encodePacked(firstDataBytes), fieldLayout); + StoreCore.setField(tableId, keyTuple, 1, secondDataBytes, fieldLayout); // Initialize a field with push - StoreCore.pushToField(tableId, key, 2, thirdDataBytes, fieldLayout); + StoreCore.pushToField(tableId, keyTuple, 2, thirdDataBytes, fieldLayout); // Create data to push bytes memory secondDataToPush; @@ -452,7 +452,7 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { // Push to second field startGasReport("push to field (1 slot, 1 uint32 item)"); - StoreCore.pushToField(tableId, key, 1, secondDataToPush, fieldLayout); + StoreCore.pushToField(tableId, keyTuple, 1, secondDataToPush, fieldLayout); endGasReport(); // Create data to push @@ -474,7 +474,7 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { // Push to third field startGasReport("push to field (2 slots, 10 uint32 items)"); - StoreCore.pushToField(tableId, key, 2, thirdDataToPush, fieldLayout); + StoreCore.pushToField(tableId, keyTuple, 2, thirdDataToPush, fieldLayout); endGasReport(); } @@ -501,9 +501,9 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { ); StoreCore.registerTable(tableId, fieldLayout, defaultKeySchema, valueSchema, new string[](1), new string[](3)); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); // Create data data.firstDataBytes = keccak256("some data"); @@ -522,9 +522,9 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { data.thirdDataBytes = EncodeArray.encode(thirdData); // Set fields - StoreCore.setField(tableId, key, 0, abi.encodePacked(data.firstDataBytes), fieldLayout); - StoreCore.setField(tableId, key, 1, data.secondDataBytes, fieldLayout); - StoreCore.setField(tableId, key, 2, data.thirdDataBytes, fieldLayout); + StoreCore.setField(tableId, keyTuple, 0, abi.encodePacked(data.firstDataBytes), fieldLayout); + StoreCore.setField(tableId, keyTuple, 1, data.secondDataBytes, fieldLayout); + StoreCore.setField(tableId, keyTuple, 2, data.thirdDataBytes, fieldLayout); // Create data to use for the update { @@ -537,7 +537,7 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { // Update index 1 in second field (4 = byte length of uint32) startGasReport("update in field (1 slot, 1 uint32 item)"); - StoreCore.updateInField(tableId, key, 1, 4 * 1, data.secondDataForUpdate, fieldLayout); + StoreCore.updateInField(tableId, keyTuple, 1, 4 * 1, data.secondDataForUpdate, fieldLayout); endGasReport(); // Create data for update @@ -561,7 +561,7 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { // Update indexes 1,2,3,4 in third field (8 = byte length of uint64) startGasReport("push to field (2 slots, 6 uint64 items)"); - StoreCore.updateInField(tableId, key, 2, 8 * 1, data.thirdDataForUpdate, fieldLayout); + StoreCore.updateInField(tableId, keyTuple, 2, 8 * 1, data.thirdDataForUpdate, fieldLayout); endGasReport(); } @@ -572,35 +572,35 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { StoreCore.registerTable(tableId, fieldLayout, defaultKeySchema, valueSchema, new string[](1), new string[](2)); - // Create key - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32("some.key"); + // Create keyTuple + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32("some.keyTuple"); startGasReport("access non-existing record"); - StoreCore.getRecord(tableId, key, fieldLayout); + StoreCore.getRecord(tableId, keyTuple, fieldLayout); endGasReport(); startGasReport("access static field of non-existing record"); - StoreCore.getField(tableId, key, 0, fieldLayout); + StoreCore.getField(tableId, keyTuple, 0, fieldLayout); endGasReport(); startGasReport("access dynamic field of non-existing record"); - StoreCore.getField(tableId, key, 1, fieldLayout); + StoreCore.getField(tableId, keyTuple, 1, fieldLayout); endGasReport(); startGasReport("access length of dynamic field of non-existing record"); - StoreCore.getFieldLength(tableId, key, 1, fieldLayout); + StoreCore.getFieldLength(tableId, keyTuple, 1, fieldLayout); endGasReport(); startGasReport("access slice of dynamic field of non-existing record"); - StoreCore.getFieldSlice(tableId, key, 1, fieldLayout, 0, 0); + StoreCore.getFieldSlice(tableId, keyTuple, 1, fieldLayout, 0, 0); endGasReport(); } function testHooks() public { bytes32 tableId = keccak256("some.tableId"); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some key"); // Register tableId FieldLayout fieldLayout = FieldLayoutEncodeHelper.encode(16, 0); @@ -635,24 +635,24 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { bytes memory data = abi.encodePacked(bytes16(0x0102030405060708090a0b0c0d0e0f10)); startGasReport("set record on tableId with subscriber"); - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); endGasReport(); data = abi.encodePacked(bytes16(0x1112131415161718191a1b1c1d1e1f20)); startGasReport("set static field on tableId with subscriber"); - StoreCore.setField(tableId, key, 0, data, fieldLayout); + StoreCore.setField(tableId, keyTuple, 0, data, fieldLayout); endGasReport(); startGasReport("delete record on tableId with subscriber"); - StoreCore.deleteRecord(tableId, key, fieldLayout); + StoreCore.deleteRecord(tableId, keyTuple, fieldLayout); endGasReport(); } function testHooksDynamicData() public { bytes32 tableId = keccak256("some.tableId"); - bytes32[] memory key = new bytes32[](1); - key[0] = keccak256("some key"); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = keccak256("some key"); // Register tableId FieldLayout fieldLayout = FieldLayoutEncodeHelper.encode(16, 1); @@ -693,7 +693,7 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { bytes memory data = abi.encodePacked(staticData, dynamicData); startGasReport("set (dynamic) record on tableId with subscriber"); - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); endGasReport(); // Update dynamic data @@ -703,11 +703,11 @@ contract StoreCoreGasTest is Test, GasReporter, StoreMock { data = abi.encodePacked(staticData, dynamicData); startGasReport("set (dynamic) field on tableId with subscriber"); - StoreCore.setField(tableId, key, 1, arrayDataBytes, fieldLayout); + StoreCore.setField(tableId, keyTuple, 1, arrayDataBytes, fieldLayout); endGasReport(); startGasReport("delete (dynamic) record on tableId with subscriber"); - StoreCore.deleteRecord(tableId, key, fieldLayout); + StoreCore.deleteRecord(tableId, keyTuple, fieldLayout); endGasReport(); } } diff --git a/packages/store/test/StoreMock.sol b/packages/store/test/StoreMock.sol index 7f41e95ba7..96e23f6664 100644 --- a/packages/store/test/StoreMock.sol +++ b/packages/store/test/StoreMock.sol @@ -19,71 +19,71 @@ contract StoreMock is IStore, StoreRead { // Set full record (including full dynamic data) function setRecord( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, bytes calldata data, FieldLayout fieldLayout ) public virtual { - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); } // Set partial data at schema index function setField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, bytes calldata data, FieldLayout fieldLayout ) public virtual { - StoreCore.setField(tableId, key, schemaIndex, data, fieldLayout); + StoreCore.setField(tableId, keyTuple, schemaIndex, data, fieldLayout); } // Push encoded items to the dynamic field at schema index function pushToField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, bytes calldata dataToPush, FieldLayout fieldLayout ) public virtual { - StoreCore.pushToField(tableId, key, schemaIndex, dataToPush, fieldLayout); + StoreCore.pushToField(tableId, keyTuple, schemaIndex, dataToPush, fieldLayout); } // Pop byte length from the dynamic field at schema index function popFromField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, uint256 byteLengthToPop, FieldLayout fieldLayout ) public virtual { - StoreCore.popFromField(tableId, key, schemaIndex, byteLengthToPop, fieldLayout); + StoreCore.popFromField(tableId, keyTuple, schemaIndex, byteLengthToPop, fieldLayout); } // Change encoded items within the dynamic field at schema index function updateInField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, uint256 startByteIndex, bytes calldata dataToSet, FieldLayout fieldLayout ) public virtual { - StoreCore.updateInField(tableId, key, schemaIndex, startByteIndex, dataToSet, fieldLayout); + StoreCore.updateInField(tableId, keyTuple, schemaIndex, startByteIndex, dataToSet, fieldLayout); } // Set full record (including full dynamic data) - function deleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) public virtual { - StoreCore.deleteRecord(tableId, key, fieldLayout); + function deleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) public virtual { + StoreCore.deleteRecord(tableId, keyTuple, fieldLayout); } // Emit the ephemeral event without modifying storage function emitEphemeralRecord( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, bytes calldata data, FieldLayout fieldLayout ) public virtual { - StoreCore.emitEphemeralRecord(tableId, key, data, fieldLayout); + StoreCore.emitEphemeralRecord(tableId, keyTuple, data, fieldLayout); } function registerTable( diff --git a/packages/store/ts/storeEvents.ts b/packages/store/ts/storeEvents.ts index c2cb00a604..77b308b8e2 100644 --- a/packages/store/ts/storeEvents.ts +++ b/packages/store/ts/storeEvents.ts @@ -1,6 +1,6 @@ export const storeEvents = [ - "event StoreDeleteRecord(bytes32 tableId, bytes32[] key)", - "event StoreSetField(bytes32 tableId, bytes32[] key, uint8 schemaIndex, bytes data)", - "event StoreSetRecord(bytes32 tableId, bytes32[] key, bytes data)", - "event StoreEphemeralRecord(bytes32 tableId, bytes32[] key, bytes data)", + "event StoreDeleteRecord(bytes32 tableId, bytes32[] keyTuple)", + "event StoreSetField(bytes32 tableId, bytes32[] keyTuple, uint8 schemaIndex, bytes data)", + "event StoreSetRecord(bytes32 tableId, bytes32[] keyTuple, bytes data)", + "event StoreEphemeralRecord(bytes32 tableId, bytes32[] keyTuple, bytes data)", ] as const; diff --git a/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json b/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json new file mode 100644 index 0000000000..b0b3c7ceed --- /dev/null +++ b/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json @@ -0,0 +1,757 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessDenied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "DelegationNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "FunctionSelectorExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "FunctionSelectorNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "InterfaceNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "InvalidSelector", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "PackedCounter_InvalidLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "ResourceExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "ResourceNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "SchemaLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "SchemaLib_StaticTypeAfterDynamicType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "Slice_OutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidFieldNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidKeyNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidValueSchemaLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "system", + "type": "address" + } + ], + "name": "SystemExists", + "type": "error" + }, + { + "inputs": [], + "name": "WorldAlreadyInitialized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "inputs": [], + "name": "_msgSender", + "outputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_msgValue", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "_world", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "grantee", + "type": "address" + } + ], + "name": "grantAccess", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IModule", + "name": "module", + "type": "address" + }, + { + "internalType": "bytes", + "name": "args", + "type": "bytes" + } + ], + "name": "installModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "delegationControlId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "initFuncSelectorAndArgs", + "type": "bytes" + } + ], + "name": "registerDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "systemFunctionName", + "type": "string" + }, + { + "internalType": "string", + "name": "systemFunctionArguments", + "type": "string" + } + ], + "name": "registerFunctionSelector", + "outputs": [ + { + "internalType": "bytes4", + "name": "worldFunctionSelector", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes16", + "name": "namespace", + "type": "bytes16" + } + ], + "name": "registerNamespace", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "bytes4", + "name": "worldFunctionSelector", + "type": "bytes4" + }, + { + "internalType": "bytes4", + "name": "systemFunctionSelector", + "type": "bytes4" + } + ], + "name": "registerRootFunctionSelector", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "enabledHooksBitmap", + "type": "uint8" + } + ], + "name": "registerStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "contract WorldContextConsumer", + "name": "system", + "type": "address" + }, + { + "internalType": "bool", + "name": "publicAccess", + "type": "bool" + } + ], + "name": "registerSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "contract ISystemHook", + "name": "hookAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "enabledHooksBitmap", + "type": "uint8" + } + ], + "name": "registerSystemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + }, + { + "internalType": "string[]", + "name": "keyNames", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "fieldNames", + "type": "string[]" + } + ], + "name": "registerTable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "grantee", + "type": "address" + } + ], + "name": "revokeAccess", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes16", + "name": "fromNamespace", + "type": "bytes16" + }, + { + "internalType": "address", + "name": "toAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferBalanceToAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes16", + "name": "fromNamespace", + "type": "bytes16" + }, + { + "internalType": "bytes16", + "name": "toNamespace", + "type": "bytes16" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferBalanceToNamespace", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes16", + "name": "namespace", + "type": "bytes16" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + } + ], + "name": "unregisterStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "contract ISystemHook", + "name": "hookAddress", + "type": "address" + } + ], + "name": "unregisterSystemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json.d.ts b/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json.d.ts new file mode 100644 index 0000000000..a4e49e5b2c --- /dev/null +++ b/packages/world/abi/CoreSystem.sol/CoreSystem.abi.json.d.ts @@ -0,0 +1,758 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + }, + { + internalType: "address"; + name: "caller"; + type: "address"; + } + ]; + name: "AccessDenied"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "delegator"; + type: "address"; + }, + { + internalType: "address"; + name: "delegatee"; + type: "address"; + } + ]; + name: "DelegationNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "functionSelector"; + type: "bytes4"; + } + ]; + name: "FunctionSelectorExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "functionSelector"; + type: "bytes4"; + } + ]; + name: "FunctionSelectorNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "balance"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "amount"; + type: "uint256"; + } + ]; + name: "InsufficientBalance"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "contractAddress"; + type: "address"; + }, + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "InterfaceNotSupported"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "InvalidSelector"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "PackedCounter_InvalidLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "ResourceExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "ResourceNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "SchemaLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "SchemaLib_StaticTypeAfterDynamicType"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "Slice_OutOfBounds"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidFieldNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidKeyNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidValueSchemaLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableAlreadyExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "system"; + type: "address"; + } + ]; + name: "SystemExists"; + type: "error"; + }, + { + inputs: []; + name: "WorldAlreadyInitialized"; + type: "error"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + inputs: []; + name: "_msgSender"; + outputs: [ + { + internalType: "address"; + name: "sender"; + type: "address"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: []; + name: "_msgValue"; + outputs: [ + { + internalType: "uint256"; + name: "value"; + type: "uint256"; + } + ]; + stateMutability: "pure"; + type: "function"; + }, + { + inputs: []; + name: "_world"; + outputs: [ + { + internalType: "address"; + name: ""; + type: "address"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "address"; + name: "grantee"; + type: "address"; + } + ]; + name: "grantAccess"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "contract IModule"; + name: "module"; + type: "address"; + }, + { + internalType: "bytes"; + name: "args"; + type: "bytes"; + } + ]; + name: "installModule"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "address"; + name: "delegatee"; + type: "address"; + }, + { + internalType: "bytes32"; + name: "delegationControlId"; + type: "bytes32"; + }, + { + internalType: "bytes"; + name: "initFuncSelectorAndArgs"; + type: "bytes"; + } + ]; + name: "registerDelegation"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "systemFunctionName"; + type: "string"; + }, + { + internalType: "string"; + name: "systemFunctionArguments"; + type: "string"; + } + ]; + name: "registerFunctionSelector"; + outputs: [ + { + internalType: "bytes4"; + name: "worldFunctionSelector"; + type: "bytes4"; + } + ]; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes16"; + name: "namespace"; + type: "bytes16"; + } + ]; + name: "registerNamespace"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "bytes4"; + name: "worldFunctionSelector"; + type: "bytes4"; + }, + { + internalType: "bytes4"; + name: "systemFunctionSelector"; + type: "bytes4"; + } + ]; + name: "registerRootFunctionSelector"; + outputs: [ + { + internalType: "bytes4"; + name: ""; + type: "bytes4"; + } + ]; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + }, + { + internalType: "uint8"; + name: "enabledHooksBitmap"; + type: "uint8"; + } + ]; + name: "registerStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "contract WorldContextConsumer"; + name: "system"; + type: "address"; + }, + { + internalType: "bool"; + name: "publicAccess"; + type: "bool"; + } + ]; + name: "registerSystem"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "contract ISystemHook"; + name: "hookAddress"; + type: "address"; + }, + { + internalType: "uint8"; + name: "enabledHooksBitmap"; + type: "uint8"; + } + ]; + name: "registerSystemHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + }, + { + internalType: "string[]"; + name: "keyNames"; + type: "string[]"; + }, + { + internalType: "string[]"; + name: "fieldNames"; + type: "string[]"; + } + ]; + name: "registerTable"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "address"; + name: "grantee"; + type: "address"; + } + ]; + name: "revokeAccess"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes16"; + name: "fromNamespace"; + type: "bytes16"; + }, + { + internalType: "address"; + name: "toAddress"; + type: "address"; + }, + { + internalType: "uint256"; + name: "amount"; + type: "uint256"; + } + ]; + name: "transferBalanceToAddress"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes16"; + name: "fromNamespace"; + type: "bytes16"; + }, + { + internalType: "bytes16"; + name: "toNamespace"; + type: "bytes16"; + }, + { + internalType: "uint256"; + name: "amount"; + type: "uint256"; + } + ]; + name: "transferBalanceToNamespace"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes16"; + name: "namespace"; + type: "bytes16"; + }, + { + internalType: "address"; + name: "newOwner"; + type: "address"; + } + ]; + name: "transferOwnership"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + } + ]; + name: "unregisterStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "contract ISystemHook"; + name: "hookAddress"; + type: "address"; + } + ]; + name: "unregisterSystemHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json b/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json new file mode 100644 index 0000000000..367398d105 --- /dev/null +++ b/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json @@ -0,0 +1,166 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessDenied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "inputs": [], + "name": "_msgSender", + "outputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "_msgValue", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "_world", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json.d.ts b/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json.d.ts new file mode 100644 index 0000000000..4e436b91de --- /dev/null +++ b/packages/world/abi/EphemeralRecordSystem.sol/EphemeralRecordSystem.abi.json.d.ts @@ -0,0 +1,167 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + }, + { + internalType: "address"; + name: "caller"; + type: "address"; + } + ]; + name: "AccessDenied"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + inputs: []; + name: "_msgSender"; + outputs: [ + { + internalType: "address"; + name: "sender"; + type: "address"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: []; + name: "_msgValue"; + outputs: [ + { + internalType: "uint256"; + name: "value"; + type: "uint256"; + } + ]; + stateMutability: "pure"; + type: "function"; + }, + { + inputs: []; + name: "_world"; + outputs: [ + { + internalType: "address"; + name: ""; + type: "address"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json new file mode 100644 index 0000000000..f7915c9a9f --- /dev/null +++ b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json @@ -0,0 +1,1231 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessDenied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "DelegationNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "FunctionSelectorExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "FunctionSelectorNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "InterfaceNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "InvalidSelector", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "ResourceExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "ResourceNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_DataIndexOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidFieldNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidKeyNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidValueSchemaLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotImplemented", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "system", + "type": "address" + } + ], + "name": "SystemExists", + "type": "error" + }, + { + "inputs": [], + "name": "WorldAlreadyInitialized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "HelloWorld", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "funcSelectorAndArgs", + "type": "bytes" + } + ], + "name": "call", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "funcSelectorAndArgs", + "type": "bytes" + } + ], + "name": "callFrom", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "creator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "grantee", + "type": "address" + } + ], + "name": "grantAccess", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IModule", + "name": "coreModule", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IModule", + "name": "module", + "type": "address" + }, + { + "internalType": "bytes", + "name": "args", + "type": "bytes" + } + ], + "name": "installModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IModule", + "name": "module", + "type": "address" + }, + { + "internalType": "bytes", + "name": "args", + "type": "bytes" + } + ], + "name": "installRootModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "delegationControlId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "initFuncSelectorAndArgs", + "type": "bytes" + } + ], + "name": "registerDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "systemFunctionName", + "type": "string" + }, + { + "internalType": "string", + "name": "systemFunctionArguments", + "type": "string" + } + ], + "name": "registerFunctionSelector", + "outputs": [ + { + "internalType": "bytes4", + "name": "worldFunctionSelector", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes16", + "name": "namespace", + "type": "bytes16" + } + ], + "name": "registerNamespace", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "bytes4", + "name": "worldFunctionSelector", + "type": "bytes4" + }, + { + "internalType": "bytes4", + "name": "systemFunctionSelector", + "type": "bytes4" + } + ], + "name": "registerRootFunctionSelector", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "enabledHooksBitmap", + "type": "uint8" + } + ], + "name": "registerStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "contract WorldContextConsumer", + "name": "system", + "type": "address" + }, + { + "internalType": "bool", + "name": "publicAccess", + "type": "bool" + } + ], + "name": "registerSystem", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "contract ISystemHook", + "name": "hookAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "enabledHooksBitmap", + "type": "uint8" + } + ], + "name": "registerSystemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + }, + { + "internalType": "string[]", + "name": "keyNames", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "fieldNames", + "type": "string[]" + } + ], + "name": "registerTable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "grantee", + "type": "address" + } + ], + "name": "revokeAccess", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes16", + "name": "fromNamespace", + "type": "bytes16" + }, + { + "internalType": "address", + "name": "toAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferBalanceToAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes16", + "name": "fromNamespace", + "type": "bytes16" + }, + { + "internalType": "bytes16", + "name": "toNamespace", + "type": "bytes16" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferBalanceToNamespace", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes16", + "name": "namespace", + "type": "bytes16" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + } + ], + "name": "unregisterStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "contract ISystemHook", + "name": "hookAddress", + "type": "address" + } + ], + "name": "unregisterSystemHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json.d.ts b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json.d.ts new file mode 100644 index 0000000000..eebaf2c6b2 --- /dev/null +++ b/packages/world/abi/IBaseWorld.sol/IBaseWorld.abi.json.d.ts @@ -0,0 +1,1232 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + }, + { + internalType: "address"; + name: "caller"; + type: "address"; + } + ]; + name: "AccessDenied"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "delegator"; + type: "address"; + }, + { + internalType: "address"; + name: "delegatee"; + type: "address"; + } + ]; + name: "DelegationNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "functionSelector"; + type: "bytes4"; + } + ]; + name: "FunctionSelectorExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "functionSelector"; + type: "bytes4"; + } + ]; + name: "FunctionSelectorNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "balance"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "amount"; + type: "uint256"; + } + ]; + name: "InsufficientBalance"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "contractAddress"; + type: "address"; + }, + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "InterfaceNotSupported"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "InvalidSelector"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "ResourceExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "ResourceNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_DataIndexOverflow"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidFieldNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidKeyNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidValueSchemaLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotImplemented"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableAlreadyExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "system"; + type: "address"; + } + ]; + name: "SystemExists"; + type: "error"; + }, + { + inputs: []; + name: "WorldAlreadyInitialized"; + type: "error"; + }, + { + anonymous: false; + inputs: []; + name: "HelloWorld"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "bytes"; + name: "funcSelectorAndArgs"; + type: "bytes"; + } + ]; + name: "call"; + outputs: [ + { + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + stateMutability: "payable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "address"; + name: "delegator"; + type: "address"; + }, + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "bytes"; + name: "funcSelectorAndArgs"; + type: "bytes"; + } + ]; + name: "callFrom"; + outputs: [ + { + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + stateMutability: "payable"; + type: "function"; + }, + { + inputs: []; + name: "creator"; + outputs: [ + { + internalType: "address"; + name: ""; + type: "address"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "address"; + name: "grantee"; + type: "address"; + } + ]; + name: "grantAccess"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "contract IModule"; + name: "coreModule"; + type: "address"; + } + ]; + name: "initialize"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "contract IModule"; + name: "module"; + type: "address"; + }, + { + internalType: "bytes"; + name: "args"; + type: "bytes"; + } + ]; + name: "installModule"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "contract IModule"; + name: "module"; + type: "address"; + }, + { + internalType: "bytes"; + name: "args"; + type: "bytes"; + } + ]; + name: "installRootModule"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "address"; + name: "delegatee"; + type: "address"; + }, + { + internalType: "bytes32"; + name: "delegationControlId"; + type: "bytes32"; + }, + { + internalType: "bytes"; + name: "initFuncSelectorAndArgs"; + type: "bytes"; + } + ]; + name: "registerDelegation"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "systemFunctionName"; + type: "string"; + }, + { + internalType: "string"; + name: "systemFunctionArguments"; + type: "string"; + } + ]; + name: "registerFunctionSelector"; + outputs: [ + { + internalType: "bytes4"; + name: "worldFunctionSelector"; + type: "bytes4"; + } + ]; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes16"; + name: "namespace"; + type: "bytes16"; + } + ]; + name: "registerNamespace"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "bytes4"; + name: "worldFunctionSelector"; + type: "bytes4"; + }, + { + internalType: "bytes4"; + name: "systemFunctionSelector"; + type: "bytes4"; + } + ]; + name: "registerRootFunctionSelector"; + outputs: [ + { + internalType: "bytes4"; + name: ""; + type: "bytes4"; + } + ]; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + }, + { + internalType: "uint8"; + name: "enabledHooksBitmap"; + type: "uint8"; + } + ]; + name: "registerStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "contract WorldContextConsumer"; + name: "system"; + type: "address"; + }, + { + internalType: "bool"; + name: "publicAccess"; + type: "bool"; + } + ]; + name: "registerSystem"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "contract ISystemHook"; + name: "hookAddress"; + type: "address"; + }, + { + internalType: "uint8"; + name: "enabledHooksBitmap"; + type: "uint8"; + } + ]; + name: "registerSystemHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + }, + { + internalType: "string[]"; + name: "keyNames"; + type: "string[]"; + }, + { + internalType: "string[]"; + name: "fieldNames"; + type: "string[]"; + } + ]; + name: "registerTable"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "address"; + name: "grantee"; + type: "address"; + } + ]; + name: "revokeAccess"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes16"; + name: "fromNamespace"; + type: "bytes16"; + }, + { + internalType: "address"; + name: "toAddress"; + type: "address"; + }, + { + internalType: "uint256"; + name: "amount"; + type: "uint256"; + } + ]; + name: "transferBalanceToAddress"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes16"; + name: "fromNamespace"; + type: "bytes16"; + }, + { + internalType: "bytes16"; + name: "toNamespace"; + type: "bytes16"; + }, + { + internalType: "uint256"; + name: "amount"; + type: "uint256"; + } + ]; + name: "transferBalanceToNamespace"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes16"; + name: "namespace"; + type: "bytes16"; + }, + { + internalType: "address"; + name: "newOwner"; + type: "address"; + } + ]; + name: "transferOwnership"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + } + ]; + name: "unregisterStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "contract ISystemHook"; + name: "hookAddress"; + type: "address"; + } + ]; + name: "unregisterSystemHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/IStore.sol/IStore.abi.json b/packages/world/abi/IStore.sol/IStore.abi.json new file mode 100644 index 0000000000..974e2e74fa --- /dev/null +++ b/packages/world/abi/IStore.sol/IStore.abi.json @@ -0,0 +1,717 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_DataIndexOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidFieldNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidKeyNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidValueSchemaLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotImplemented", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "enabledHooksBitmap", + "type": "uint8" + } + ], + "name": "registerStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + }, + { + "internalType": "string[]", + "name": "keyNames", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "fieldNames", + "type": "string[]" + } + ], + "name": "registerTable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + } + ], + "name": "unregisterStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStore.abi.json.d.ts b/packages/world/abi/IStore.sol/IStore.abi.json.d.ts new file mode 100644 index 0000000000..e939bc04ed --- /dev/null +++ b/packages/world/abi/IStore.sol/IStore.abi.json.d.ts @@ -0,0 +1,718 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_DataIndexOverflow"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidFieldNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidKeyNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidValueSchemaLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotImplemented"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableAlreadyExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableNotFound"; + type: "error"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + }, + { + internalType: "uint8"; + name: "enabledHooksBitmap"; + type: "uint8"; + } + ]; + name: "registerStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + }, + { + internalType: "string[]"; + name: "keyNames"; + type: "string[]"; + }, + { + internalType: "string[]"; + name: "fieldNames"; + type: "string[]"; + } + ]; + name: "registerTable"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + } + ]; + name: "unregisterStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/IStore.sol/IStoreData.abi.json b/packages/world/abi/IStore.sol/IStoreData.abi.json new file mode 100644 index 0000000000..f6db946f1c --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreData.abi.json @@ -0,0 +1,463 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStoreData.abi.json.d.ts b/packages/world/abi/IStore.sol/IStoreData.abi.json.d.ts new file mode 100644 index 0000000000..077b246517 --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreData.abi.json.d.ts @@ -0,0 +1,464 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/IStore.sol/IStoreEphemeral.abi.json b/packages/world/abi/IStore.sol/IStoreEphemeral.abi.json new file mode 100644 index 0000000000..f591aa2757 --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreEphemeral.abi.json @@ -0,0 +1,55 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStoreEphemeral.abi.json.d.ts b/packages/world/abi/IStore.sol/IStoreEphemeral.abi.json.d.ts new file mode 100644 index 0000000000..9b9186d587 --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreEphemeral.abi.json.d.ts @@ -0,0 +1,56 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/IStore.sol/IStoreRead.abi.json b/packages/world/abi/IStore.sol/IStoreRead.abi.json new file mode 100644 index 0000000000..5fb8e1bc53 --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreRead.abi.json @@ -0,0 +1,200 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStoreRead.abi.json.d.ts b/packages/world/abi/IStore.sol/IStoreRead.abi.json.d.ts new file mode 100644 index 0000000000..9ca275d41b --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreRead.abi.json.d.ts @@ -0,0 +1,201 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/IStore.sol/IStoreWrite.abi.json b/packages/world/abi/IStore.sol/IStoreWrite.abi.json new file mode 100644 index 0000000000..352fb8196a --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreWrite.abi.json @@ -0,0 +1,265 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/IStore.sol/IStoreWrite.abi.json.d.ts b/packages/world/abi/IStore.sol/IStoreWrite.abi.json.d.ts new file mode 100644 index 0000000000..04ce5d76ab --- /dev/null +++ b/packages/world/abi/IStore.sol/IStoreWrite.abi.json.d.ts @@ -0,0 +1,266 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/IStoreHook.sol/IStoreHook.abi.json b/packages/world/abi/IStoreHook.sol/IStoreHook.abi.json new file mode 100644 index 0000000000..9782a97c93 --- /dev/null +++ b/packages/world/abi/IStoreHook.sol/IStoreHook.abi.json @@ -0,0 +1,189 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/IStoreHook.sol/IStoreHook.abi.json.d.ts b/packages/world/abi/IStoreHook.sol/IStoreHook.abi.json.d.ts new file mode 100644 index 0000000000..d3e9224ef8 --- /dev/null +++ b/packages/world/abi/IStoreHook.sol/IStoreHook.abi.json.d.ts @@ -0,0 +1,190 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceID"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "view"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json b/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json new file mode 100644 index 0000000000..710c1ed06c --- /dev/null +++ b/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json @@ -0,0 +1,279 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "PackedCounter_InvalidLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "Slice_OutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_DataIndexOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json.d.ts b/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json.d.ts new file mode 100644 index 0000000000..d01f54b190 --- /dev/null +++ b/packages/world/abi/KeysInTableHook.sol/KeysInTableHook.abi.json.d.ts @@ -0,0 +1,280 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "PackedCounter_InvalidLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "Slice_OutOfBounds"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_DataIndexOverflow"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: ""; + type: "uint8"; + }, + { + internalType: "bytes"; + name: ""; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: ""; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: ""; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: ""; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: ""; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: ""; + type: "uint8"; + }, + { + internalType: "bytes"; + name: ""; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: ""; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: ""; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: ""; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json b/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json new file mode 100644 index 0000000000..0760ed5cb7 --- /dev/null +++ b/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json @@ -0,0 +1,263 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "PackedCounter_InvalidLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "Slice_OutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "sourceTableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "sourceTableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "sourceTableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "sourceTableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "sourceTableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "sourceTableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json.d.ts b/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json.d.ts new file mode 100644 index 0000000000..e5c0491a73 --- /dev/null +++ b/packages/world/abi/KeysWithValueHook.sol/KeysWithValueHook.abi.json.d.ts @@ -0,0 +1,264 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "PackedCounter_InvalidLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "Slice_OutOfBounds"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "sourceTableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "sourceTableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: ""; + type: "uint8"; + }, + { + internalType: "bytes"; + name: ""; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "sourceTableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "sourceTableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "sourceTableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: ""; + type: "uint8"; + }, + { + internalType: "bytes"; + name: ""; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "sourceTableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/StoreCore.sol/StoreCore.abi.json b/packages/world/abi/StoreCore.sol/StoreCore.abi.json new file mode 100644 index 0000000000..3808909d9a --- /dev/null +++ b/packages/world/abi/StoreCore.sol/StoreCore.abi.json @@ -0,0 +1,102 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "fieldIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + } +] \ No newline at end of file diff --git a/packages/world/abi/StoreCore.sol/StoreCore.abi.json.d.ts b/packages/world/abi/StoreCore.sol/StoreCore.abi.json.d.ts new file mode 100644 index 0000000000..fa9de440d1 --- /dev/null +++ b/packages/world/abi/StoreCore.sol/StoreCore.abi.json.d.ts @@ -0,0 +1,103 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "fieldIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + } +]; +export default abi; diff --git a/packages/world/abi/StoreHook.sol/StoreHook.abi.json b/packages/world/abi/StoreHook.sol/StoreHook.abi.json new file mode 100644 index 0000000000..59ef8376aa --- /dev/null +++ b/packages/world/abi/StoreHook.sol/StoreHook.abi.json @@ -0,0 +1,189 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/StoreHook.sol/StoreHook.abi.json.d.ts b/packages/world/abi/StoreHook.sol/StoreHook.abi.json.d.ts new file mode 100644 index 0000000000..4091c781ed --- /dev/null +++ b/packages/world/abi/StoreHook.sol/StoreHook.abi.json.d.ts @@ -0,0 +1,190 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/StoreRead.sol/StoreRead.abi.json b/packages/world/abi/StoreRead.sol/StoreRead.abi.json new file mode 100644 index 0000000000..7ac3c66a02 --- /dev/null +++ b/packages/world/abi/StoreRead.sol/StoreRead.abi.json @@ -0,0 +1,242 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/StoreRead.sol/StoreRead.abi.json.d.ts b/packages/world/abi/StoreRead.sol/StoreRead.abi.json.d.ts new file mode 100644 index 0000000000..8a28178333 --- /dev/null +++ b/packages/world/abi/StoreRead.sol/StoreRead.abi.json.d.ts @@ -0,0 +1,243 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/World.sol/World.abi.json b/packages/world/abi/World.sol/World.abi.json new file mode 100644 index 0000000000..23782fe93e --- /dev/null +++ b/packages/world/abi/World.sol/World.abi.json @@ -0,0 +1,820 @@ +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "AccessDenied", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "DelegationNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "FieldLayoutLib_InvalidLength", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthDoesNotFitInAWord", + "type": "error" + }, + { + "inputs": [], + "name": "FieldLayoutLib_StaticLengthIsZero", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "FunctionSelectorExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "functionSelector", + "type": "bytes4" + } + ], + "name": "FunctionSelectorNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "InterfaceNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "InvalidSelector", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "PackedCounter_InvalidLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "ResourceExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "resource", + "type": "string" + } + ], + "name": "ResourceNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "Slice_OutOfBounds", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_DataIndexOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "system", + "type": "address" + } + ], + "name": "SystemExists", + "type": "error" + }, + { + "inputs": [], + "name": "WorldAlreadyInitialized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "HelloWorld", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "funcSelectorAndArgs", + "type": "bytes" + } + ], + "name": "call", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "resourceSelector", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "funcSelectorAndArgs", + "type": "bytes" + } + ], + "name": "callFrom", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "creator", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IModule", + "name": "coreModule", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IModule", + "name": "module", + "type": "address" + }, + { + "internalType": "bytes", + "name": "args", + "type": "bytes" + } + ], + "name": "installRootModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] \ No newline at end of file diff --git a/packages/world/abi/World.sol/World.abi.json.d.ts b/packages/world/abi/World.sol/World.abi.json.d.ts new file mode 100644 index 0000000000..e5398caa53 --- /dev/null +++ b/packages/world/abi/World.sol/World.abi.json.d.ts @@ -0,0 +1,821 @@ +declare const abi: [ + { + inputs: []; + stateMutability: "nonpayable"; + type: "constructor"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + }, + { + internalType: "address"; + name: "caller"; + type: "address"; + } + ]; + name: "AccessDenied"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "delegator"; + type: "address"; + }, + { + internalType: "address"; + name: "delegatee"; + type: "address"; + } + ]; + name: "DelegationNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "FieldLayoutLib_InvalidLength"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthDoesNotFitInAWord"; + type: "error"; + }, + { + inputs: []; + name: "FieldLayoutLib_StaticLengthIsZero"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "functionSelector"; + type: "bytes4"; + } + ]; + name: "FunctionSelectorExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "functionSelector"; + type: "bytes4"; + } + ]; + name: "FunctionSelectorNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "balance"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "amount"; + type: "uint256"; + } + ]; + name: "InsufficientBalance"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "contractAddress"; + type: "address"; + }, + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "InterfaceNotSupported"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "InvalidSelector"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + } + ]; + name: "PackedCounter_InvalidLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "ResourceExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "string"; + name: "resource"; + type: "string"; + } + ]; + name: "ResourceNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "Slice_OutOfBounds"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_DataIndexOverflow"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableNotFound"; + type: "error"; + }, + { + inputs: [ + { + internalType: "address"; + name: "system"; + type: "address"; + } + ]; + name: "SystemExists"; + type: "error"; + }, + { + inputs: []; + name: "WorldAlreadyInitialized"; + type: "error"; + }, + { + anonymous: false; + inputs: []; + name: "HelloWorld"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + stateMutability: "payable"; + type: "fallback"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "bytes"; + name: "funcSelectorAndArgs"; + type: "bytes"; + } + ]; + name: "call"; + outputs: [ + { + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + stateMutability: "payable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "address"; + name: "delegator"; + type: "address"; + }, + { + internalType: "bytes32"; + name: "resourceSelector"; + type: "bytes32"; + }, + { + internalType: "bytes"; + name: "funcSelectorAndArgs"; + type: "bytes"; + } + ]; + name: "callFrom"; + outputs: [ + { + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + stateMutability: "payable"; + type: "function"; + }, + { + inputs: []; + name: "creator"; + outputs: [ + { + internalType: "address"; + name: ""; + type: "address"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: ""; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "contract IModule"; + name: "coreModule"; + type: "address"; + } + ]; + name: "initialize"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "contract IModule"; + name: "module"; + type: "address"; + }, + { + internalType: "bytes"; + name: "args"; + type: "bytes"; + } + ]; + name: "installRootModule"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + stateMutability: "payable"; + type: "receive"; + } +]; +export default abi; diff --git a/packages/world/abi/src/IStore.sol/IStore.abi.json b/packages/world/abi/src/IStore.sol/IStore.abi.json new file mode 100644 index 0000000000..974e2e74fa --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStore.abi.json @@ -0,0 +1,717 @@ +[ + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_DataIndexOverflow", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidDataLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidFieldNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidKeyNamesLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expected", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "received", + "type": "uint256" + } + ], + "name": "StoreCore_InvalidValueSchemaLength", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotDynamicField", + "type": "error" + }, + { + "inputs": [], + "name": "StoreCore_NotImplemented", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "string", + "name": "tableIdString", + "type": "string" + } + ], + "name": "StoreCore_TableNotFound", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "enabledHooksBitmap", + "type": "uint8" + } + ], + "name": "registerStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + }, + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + }, + { + "internalType": "string[]", + "name": "keyNames", + "type": "string[]" + }, + { + "internalType": "string[]", + "name": "fieldNames", + "type": "string[]" + } + ], + "name": "registerTable", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "contract IStoreHook", + "name": "hookAddress", + "type": "address" + } + ], + "name": "unregisterStoreHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStore.abi.json.d.ts b/packages/world/abi/src/IStore.sol/IStore.abi.json.d.ts new file mode 100644 index 0000000000..e939bc04ed --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStore.abi.json.d.ts @@ -0,0 +1,718 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "uint256"; + name: "length"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_DataIndexOverflow"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidDataLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidFieldNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidKeyNamesLength"; + type: "error"; + }, + { + inputs: [ + { + internalType: "uint256"; + name: "expected"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "received"; + type: "uint256"; + } + ]; + name: "StoreCore_InvalidValueSchemaLength"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotDynamicField"; + type: "error"; + }, + { + inputs: []; + name: "StoreCore_NotImplemented"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableAlreadyExists"; + type: "error"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "string"; + name: "tableIdString"; + type: "string"; + } + ]; + name: "StoreCore_TableNotFound"; + type: "error"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + }, + { + internalType: "uint8"; + name: "enabledHooksBitmap"; + type: "uint8"; + } + ]; + name: "registerStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + }, + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + }, + { + internalType: "string[]"; + name: "keyNames"; + type: "string[]"; + }, + { + internalType: "string[]"; + name: "fieldNames"; + type: "string[]"; + } + ]; + name: "registerTable"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "contract IStoreHook"; + name: "hookAddress"; + type: "address"; + } + ]; + name: "unregisterStoreHook"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/src/IStore.sol/IStoreData.abi.json b/packages/world/abi/src/IStore.sol/IStoreData.abi.json new file mode 100644 index 0000000000..f6db946f1c --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreData.abi.json @@ -0,0 +1,463 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStoreData.abi.json.d.ts b/packages/world/abi/src/IStore.sol/IStoreData.abi.json.d.ts new file mode 100644 index 0000000000..077b246517 --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreData.abi.json.d.ts @@ -0,0 +1,464 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/src/IStore.sol/IStoreEphemeral.abi.json b/packages/world/abi/src/IStore.sol/IStoreEphemeral.abi.json new file mode 100644 index 0000000000..f591aa2757 --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreEphemeral.abi.json @@ -0,0 +1,55 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "emitEphemeralRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStoreEphemeral.abi.json.d.ts b/packages/world/abi/src/IStore.sol/IStoreEphemeral.abi.json.d.ts new file mode 100644 index 0000000000..9b9186d587 --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreEphemeral.abi.json.d.ts @@ -0,0 +1,56 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "emitEphemeralRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/src/IStore.sol/IStoreRead.abi.json b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json new file mode 100644 index 0000000000..5fb8e1bc53 --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json @@ -0,0 +1,200 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getField", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getFieldLayout", + "outputs": [ + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getFieldLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getFieldSlice", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getKeySchema", + "outputs": [ + { + "internalType": "Schema", + "name": "keySchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "getRecord", + "outputs": [ + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + } + ], + "name": "getValueSchema", + "outputs": [ + { + "internalType": "Schema", + "name": "valueSchema", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStoreRead.abi.json.d.ts b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json.d.ts new file mode 100644 index 0000000000..9ca275d41b --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreRead.abi.json.d.ts @@ -0,0 +1,201 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getField"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getFieldLayout"; + outputs: [ + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getFieldLength"; + outputs: [ + { + internalType: "uint256"; + name: ""; + type: "uint256"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + }, + { + internalType: "uint256"; + name: "start"; + type: "uint256"; + }, + { + internalType: "uint256"; + name: "end"; + type: "uint256"; + } + ]; + name: "getFieldSlice"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getKeySchema"; + outputs: [ + { + internalType: "Schema"; + name: "keySchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "getRecord"; + outputs: [ + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + stateMutability: "view"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + } + ]; + name: "getValueSchema"; + outputs: [ + { + internalType: "Schema"; + name: "valueSchema"; + type: "bytes32"; + } + ]; + stateMutability: "view"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/src/IStore.sol/IStoreWrite.abi.json b/packages/world/abi/src/IStore.sol/IStoreWrite.abi.json new file mode 100644 index 0000000000..352fb8196a --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreWrite.abi.json @@ -0,0 +1,265 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "deleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "byteLengthToPop", + "type": "uint256" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "popFromField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "dataToPush", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "pushToField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "setRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "startByteIndex", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "dataToSet", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "updateInField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/IStore.sol/IStoreWrite.abi.json.d.ts b/packages/world/abi/src/IStore.sol/IStoreWrite.abi.json.d.ts new file mode 100644 index 0000000000..04ce5d76ab --- /dev/null +++ b/packages/world/abi/src/IStore.sol/IStoreWrite.abi.json.d.ts @@ -0,0 +1,266 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "deleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "byteLengthToPop"; + type: "uint256"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "popFromField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "dataToPush"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "pushToField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "setRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "uint256"; + name: "startByteIndex"; + type: "uint256"; + }, + { + internalType: "bytes"; + name: "dataToSet"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "updateInField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/src/IStoreHook.sol/IStoreHook.abi.json b/packages/world/abi/src/IStoreHook.sol/IStoreHook.abi.json new file mode 100644 index 0000000000..9782a97c93 --- /dev/null +++ b/packages/world/abi/src/IStoreHook.sol/IStoreHook.abi.json @@ -0,0 +1,189 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceID", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/IStoreHook.sol/IStoreHook.abi.json.d.ts b/packages/world/abi/src/IStoreHook.sol/IStoreHook.abi.json.d.ts new file mode 100644 index 0000000000..d3e9224ef8 --- /dev/null +++ b/packages/world/abi/src/IStoreHook.sol/IStoreHook.abi.json.d.ts @@ -0,0 +1,190 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceID"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "view"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/abi/src/StoreCore.sol/StoreCore.abi.json b/packages/world/abi/src/StoreCore.sol/StoreCore.abi.json new file mode 100644 index 0000000000..3808909d9a --- /dev/null +++ b/packages/world/abi/src/StoreCore.sol/StoreCore.abi.json @@ -0,0 +1,102 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + } + ], + "name": "StoreDeleteRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreEphemeralRecord", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "fieldIndex", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetField", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "StoreSetRecord", + "type": "event" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/StoreCore.sol/StoreCore.abi.json.d.ts b/packages/world/abi/src/StoreCore.sol/StoreCore.abi.json.d.ts new file mode 100644 index 0000000000..fa9de440d1 --- /dev/null +++ b/packages/world/abi/src/StoreCore.sol/StoreCore.abi.json.d.ts @@ -0,0 +1,103 @@ +declare const abi: [ + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + } + ]; + name: "StoreDeleteRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreEphemeralRecord"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "uint8"; + name: "fieldIndex"; + type: "uint8"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetField"; + type: "event"; + }, + { + anonymous: false; + inputs: [ + { + indexed: false; + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + indexed: false; + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + indexed: false; + internalType: "bytes"; + name: "data"; + type: "bytes"; + } + ]; + name: "StoreSetRecord"; + type: "event"; + } +]; +export default abi; diff --git a/packages/world/abi/src/StoreHook.sol/StoreHook.abi.json b/packages/world/abi/src/StoreHook.sol/StoreHook.abi.json new file mode 100644 index 0000000000..59ef8376aa --- /dev/null +++ b/packages/world/abi/src/StoreHook.sol/StoreHook.abi.json @@ -0,0 +1,189 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onAfterSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeDeleteRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "uint8", + "name": "schemaIndex", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetField", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "tableId", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "keyTuple", + "type": "bytes32[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "FieldLayout", + "name": "fieldLayout", + "type": "bytes32" + } + ], + "name": "onBeforeSetRecord", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" + } +] \ No newline at end of file diff --git a/packages/world/abi/src/StoreHook.sol/StoreHook.abi.json.d.ts b/packages/world/abi/src/StoreHook.sol/StoreHook.abi.json.d.ts new file mode 100644 index 0000000000..4091c781ed --- /dev/null +++ b/packages/world/abi/src/StoreHook.sol/StoreHook.abi.json.d.ts @@ -0,0 +1,190 @@ +declare const abi: [ + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onAfterSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeDeleteRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "uint8"; + name: "schemaIndex"; + type: "uint8"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetField"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes32"; + name: "tableId"; + type: "bytes32"; + }, + { + internalType: "bytes32[]"; + name: "keyTuple"; + type: "bytes32[]"; + }, + { + internalType: "bytes"; + name: "data"; + type: "bytes"; + }, + { + internalType: "FieldLayout"; + name: "fieldLayout"; + type: "bytes32"; + } + ]; + name: "onBeforeSetRecord"; + outputs: []; + stateMutability: "nonpayable"; + type: "function"; + }, + { + inputs: [ + { + internalType: "bytes4"; + name: "interfaceId"; + type: "bytes4"; + } + ]; + name: "supportsInterface"; + outputs: [ + { + internalType: "bool"; + name: ""; + type: "bool"; + } + ]; + stateMutability: "pure"; + type: "function"; + } +]; +export default abi; diff --git a/packages/world/src/World.sol b/packages/world/src/World.sol index 9544c61608..3653102813 100644 --- a/packages/world/src/World.sol +++ b/packages/world/src/World.sol @@ -97,7 +97,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { */ function setRecord( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, bytes calldata data, FieldLayout fieldLayout ) public virtual { @@ -105,7 +105,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { AccessControl.requireAccess(tableId, msg.sender); // Set the record - StoreCore.setRecord(tableId, key, data, fieldLayout); + StoreCore.setRecord(tableId, keyTuple, data, fieldLayout); } /** @@ -114,7 +114,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { */ function setField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, bytes calldata data, FieldLayout fieldLayout @@ -123,7 +123,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { AccessControl.requireAccess(tableId, msg.sender); // Set the field - StoreCore.setField(tableId, key, schemaIndex, data, fieldLayout); + StoreCore.setField(tableId, keyTuple, schemaIndex, data, fieldLayout); } /** @@ -132,7 +132,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { */ function pushToField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, bytes calldata dataToPush, FieldLayout fieldLayout @@ -141,7 +141,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { AccessControl.requireAccess(tableId, msg.sender); // Push to the field - StoreCore.pushToField(tableId, key, schemaIndex, dataToPush, fieldLayout); + StoreCore.pushToField(tableId, keyTuple, schemaIndex, dataToPush, fieldLayout); } /** @@ -150,7 +150,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { */ function popFromField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, uint256 byteLengthToPop, FieldLayout fieldLayout @@ -159,7 +159,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { AccessControl.requireAccess(tableId, msg.sender); // Push to the field - StoreCore.popFromField(tableId, key, schemaIndex, byteLengthToPop, fieldLayout); + StoreCore.popFromField(tableId, keyTuple, schemaIndex, byteLengthToPop, fieldLayout); } /** @@ -168,7 +168,7 @@ contract World is StoreRead, IStoreData, IWorldKernel { */ function updateInField( bytes32 tableId, - bytes32[] calldata key, + bytes32[] calldata keyTuple, uint8 schemaIndex, uint256 startByteIndex, bytes calldata dataToSet, @@ -178,19 +178,19 @@ contract World is StoreRead, IStoreData, IWorldKernel { AccessControl.requireAccess(tableId, msg.sender); // Update data in the field - StoreCore.updateInField(tableId, key, schemaIndex, startByteIndex, dataToSet, fieldLayout); + StoreCore.updateInField(tableId, keyTuple, schemaIndex, startByteIndex, dataToSet, fieldLayout); } /** * Delete a record in the table at the given tableId. * Requires the caller to have access to the namespace or name. */ - function deleteRecord(bytes32 tableId, bytes32[] calldata key, FieldLayout fieldLayout) public virtual { + function deleteRecord(bytes32 tableId, bytes32[] calldata keyTuple, FieldLayout fieldLayout) public virtual { // Require access to namespace or name AccessControl.requireAccess(tableId, msg.sender); // Delete the record - StoreCore.deleteRecord(tableId, key, fieldLayout); + StoreCore.deleteRecord(tableId, keyTuple, fieldLayout); } /************************************************************************ diff --git a/packages/world/src/modules/core/implementations/EphemeralRecordSystem.sol b/packages/world/src/modules/core/implementations/EphemeralRecordSystem.sol index 14aa949c04..5a41ebf30b 100644 --- a/packages/world/src/modules/core/implementations/EphemeralRecordSystem.sol +++ b/packages/world/src/modules/core/implementations/EphemeralRecordSystem.sol @@ -18,7 +18,7 @@ contract EphemeralRecordSystem is IStoreEphemeral, System { */ function emitEphemeralRecord( bytes32 resourceSelector, - bytes32[] calldata key, + bytes32[] calldata keyTuple, bytes calldata data, FieldLayout fieldLayout ) public virtual { @@ -26,6 +26,6 @@ contract EphemeralRecordSystem is IStoreEphemeral, System { AccessControl.requireAccess(resourceSelector, msg.sender); // Set the record - StoreCore.emitEphemeralRecord(resourceSelector, key, data, fieldLayout); + StoreCore.emitEphemeralRecord(resourceSelector, keyTuple, data, fieldLayout); } } diff --git a/packages/world/src/modules/keysintable/KeysInTableHook.sol b/packages/world/src/modules/keysintable/KeysInTableHook.sol index 1953bea6ea..6f4dea57f3 100644 --- a/packages/world/src/modules/keysintable/KeysInTableHook.sol +++ b/packages/world/src/modules/keysintable/KeysInTableHook.sol @@ -8,61 +8,61 @@ import { KeysInTable } from "./tables/KeysInTable.sol"; import { UsedKeysIndex } from "./tables/UsedKeysIndex.sol"; /** - * Note: if a tableId with composite keys is used, only the first key is indexed + * Note: if a tableId with composite keys is used, only the first five keys of the tuple are indexed */ contract KeysInTableHook is StoreHook { - function handleSet(bytes32 tableId, bytes32[] memory key) internal { - bytes32 keysHash = keccak256(abi.encode(key)); + function handleSet(bytes32 tableId, bytes32[] memory keyTuple) internal { + bytes32 keysHash = keccak256(abi.encode(keyTuple)); - // If the key has not yet been set in the table... + // If the keyTuple has not yet been set in the table... if (!UsedKeysIndex.getHas(tableId, keysHash)) { uint40 length = uint40(KeysInTable.lengthKeys0(tableId)); - // Push the key to the list of keys in this table - if (key.length > 0) { - KeysInTable.pushKeys0(tableId, key[0]); - if (key.length > 1) { - KeysInTable.pushKeys1(tableId, key[1]); - if (key.length > 2) { - KeysInTable.pushKeys2(tableId, key[2]); - if (key.length > 3) { - KeysInTable.pushKeys3(tableId, key[3]); - if (key.length > 4) { - KeysInTable.pushKeys4(tableId, key[4]); + // Push the keyTuple to the list of keys in this tableId + if (keyTuple.length > 0) { + KeysInTable.pushKeys0(tableId, keyTuple[0]); + if (keyTuple.length > 1) { + KeysInTable.pushKeys1(tableId, keyTuple[1]); + if (keyTuple.length > 2) { + KeysInTable.pushKeys2(tableId, keyTuple[2]); + if (keyTuple.length > 3) { + KeysInTable.pushKeys3(tableId, keyTuple[3]); + if (keyTuple.length > 4) { + KeysInTable.pushKeys4(tableId, keyTuple[4]); } } } } } - // Update the index to avoid duplicating this key in the array + // Update the index to avoid duplicating this keyTuple in the array UsedKeysIndex.set(tableId, keysHash, true, length); } } - function onBeforeSetRecord(bytes32 tableId, bytes32[] memory key, bytes memory, FieldLayout) public { - handleSet(tableId, key); + function onBeforeSetRecord(bytes32 tableId, bytes32[] memory keyTuple, bytes memory, FieldLayout) public { + handleSet(tableId, keyTuple); } - function onAfterSetRecord(bytes32 tableId, bytes32[] memory key, bytes memory, FieldLayout) public { + function onAfterSetRecord(bytes32 tableId, bytes32[] memory keyTuple, bytes memory, FieldLayout) public { // NOOP } - function onBeforeSetField(bytes32 tableId, bytes32[] memory key, uint8, bytes memory, FieldLayout) public { + function onBeforeSetField(bytes32 tableId, bytes32[] memory keyTuple, uint8, bytes memory, FieldLayout) public { // NOOP } - function onAfterSetField(bytes32 tableId, bytes32[] memory key, uint8, bytes memory, FieldLayout) public { - handleSet(tableId, key); + function onAfterSetField(bytes32 tableId, bytes32[] memory keyTuple, uint8, bytes memory, FieldLayout) public { + handleSet(tableId, keyTuple); } - function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout) public { - bytes32 keysHash = keccak256(abi.encode(key)); + function onBeforeDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout) public { + bytes32 keysHash = keccak256(abi.encode(keyTuple)); (bool has, uint40 index) = UsedKeysIndex.get(tableId, keysHash); - // If the key was part of the table... + // If the keyTuple was part of the table... if (has) { - // Delete the index as the key is not in the table + // Delete the index as the keyTuple is not in the table anymore UsedKeysIndex.deleteRecord(tableId, keysHash); uint40 length = uint40(KeysInTable.lengthKeys0(tableId)); @@ -71,37 +71,38 @@ contract KeysInTableHook is StoreHook { // Delete the list of keys in this table KeysInTable.deleteRecord(tableId); } else { - if (key.length > 0) { - bytes32[] memory lastKeyTuple = new bytes32[](key.length); + if (keyTuple.length > 0) { + bytes32[] memory lastKeyTuple = new bytes32[](keyTuple.length); bytes32 lastKey = KeysInTable.getItemKeys0(tableId, length - 1); lastKeyTuple[0] = lastKey; + // Remove the keyTuple from the list of keys in this table KeysInTable.updateKeys0(tableId, index, lastKey); KeysInTable.popKeys0(tableId); - if (key.length > 1) { + if (keyTuple.length > 1) { lastKey = KeysInTable.getItemKeys1(tableId, length - 1); lastKeyTuple[1] = lastKey; KeysInTable.updateKeys1(tableId, index, lastKey); KeysInTable.popKeys1(tableId); - if (key.length > 2) { + if (keyTuple.length > 2) { lastKey = KeysInTable.getItemKeys2(tableId, length - 1); lastKeyTuple[2] = lastKey; KeysInTable.updateKeys2(tableId, index, lastKey); KeysInTable.popKeys2(tableId); - if (key.length > 3) { + if (keyTuple.length > 3) { lastKey = KeysInTable.getItemKeys3(tableId, length - 1); lastKeyTuple[3] = lastKey; KeysInTable.updateKeys3(tableId, index, lastKey); KeysInTable.popKeys3(tableId); - if (key.length > 4) { + if (keyTuple.length > 4) { lastKey = KeysInTable.getItemKeys4(tableId, length - 1); lastKeyTuple[4] = lastKey; @@ -112,7 +113,7 @@ contract KeysInTableHook is StoreHook { } } - // Update the index of lastKey after swapping it with the deleted key + // Update the index of lastKey after swapping it with the deleted keyTuple bytes32 lastKeyHash = keccak256(abi.encode(lastKeyTuple)); UsedKeysIndex.setIndex(tableId, lastKeyHash, index); } @@ -120,7 +121,7 @@ contract KeysInTableHook is StoreHook { } } - function onAfterDeleteRecord(bytes32 tableId, bytes32[] memory key, FieldLayout fieldLayout) public { + function onAfterDeleteRecord(bytes32 tableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) public { // NOOP } } diff --git a/packages/world/src/modules/keysintable/hasKey.sol b/packages/world/src/modules/keysintable/hasKey.sol index d085a63e6c..637439047e 100644 --- a/packages/world/src/modules/keysintable/hasKey.sol +++ b/packages/world/src/modules/keysintable/hasKey.sol @@ -6,22 +6,22 @@ import { IStore } from "@latticexyz/store/src/IStore.sol"; import { UsedKeysIndex } from "./tables/UsedKeysIndex.sol"; /** - * Get whether the key is in the given table. + * Get whether the keyTuple is in the given table. * * Note: this util can only be called within the context of a Store (e.g. from a System or Module). * For usage outside of a Store, use the overload that takes an explicit store argument. */ -function hasKey(bytes32 tableId, bytes32[] memory key) view returns (bool) { - bytes32 keysHash = keccak256(abi.encode(key)); +function hasKey(bytes32 tableId, bytes32[] memory keyTuple) view returns (bool) { + bytes32 keysHash = keccak256(abi.encode(keyTuple)); return UsedKeysIndex.getHas(tableId, keysHash); } /** - * Get whether the key is in the given table for the given store. + * Get whether the keyTuple is in the given table for the given store. */ -function hasKey(IStore store, bytes32 tableId, bytes32[] memory key) view returns (bool) { - bytes32 keysHash = keccak256(abi.encode(key)); +function hasKey(IStore store, bytes32 tableId, bytes32[] memory keyTuple) view returns (bool) { + bytes32 keysHash = keccak256(abi.encode(keyTuple)); return UsedKeysIndex.getHas(store, tableId, keysHash); } diff --git a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol index 63e66ed8d1..f0326407cd 100644 --- a/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol +++ b/packages/world/src/modules/keyswithvalue/KeysWithValueHook.sol @@ -19,7 +19,7 @@ import { getTargetTableSelector } from "../utils/getTargetTableSelector.sol"; * We can optimize this by adding support for `setIndexOfField` in Store * (See https://github.com/latticexyz/mud/issues/444) * - * Note: if a table with composite keys is used, only the first key is indexed + * Note: if a table with composite keys is used, only the first key of the tuple is indexed */ contract KeysWithValueHook is StoreHook { using ArrayLib for bytes32[]; @@ -31,25 +31,25 @@ contract KeysWithValueHook is StoreHook { function onBeforeSetRecord( bytes32 sourceTableId, - bytes32[] memory key, + bytes32[] memory keyTuple, bytes memory data, FieldLayout fieldLayout ) public { bytes32 targetTableId = getTargetTableSelector(MODULE_NAMESPACE, sourceTableId); // Get the previous value - bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, key, fieldLayout)); + bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, keyTuple, fieldLayout)); // Remove the key from the list of keys with the previous value - _removeKeyFromList(targetTableId, key[0], previousValue); + _removeKeyFromList(targetTableId, keyTuple[0], previousValue); // Push the key to the list of keys with the new value - KeysWithValue.push(targetTableId, keccak256(data), key[0]); + KeysWithValue.push(targetTableId, keccak256(data), keyTuple[0]); } function onAfterSetRecord( bytes32 sourceTableId, - bytes32[] memory key, + bytes32[] memory keyTuple, bytes memory data, FieldLayout fieldLayout ) public { @@ -58,38 +58,38 @@ contract KeysWithValueHook is StoreHook { function onBeforeSetField( bytes32 sourceTableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8, bytes memory, FieldLayout fieldLayout ) public { // Remove the key from the list of keys with the previous value - bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, key, fieldLayout)); + bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, keyTuple, fieldLayout)); bytes32 targetTableId = getTargetTableSelector(MODULE_NAMESPACE, sourceTableId); - _removeKeyFromList(targetTableId, key[0], previousValue); + _removeKeyFromList(targetTableId, keyTuple[0], previousValue); } function onAfterSetField( bytes32 sourceTableId, - bytes32[] memory key, + bytes32[] memory keyTuple, uint8, bytes memory, FieldLayout fieldLayout ) public { // Add the key to the list of keys with the new value - bytes32 newValue = keccak256(_world().getRecord(sourceTableId, key, fieldLayout)); + bytes32 newValue = keccak256(_world().getRecord(sourceTableId, keyTuple, fieldLayout)); bytes32 targetTableId = getTargetTableSelector(MODULE_NAMESPACE, sourceTableId); - KeysWithValue.push(targetTableId, newValue, key[0]); + KeysWithValue.push(targetTableId, newValue, keyTuple[0]); } - function onBeforeDeleteRecord(bytes32 sourceTableId, bytes32[] memory key, FieldLayout fieldLayout) public { + function onBeforeDeleteRecord(bytes32 sourceTableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) public { // Remove the key from the list of keys with the previous value - bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, key, fieldLayout)); + bytes32 previousValue = keccak256(_world().getRecord(sourceTableId, keyTuple, fieldLayout)); bytes32 targetTableId = getTargetTableSelector(MODULE_NAMESPACE, sourceTableId); - _removeKeyFromList(targetTableId, key[0], previousValue); + _removeKeyFromList(targetTableId, keyTuple[0], previousValue); } - function onAfterDeleteRecord(bytes32 sourceTableId, bytes32[] memory key, FieldLayout fieldLayout) public { + function onAfterDeleteRecord(bytes32 sourceTableId, bytes32[] memory keyTuple, FieldLayout fieldLayout) public { // NOOP } diff --git a/packages/world/test/World.t.sol b/packages/world/test/World.t.sol index 640782c591..1d6e8a2b85 100644 --- a/packages/world/test/World.t.sol +++ b/packages/world/test/World.t.sol @@ -86,14 +86,14 @@ contract WorldTestSystem is System { } function writeData(bytes16 namespace, bytes16 name, bool data) public { - bytes32[] memory key = new bytes32[](0); + bytes32[] memory keyTuple = new bytes32[](0); bytes32 tableId = ResourceSelector.from(namespace, name); FieldLayout fieldLayout = StoreSwitch.getFieldLayout(tableId); if (StoreSwitch.getStoreAddress() == address(this)) { - StoreCore.setRecord(tableId, key, abi.encodePacked(data), fieldLayout); + StoreCore.setRecord(tableId, keyTuple, abi.encodePacked(data), fieldLayout); } else { - IBaseWorld(msg.sender).setRecord(tableId, key, abi.encodePacked(data), fieldLayout); + IBaseWorld(msg.sender).setRecord(tableId, keyTuple, abi.encodePacked(data), fieldLayout); } } diff --git a/packages/world/test/query.t.sol b/packages/world/test/query.t.sol index 4c4feb2176..0d7b3b63f8 100644 --- a/packages/world/test/query.t.sol +++ b/packages/world/test/query.t.sol @@ -297,9 +297,9 @@ contract QueryTest is Test, GasReporter { _installKeysInTableModule(); for (uint256 i; i < 100; i++) { - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32(i); - world.setRecord(table1, key, abi.encode(1), tableFieldLayout); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32(i); + world.setRecord(table1, keyTuple, abi.encode(1), tableFieldLayout); } world.setRecord(table2, key1, abi.encode(0), tableFieldLayout); @@ -318,9 +318,9 @@ contract QueryTest is Test, GasReporter { _installKeysInTableModule(); for (uint256 i; i < 1000; i++) { - bytes32[] memory key = new bytes32[](1); - key[0] = bytes32(i); - world.setRecord(table1, key, abi.encode(1), tableFieldLayout); + bytes32[] memory keyTuple = new bytes32[](1); + keyTuple[0] = bytes32(i); + world.setRecord(table1, keyTuple, abi.encode(1), tableFieldLayout); } world.setRecord(table2, key1, abi.encode(0), tableFieldLayout);