From 5fdbb1277c8936c7bbf620d8c8670f2ce6671b0d Mon Sep 17 00:00:00 2001 From: Ori Pomeerantz Date: Fri, 29 Sep 2023 22:03:28 -0500 Subject: [PATCH] docs(natspec): combined codegen PR --- .../src/codegen/tables/Dynamics1.sol | 420 ++++++++++++------ .../src/codegen/tables/Dynamics2.sol | 252 +++++++---- .../contracts/src/codegen/tables/Offchain.sol | 12 +- .../src/codegen/tables/Singleton.sol | 276 ++++++++---- .../contracts/src/codegen/tables/Statics.sol | 144 ++++-- .../src/codegen/tables/UserTyped.sol | 120 +++-- packages/store/src/codegen/tables/Hooks.sol | 168 ++++--- .../store/src/codegen/tables/ResourceIds.sol | 48 +- .../store/src/codegen/tables/StoreHooks.sol | 168 ++++--- packages/store/src/codegen/tables/Tables.sol | 240 +++++++--- .../store/test/codegen/tables/Callbacks.sol | 168 ++++--- .../store/test/codegen/tables/KeyEncoding.sol | 48 +- packages/store/test/codegen/tables/Mixed.sol | 216 ++++++--- .../store/test/codegen/tables/Vector2.sol | 48 +- packages/store/ts/codegen/field.ts | 34 +- .../src/interfaces/IBaseWorld.sol | 5 +- .../keysintable/tables/KeysInTable.sol | 420 ++++++++++++------ .../keysintable/tables/UsedKeysIndex.sol | 48 +- .../keyswithvalue/tables/KeysWithValue.sol | 168 ++++--- .../tables/CallboundDelegations.sol | 48 +- .../tables/TimeboundDelegations.sol | 48 +- .../uniqueentity/tables/UniqueEntity.sol | 48 +- .../src/codegen/interfaces/IBaseWorld.sol | 5 +- .../world/src/codegen/tables/Balances.sol | 48 +- .../src/codegen/tables/FunctionSelectors.sol | 48 +- .../src/codegen/tables/InstalledModules.sol | 48 +- .../tables/NamespaceDelegationControl.sol | 48 +- .../src/codegen/tables/NamespaceOwner.sol | 48 +- .../src/codegen/tables/ResourceAccess.sol | 48 +- .../world/src/codegen/tables/SystemHooks.sol | 168 ++++--- .../src/codegen/tables/SystemRegistry.sol | 48 +- packages/world/src/codegen/tables/Systems.sol | 48 +- .../codegen/tables/UserDelegationControl.sol | 48 +- .../test/codegen/tables/AddressArray.sol | 168 ++++--- packages/world/test/codegen/tables/Bool.sol | 48 +- .../world/test/codegen/tables/TwoFields.sol | 48 +- .../ts/node/render-solidity/renderWorld.ts | 5 +- 37 files changed, 2818 insertions(+), 1203 deletions(-) diff --git a/packages/cli/contracts/src/codegen/tables/Dynamics1.sol b/packages/cli/contracts/src/codegen/tables/Dynamics1.sol index 4d40e8f720..1ca376b098 100644 --- a/packages/cli/contracts/src/codegen/tables/Dynamics1.sol +++ b/packages/cli/contracts/src/codegen/tables/Dynamics1.sol @@ -94,7 +94,9 @@ library Dynamics1 { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get staticB32 */ + /** + * @notice Get staticB32 + */ function getStaticB32(bytes32 key) internal view returns (bytes32[1] memory staticB32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -103,7 +105,9 @@ library Dynamics1 { return toStaticArray_bytes32_1(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get staticB32 */ + /** + * @notice Get staticB32 + */ function _getStaticB32(bytes32 key) internal view returns (bytes32[1] memory staticB32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -112,7 +116,9 @@ library Dynamics1 { return toStaticArray_bytes32_1(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get staticB32 (using the specified store) */ + /** + * @notice Get staticB32 (using the specified store) + */ function getStaticB32(IStore _store, bytes32 key) internal view returns (bytes32[1] memory staticB32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -121,7 +127,9 @@ library Dynamics1 { return toStaticArray_bytes32_1(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Set staticB32 */ + /** + * @notice Set staticB32 + */ function setStaticB32(bytes32 key, bytes32[1] memory staticB32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -129,7 +137,9 @@ library Dynamics1 { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode(fromStaticArray_bytes32_1(staticB32))); } - /** Set staticB32 */ + /** + * @notice Set staticB32 + */ function _setStaticB32(bytes32 key, bytes32[1] memory staticB32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -137,7 +147,9 @@ library Dynamics1 { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode(fromStaticArray_bytes32_1(staticB32))); } - /** Set staticB32 (using the specified store) */ + /** + * @notice Set staticB32 (using the specified store) + */ function setStaticB32(IStore _store, bytes32 key, bytes32[1] memory staticB32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -145,7 +157,9 @@ library Dynamics1 { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode(fromStaticArray_bytes32_1(staticB32))); } - /** Get the length of staticB32 */ + /** + * @notice Get length of staticB32 + */ function lengthStaticB32(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -156,7 +170,9 @@ library Dynamics1 { } } - /** Get the length of staticB32 */ + /** + * @notice Get length of staticB32 + */ function _lengthStaticB32(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -167,7 +183,9 @@ library Dynamics1 { } } - /** Get the length of staticB32 (using the specified store) */ + /** + * @notice Get length of staticB32 (using the specified store) + */ function lengthStaticB32(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -179,8 +197,8 @@ library Dynamics1 { } /** - * Get an item of staticB32 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticB32 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticB32(bytes32 key, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -193,8 +211,8 @@ library Dynamics1 { } /** - * Get an item of staticB32 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticB32 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemStaticB32(bytes32 key, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -207,8 +225,8 @@ library Dynamics1 { } /** - * Get an item of staticB32 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticB32 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticB32(IStore _store, bytes32 key, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -220,7 +238,9 @@ library Dynamics1 { } } - /** Push an element to staticB32 */ + /** + * @notice Push an element to staticB32 + */ function pushStaticB32(bytes32 key, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -228,7 +248,9 @@ library Dynamics1 { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to staticB32 */ + /** + * @notice Push an element to staticB32 + */ function _pushStaticB32(bytes32 key, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -236,7 +258,9 @@ library Dynamics1 { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to staticB32 (using the specified store) */ + /** + * @notice Push an element to staticB32 (using the specified store) + */ function pushStaticB32(IStore _store, bytes32 key, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -244,7 +268,9 @@ library Dynamics1 { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from staticB32 */ + /** + * @notice Pop an element from staticB32 + */ function popStaticB32(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -252,7 +278,9 @@ library Dynamics1 { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from staticB32 */ + /** + * @notice Pop an element from staticB32 + */ function _popStaticB32(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -260,7 +288,9 @@ library Dynamics1 { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from staticB32 (using the specified store) */ + /** + * @notice Pop an element from staticB32 (using the specified store) + */ function popStaticB32(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -269,8 +299,8 @@ library Dynamics1 { } /** - * Update an element of staticB32 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticB32 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticB32(bytes32 key, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -283,8 +313,8 @@ library Dynamics1 { } /** - * Update an element of staticB32 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticB32 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateStaticB32(bytes32 key, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -297,8 +327,8 @@ library Dynamics1 { } /** - * Update an element of staticB32 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticB32 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticB32(IStore _store, bytes32 key, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -310,7 +340,9 @@ library Dynamics1 { } } - /** Get staticI32 */ + /** + * @notice Get staticI32 + */ function getStaticI32(bytes32 key) internal view returns (int32[2] memory staticI32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -319,7 +351,9 @@ library Dynamics1 { return toStaticArray_int32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_int32()); } - /** Get staticI32 */ + /** + * @notice Get staticI32 + */ function _getStaticI32(bytes32 key) internal view returns (int32[2] memory staticI32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -328,7 +362,9 @@ library Dynamics1 { return toStaticArray_int32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_int32()); } - /** Get staticI32 (using the specified store) */ + /** + * @notice Get staticI32 (using the specified store) + */ function getStaticI32(IStore _store, bytes32 key) internal view returns (int32[2] memory staticI32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -337,7 +373,9 @@ library Dynamics1 { return toStaticArray_int32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_int32()); } - /** Set staticI32 */ + /** + * @notice Set staticI32 + */ function setStaticI32(bytes32 key, int32[2] memory staticI32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -345,7 +383,9 @@ library Dynamics1 { StoreSwitch.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode(fromStaticArray_int32_2(staticI32))); } - /** Set staticI32 */ + /** + * @notice Set staticI32 + */ function _setStaticI32(bytes32 key, int32[2] memory staticI32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -353,7 +393,9 @@ library Dynamics1 { StoreCore.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode(fromStaticArray_int32_2(staticI32))); } - /** Set staticI32 (using the specified store) */ + /** + * @notice Set staticI32 (using the specified store) + */ function setStaticI32(IStore _store, bytes32 key, int32[2] memory staticI32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -361,7 +403,9 @@ library Dynamics1 { _store.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode(fromStaticArray_int32_2(staticI32))); } - /** Get the length of staticI32 */ + /** + * @notice Get length of staticI32 + */ function lengthStaticI32(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -372,7 +416,9 @@ library Dynamics1 { } } - /** Get the length of staticI32 */ + /** + * @notice Get length of staticI32 + */ function _lengthStaticI32(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -383,7 +429,9 @@ library Dynamics1 { } } - /** Get the length of staticI32 (using the specified store) */ + /** + * @notice Get length of staticI32 (using the specified store) + */ function lengthStaticI32(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -395,8 +443,8 @@ library Dynamics1 { } /** - * Get an item of staticI32 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticI32 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticI32(bytes32 key, uint256 _index) internal view returns (int32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -409,8 +457,8 @@ library Dynamics1 { } /** - * Get an item of staticI32 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticI32 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemStaticI32(bytes32 key, uint256 _index) internal view returns (int32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -423,8 +471,8 @@ library Dynamics1 { } /** - * Get an item of staticI32 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticI32 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticI32(IStore _store, bytes32 key, uint256 _index) internal view returns (int32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -436,7 +484,9 @@ library Dynamics1 { } } - /** Push an element to staticI32 */ + /** + * @notice Push an element to staticI32 + */ function pushStaticI32(bytes32 key, int32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -444,7 +494,9 @@ library Dynamics1 { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Push an element to staticI32 */ + /** + * @notice Push an element to staticI32 + */ function _pushStaticI32(bytes32 key, int32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -452,7 +504,9 @@ library Dynamics1 { StoreCore.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Push an element to staticI32 (using the specified store) */ + /** + * @notice Push an element to staticI32 (using the specified store) + */ function pushStaticI32(IStore _store, bytes32 key, int32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -460,7 +514,9 @@ library Dynamics1 { _store.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Pop an element from staticI32 */ + /** + * @notice Pop an element from staticI32 + */ function popStaticI32(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -468,7 +524,9 @@ library Dynamics1 { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 1, 4); } - /** Pop an element from staticI32 */ + /** + * @notice Pop an element from staticI32 + */ function _popStaticI32(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -476,7 +534,9 @@ library Dynamics1 { StoreCore.popFromDynamicField(_tableId, _keyTuple, 1, 4); } - /** Pop an element from staticI32 (using the specified store) */ + /** + * @notice Pop an element from staticI32 (using the specified store) + */ function popStaticI32(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -485,8 +545,8 @@ library Dynamics1 { } /** - * Update an element of staticI32 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticI32 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticI32(bytes32 key, uint256 _index, int32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -499,8 +559,8 @@ library Dynamics1 { } /** - * Update an element of staticI32 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticI32 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateStaticI32(bytes32 key, uint256 _index, int32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -513,8 +573,8 @@ library Dynamics1 { } /** - * Update an element of staticI32 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticI32 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticI32(IStore _store, bytes32 key, uint256 _index, int32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -526,7 +586,9 @@ library Dynamics1 { } } - /** Get staticU128 */ + /** + * @notice Get staticU128 + */ function getStaticU128(bytes32 key) internal view returns (uint128[3] memory staticU128) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -535,7 +597,9 @@ library Dynamics1 { return toStaticArray_uint128_3(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint128()); } - /** Get staticU128 */ + /** + * @notice Get staticU128 + */ function _getStaticU128(bytes32 key) internal view returns (uint128[3] memory staticU128) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -544,7 +608,9 @@ library Dynamics1 { return toStaticArray_uint128_3(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint128()); } - /** Get staticU128 (using the specified store) */ + /** + * @notice Get staticU128 (using the specified store) + */ function getStaticU128(IStore _store, bytes32 key) internal view returns (uint128[3] memory staticU128) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -553,7 +619,9 @@ library Dynamics1 { return toStaticArray_uint128_3(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint128()); } - /** Set staticU128 */ + /** + * @notice Set staticU128 + */ function setStaticU128(bytes32 key, uint128[3] memory staticU128) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -561,7 +629,9 @@ library Dynamics1 { StoreSwitch.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode(fromStaticArray_uint128_3(staticU128))); } - /** Set staticU128 */ + /** + * @notice Set staticU128 + */ function _setStaticU128(bytes32 key, uint128[3] memory staticU128) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -569,7 +639,9 @@ library Dynamics1 { StoreCore.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode(fromStaticArray_uint128_3(staticU128))); } - /** Set staticU128 (using the specified store) */ + /** + * @notice Set staticU128 (using the specified store) + */ function setStaticU128(IStore _store, bytes32 key, uint128[3] memory staticU128) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -577,7 +649,9 @@ library Dynamics1 { _store.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode(fromStaticArray_uint128_3(staticU128))); } - /** Get the length of staticU128 */ + /** + * @notice Get length of staticU128 + */ function lengthStaticU128(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -588,7 +662,9 @@ library Dynamics1 { } } - /** Get the length of staticU128 */ + /** + * @notice Get length of staticU128 + */ function _lengthStaticU128(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -599,7 +675,9 @@ library Dynamics1 { } } - /** Get the length of staticU128 (using the specified store) */ + /** + * @notice Get length of staticU128 (using the specified store) + */ function lengthStaticU128(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -611,8 +689,8 @@ library Dynamics1 { } /** - * Get an item of staticU128 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticU128 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticU128(bytes32 key, uint256 _index) internal view returns (uint128) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -625,8 +703,8 @@ library Dynamics1 { } /** - * Get an item of staticU128 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticU128 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemStaticU128(bytes32 key, uint256 _index) internal view returns (uint128) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -639,8 +717,8 @@ library Dynamics1 { } /** - * Get an item of staticU128 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticU128 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticU128(IStore _store, bytes32 key, uint256 _index) internal view returns (uint128) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -652,7 +730,9 @@ library Dynamics1 { } } - /** Push an element to staticU128 */ + /** + * @notice Push an element to staticU128 + */ function pushStaticU128(bytes32 key, uint128 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -660,7 +740,9 @@ library Dynamics1 { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Push an element to staticU128 */ + /** + * @notice Push an element to staticU128 + */ function _pushStaticU128(bytes32 key, uint128 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -668,7 +750,9 @@ library Dynamics1 { StoreCore.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Push an element to staticU128 (using the specified store) */ + /** + * @notice Push an element to staticU128 (using the specified store) + */ function pushStaticU128(IStore _store, bytes32 key, uint128 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -676,7 +760,9 @@ library Dynamics1 { _store.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Pop an element from staticU128 */ + /** + * @notice Pop an element from staticU128 + */ function popStaticU128(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -684,7 +770,9 @@ library Dynamics1 { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 2, 16); } - /** Pop an element from staticU128 */ + /** + * @notice Pop an element from staticU128 + */ function _popStaticU128(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -692,7 +780,9 @@ library Dynamics1 { StoreCore.popFromDynamicField(_tableId, _keyTuple, 2, 16); } - /** Pop an element from staticU128 (using the specified store) */ + /** + * @notice Pop an element from staticU128 (using the specified store) + */ function popStaticU128(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -701,8 +791,8 @@ library Dynamics1 { } /** - * Update an element of staticU128 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticU128 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticU128(bytes32 key, uint256 _index, uint128 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -715,8 +805,8 @@ library Dynamics1 { } /** - * Update an element of staticU128 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticU128 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateStaticU128(bytes32 key, uint256 _index, uint128 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -729,8 +819,8 @@ library Dynamics1 { } /** - * Update an element of staticU128 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticU128 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticU128(IStore _store, bytes32 key, uint256 _index, uint128 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -742,7 +832,9 @@ library Dynamics1 { } } - /** Get staticAddrs */ + /** + * @notice Get staticAddrs + */ function getStaticAddrs(bytes32 key) internal view returns (address[4] memory staticAddrs) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -751,7 +843,9 @@ library Dynamics1 { return toStaticArray_address_4(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Get staticAddrs */ + /** + * @notice Get staticAddrs + */ function _getStaticAddrs(bytes32 key) internal view returns (address[4] memory staticAddrs) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -760,7 +854,9 @@ library Dynamics1 { return toStaticArray_address_4(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Get staticAddrs (using the specified store) */ + /** + * @notice Get staticAddrs (using the specified store) + */ function getStaticAddrs(IStore _store, bytes32 key) internal view returns (address[4] memory staticAddrs) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -769,7 +865,9 @@ library Dynamics1 { return toStaticArray_address_4(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Set staticAddrs */ + /** + * @notice Set staticAddrs + */ function setStaticAddrs(bytes32 key, address[4] memory staticAddrs) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -777,7 +875,9 @@ library Dynamics1 { StoreSwitch.setDynamicField(_tableId, _keyTuple, 3, EncodeArray.encode(fromStaticArray_address_4(staticAddrs))); } - /** Set staticAddrs */ + /** + * @notice Set staticAddrs + */ function _setStaticAddrs(bytes32 key, address[4] memory staticAddrs) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -785,7 +885,9 @@ library Dynamics1 { StoreCore.setDynamicField(_tableId, _keyTuple, 3, EncodeArray.encode(fromStaticArray_address_4(staticAddrs))); } - /** Set staticAddrs (using the specified store) */ + /** + * @notice Set staticAddrs (using the specified store) + */ function setStaticAddrs(IStore _store, bytes32 key, address[4] memory staticAddrs) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -793,7 +895,9 @@ library Dynamics1 { _store.setDynamicField(_tableId, _keyTuple, 3, EncodeArray.encode(fromStaticArray_address_4(staticAddrs))); } - /** Get the length of staticAddrs */ + /** + * @notice Get length of staticAddrs + */ function lengthStaticAddrs(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -804,7 +908,9 @@ library Dynamics1 { } } - /** Get the length of staticAddrs */ + /** + * @notice Get length of staticAddrs + */ function _lengthStaticAddrs(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -815,7 +921,9 @@ library Dynamics1 { } } - /** Get the length of staticAddrs (using the specified store) */ + /** + * @notice Get length of staticAddrs (using the specified store) + */ function lengthStaticAddrs(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -827,8 +935,8 @@ library Dynamics1 { } /** - * Get an item of staticAddrs - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticAddrs + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticAddrs(bytes32 key, uint256 _index) internal view returns (address) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -841,8 +949,8 @@ library Dynamics1 { } /** - * Get an item of staticAddrs - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticAddrs + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemStaticAddrs(bytes32 key, uint256 _index) internal view returns (address) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -855,8 +963,8 @@ library Dynamics1 { } /** - * Get an item of staticAddrs (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticAddrs (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticAddrs(IStore _store, bytes32 key, uint256 _index) internal view returns (address) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -868,7 +976,9 @@ library Dynamics1 { } } - /** Push an element to staticAddrs */ + /** + * @notice Push an element to staticAddrs + */ function pushStaticAddrs(bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -876,7 +986,9 @@ library Dynamics1 { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 3, abi.encodePacked((_element))); } - /** Push an element to staticAddrs */ + /** + * @notice Push an element to staticAddrs + */ function _pushStaticAddrs(bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -884,7 +996,9 @@ library Dynamics1 { StoreCore.pushToDynamicField(_tableId, _keyTuple, 3, abi.encodePacked((_element))); } - /** Push an element to staticAddrs (using the specified store) */ + /** + * @notice Push an element to staticAddrs (using the specified store) + */ function pushStaticAddrs(IStore _store, bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -892,7 +1006,9 @@ library Dynamics1 { _store.pushToDynamicField(_tableId, _keyTuple, 3, abi.encodePacked((_element))); } - /** Pop an element from staticAddrs */ + /** + * @notice Pop an element from staticAddrs + */ function popStaticAddrs(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -900,7 +1016,9 @@ library Dynamics1 { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 3, 20); } - /** Pop an element from staticAddrs */ + /** + * @notice Pop an element from staticAddrs + */ function _popStaticAddrs(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -908,7 +1026,9 @@ library Dynamics1 { StoreCore.popFromDynamicField(_tableId, _keyTuple, 3, 20); } - /** Pop an element from staticAddrs (using the specified store) */ + /** + * @notice Pop an element from staticAddrs (using the specified store) + */ function popStaticAddrs(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -917,8 +1037,8 @@ library Dynamics1 { } /** - * Update an element of staticAddrs at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticAddrs at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticAddrs(bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -931,8 +1051,8 @@ library Dynamics1 { } /** - * Update an element of staticAddrs at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticAddrs at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateStaticAddrs(bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -945,8 +1065,8 @@ library Dynamics1 { } /** - * Update an element of staticAddrs (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticAddrs (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticAddrs(IStore _store, bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -958,7 +1078,9 @@ library Dynamics1 { } } - /** Get staticBools */ + /** + * @notice Get staticBools + */ function getStaticBools(bytes32 key) internal view returns (bool[5] memory staticBools) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -967,7 +1089,9 @@ library Dynamics1 { return toStaticArray_bool_5(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bool()); } - /** Get staticBools */ + /** + * @notice Get staticBools + */ function _getStaticBools(bytes32 key) internal view returns (bool[5] memory staticBools) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -976,7 +1100,9 @@ library Dynamics1 { return toStaticArray_bool_5(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bool()); } - /** Get staticBools (using the specified store) */ + /** + * @notice Get staticBools (using the specified store) + */ function getStaticBools(IStore _store, bytes32 key) internal view returns (bool[5] memory staticBools) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -985,7 +1111,9 @@ library Dynamics1 { return toStaticArray_bool_5(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bool()); } - /** Set staticBools */ + /** + * @notice Set staticBools + */ function setStaticBools(bytes32 key, bool[5] memory staticBools) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -993,7 +1121,9 @@ library Dynamics1 { StoreSwitch.setDynamicField(_tableId, _keyTuple, 4, EncodeArray.encode(fromStaticArray_bool_5(staticBools))); } - /** Set staticBools */ + /** + * @notice Set staticBools + */ function _setStaticBools(bytes32 key, bool[5] memory staticBools) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1001,7 +1131,9 @@ library Dynamics1 { StoreCore.setDynamicField(_tableId, _keyTuple, 4, EncodeArray.encode(fromStaticArray_bool_5(staticBools))); } - /** Set staticBools (using the specified store) */ + /** + * @notice Set staticBools (using the specified store) + */ function setStaticBools(IStore _store, bytes32 key, bool[5] memory staticBools) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1009,7 +1141,9 @@ library Dynamics1 { _store.setDynamicField(_tableId, _keyTuple, 4, EncodeArray.encode(fromStaticArray_bool_5(staticBools))); } - /** Get the length of staticBools */ + /** + * @notice Get length of staticBools + */ function lengthStaticBools(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1020,7 +1154,9 @@ library Dynamics1 { } } - /** Get the length of staticBools */ + /** + * @notice Get length of staticBools + */ function _lengthStaticBools(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1031,7 +1167,9 @@ library Dynamics1 { } } - /** Get the length of staticBools (using the specified store) */ + /** + * @notice Get length of staticBools (using the specified store) + */ function lengthStaticBools(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1043,8 +1181,8 @@ library Dynamics1 { } /** - * Get an item of staticBools - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticBools + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticBools(bytes32 key, uint256 _index) internal view returns (bool) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1057,8 +1195,8 @@ library Dynamics1 { } /** - * Get an item of staticBools - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticBools + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemStaticBools(bytes32 key, uint256 _index) internal view returns (bool) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1071,8 +1209,8 @@ library Dynamics1 { } /** - * Get an item of staticBools (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of staticBools (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStaticBools(IStore _store, bytes32 key, uint256 _index) internal view returns (bool) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1084,7 +1222,9 @@ library Dynamics1 { } } - /** Push an element to staticBools */ + /** + * @notice Push an element to staticBools + */ function pushStaticBools(bytes32 key, bool _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1092,7 +1232,9 @@ library Dynamics1 { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 4, abi.encodePacked((_element))); } - /** Push an element to staticBools */ + /** + * @notice Push an element to staticBools + */ function _pushStaticBools(bytes32 key, bool _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1100,7 +1242,9 @@ library Dynamics1 { StoreCore.pushToDynamicField(_tableId, _keyTuple, 4, abi.encodePacked((_element))); } - /** Push an element to staticBools (using the specified store) */ + /** + * @notice Push an element to staticBools (using the specified store) + */ function pushStaticBools(IStore _store, bytes32 key, bool _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1108,7 +1252,9 @@ library Dynamics1 { _store.pushToDynamicField(_tableId, _keyTuple, 4, abi.encodePacked((_element))); } - /** Pop an element from staticBools */ + /** + * @notice Pop an element from staticBools + */ function popStaticBools(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1116,7 +1262,9 @@ library Dynamics1 { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 4, 1); } - /** Pop an element from staticBools */ + /** + * @notice Pop an element from staticBools + */ function _popStaticBools(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1124,7 +1272,9 @@ library Dynamics1 { StoreCore.popFromDynamicField(_tableId, _keyTuple, 4, 1); } - /** Pop an element from staticBools (using the specified store) */ + /** + * @notice Pop an element from staticBools (using the specified store) + */ function popStaticBools(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -1133,8 +1283,8 @@ library Dynamics1 { } /** - * Update an element of staticBools at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticBools at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticBools(bytes32 key, uint256 _index, bool _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1147,8 +1297,8 @@ library Dynamics1 { } /** - * Update an element of staticBools at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticBools at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateStaticBools(bytes32 key, uint256 _index, bool _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1161,8 +1311,8 @@ library Dynamics1 { } /** - * Update an element of staticBools (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of staticBools (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStaticBools(IStore _store, bytes32 key, uint256 _index, bool _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/cli/contracts/src/codegen/tables/Dynamics2.sol b/packages/cli/contracts/src/codegen/tables/Dynamics2.sol index 06603f02f2..9d31a6524d 100644 --- a/packages/cli/contracts/src/codegen/tables/Dynamics2.sol +++ b/packages/cli/contracts/src/codegen/tables/Dynamics2.sol @@ -88,7 +88,9 @@ library Dynamics2 { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get u64 */ + /** + * @notice Get u64 + */ function getU64(bytes32 key) internal view returns (uint64[] memory u64) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -97,7 +99,9 @@ library Dynamics2 { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint64()); } - /** Get u64 */ + /** + * @notice Get u64 + */ function _getU64(bytes32 key) internal view returns (uint64[] memory u64) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -106,7 +110,9 @@ library Dynamics2 { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint64()); } - /** Get u64 (using the specified store) */ + /** + * @notice Get u64 (using the specified store) + */ function getU64(IStore _store, bytes32 key) internal view returns (uint64[] memory u64) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -115,7 +121,9 @@ library Dynamics2 { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint64()); } - /** Set u64 */ + /** + * @notice Set u64 + */ function setU64(bytes32 key, uint64[] memory u64) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -123,7 +131,9 @@ library Dynamics2 { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((u64))); } - /** Set u64 */ + /** + * @notice Set u64 + */ function _setU64(bytes32 key, uint64[] memory u64) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -131,7 +141,9 @@ library Dynamics2 { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((u64))); } - /** Set u64 (using the specified store) */ + /** + * @notice Set u64 (using the specified store) + */ function setU64(IStore _store, bytes32 key, uint64[] memory u64) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -139,7 +151,9 @@ library Dynamics2 { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((u64))); } - /** Get the length of u64 */ + /** + * @notice Get length of u64 + */ function lengthU64(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -150,7 +164,9 @@ library Dynamics2 { } } - /** Get the length of u64 */ + /** + * @notice Get length of u64 + */ function _lengthU64(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -161,7 +177,9 @@ library Dynamics2 { } } - /** Get the length of u64 (using the specified store) */ + /** + * @notice Get length of u64 (using the specified store) + */ function lengthU64(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -173,8 +191,8 @@ library Dynamics2 { } /** - * Get an item of u64 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of u64 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemU64(bytes32 key, uint256 _index) internal view returns (uint64) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -187,8 +205,8 @@ library Dynamics2 { } /** - * Get an item of u64 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of u64 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemU64(bytes32 key, uint256 _index) internal view returns (uint64) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -201,8 +219,8 @@ library Dynamics2 { } /** - * Get an item of u64 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of u64 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemU64(IStore _store, bytes32 key, uint256 _index) internal view returns (uint64) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -214,7 +232,9 @@ library Dynamics2 { } } - /** Push an element to u64 */ + /** + * @notice Push an element to u64 + */ function pushU64(bytes32 key, uint64 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -222,7 +242,9 @@ library Dynamics2 { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to u64 */ + /** + * @notice Push an element to u64 + */ function _pushU64(bytes32 key, uint64 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -230,7 +252,9 @@ library Dynamics2 { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to u64 (using the specified store) */ + /** + * @notice Push an element to u64 (using the specified store) + */ function pushU64(IStore _store, bytes32 key, uint64 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -238,7 +262,9 @@ library Dynamics2 { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from u64 */ + /** + * @notice Pop an element from u64 + */ function popU64(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -246,7 +272,9 @@ library Dynamics2 { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 8); } - /** Pop an element from u64 */ + /** + * @notice Pop an element from u64 + */ function _popU64(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -254,7 +282,9 @@ library Dynamics2 { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 8); } - /** Pop an element from u64 (using the specified store) */ + /** + * @notice Pop an element from u64 (using the specified store) + */ function popU64(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -263,8 +293,8 @@ library Dynamics2 { } /** - * Update an element of u64 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of u64 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateU64(bytes32 key, uint256 _index, uint64 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -277,8 +307,8 @@ library Dynamics2 { } /** - * Update an element of u64 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of u64 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateU64(bytes32 key, uint256 _index, uint64 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -291,8 +321,8 @@ library Dynamics2 { } /** - * Update an element of u64 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of u64 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateU64(IStore _store, bytes32 key, uint256 _index, uint64 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -304,7 +334,9 @@ library Dynamics2 { } } - /** Get str */ + /** + * @notice Get str + */ function getStr(bytes32 key) internal view returns (string memory str) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -313,7 +345,9 @@ library Dynamics2 { return (string(_blob)); } - /** Get str */ + /** + * @notice Get str + */ function _getStr(bytes32 key) internal view returns (string memory str) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -322,7 +356,9 @@ library Dynamics2 { return (string(_blob)); } - /** Get str (using the specified store) */ + /** + * @notice Get str (using the specified store) + */ function getStr(IStore _store, bytes32 key) internal view returns (string memory str) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -331,7 +367,9 @@ library Dynamics2 { return (string(_blob)); } - /** Set str */ + /** + * @notice Set str + */ function setStr(bytes32 key, string memory str) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -339,7 +377,9 @@ library Dynamics2 { StoreSwitch.setDynamicField(_tableId, _keyTuple, 1, bytes((str))); } - /** Set str */ + /** + * @notice Set str + */ function _setStr(bytes32 key, string memory str) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -347,7 +387,9 @@ library Dynamics2 { StoreCore.setDynamicField(_tableId, _keyTuple, 1, bytes((str))); } - /** Set str (using the specified store) */ + /** + * @notice Set str (using the specified store) + */ function setStr(IStore _store, bytes32 key, string memory str) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -355,7 +397,9 @@ library Dynamics2 { _store.setDynamicField(_tableId, _keyTuple, 1, bytes((str))); } - /** Get the length of str */ + /** + * @notice Get length of str + */ function lengthStr(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -366,7 +410,9 @@ library Dynamics2 { } } - /** Get the length of str */ + /** + * @notice Get length of str + */ function _lengthStr(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -377,7 +423,9 @@ library Dynamics2 { } } - /** Get the length of str (using the specified store) */ + /** + * @notice Get length of str (using the specified store) + */ function lengthStr(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -389,8 +437,8 @@ library Dynamics2 { } /** - * Get an item of str - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of str + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStr(bytes32 key, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -403,8 +451,8 @@ library Dynamics2 { } /** - * Get an item of str - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of str + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemStr(bytes32 key, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -417,8 +465,8 @@ library Dynamics2 { } /** - * Get an item of str (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of str (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemStr(IStore _store, bytes32 key, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -430,7 +478,9 @@ library Dynamics2 { } } - /** Push a slice to str */ + /** + * @notice Push a slice to str + */ function pushStr(bytes32 key, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -438,7 +488,9 @@ library Dynamics2 { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Push a slice to str */ + /** + * @notice Push a slice to str + */ function _pushStr(bytes32 key, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -446,7 +498,9 @@ library Dynamics2 { StoreCore.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Push a slice to str (using the specified store) */ + /** + * @notice Push a slice to str (using the specified store) + */ function pushStr(IStore _store, bytes32 key, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -454,7 +508,9 @@ library Dynamics2 { _store.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Pop a slice from str */ + /** + * @notice Pop a slice from str + */ function popStr(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -462,7 +518,9 @@ library Dynamics2 { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 1, 1); } - /** Pop a slice from str */ + /** + * @notice Pop a slice from str + */ function _popStr(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -470,7 +528,9 @@ library Dynamics2 { StoreCore.popFromDynamicField(_tableId, _keyTuple, 1, 1); } - /** Pop a slice from str (using the specified store) */ + /** + * @notice Pop a slice from str (using the specified store) + */ function popStr(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -479,8 +539,8 @@ library Dynamics2 { } /** - * Update a slice of str at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of str at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStr(bytes32 key, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -493,8 +553,8 @@ library Dynamics2 { } /** - * Update a slice of str at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of str at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateStr(bytes32 key, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -507,8 +567,8 @@ library Dynamics2 { } /** - * Update a slice of str (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of str (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateStr(IStore _store, bytes32 key, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -520,7 +580,9 @@ library Dynamics2 { } } - /** Get b */ + /** + * @notice Get b + */ function getB(bytes32 key) internal view returns (bytes memory b) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -529,7 +591,9 @@ library Dynamics2 { return (bytes(_blob)); } - /** Get b */ + /** + * @notice Get b + */ function _getB(bytes32 key) internal view returns (bytes memory b) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -538,7 +602,9 @@ library Dynamics2 { return (bytes(_blob)); } - /** Get b (using the specified store) */ + /** + * @notice Get b (using the specified store) + */ function getB(IStore _store, bytes32 key) internal view returns (bytes memory b) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -547,7 +613,9 @@ library Dynamics2 { return (bytes(_blob)); } - /** Set b */ + /** + * @notice Set b + */ function setB(bytes32 key, bytes memory b) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -555,7 +623,9 @@ library Dynamics2 { StoreSwitch.setDynamicField(_tableId, _keyTuple, 2, bytes((b))); } - /** Set b */ + /** + * @notice Set b + */ function _setB(bytes32 key, bytes memory b) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -563,7 +633,9 @@ library Dynamics2 { StoreCore.setDynamicField(_tableId, _keyTuple, 2, bytes((b))); } - /** Set b (using the specified store) */ + /** + * @notice Set b (using the specified store) + */ function setB(IStore _store, bytes32 key, bytes memory b) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -571,7 +643,9 @@ library Dynamics2 { _store.setDynamicField(_tableId, _keyTuple, 2, bytes((b))); } - /** Get the length of b */ + /** + * @notice Get length of b + */ function lengthB(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -582,7 +656,9 @@ library Dynamics2 { } } - /** Get the length of b */ + /** + * @notice Get length of b + */ function _lengthB(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -593,7 +669,9 @@ library Dynamics2 { } } - /** Get the length of b (using the specified store) */ + /** + * @notice Get length of b (using the specified store) + */ function lengthB(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -605,8 +683,8 @@ library Dynamics2 { } /** - * Get an item of b - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of b + * @dev (unchecked, returns invalid data if index overflows) */ function getItemB(bytes32 key, uint256 _index) internal view returns (bytes memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -619,8 +697,8 @@ library Dynamics2 { } /** - * Get an item of b - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of b + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemB(bytes32 key, uint256 _index) internal view returns (bytes memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -633,8 +711,8 @@ library Dynamics2 { } /** - * Get an item of b (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of b (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemB(IStore _store, bytes32 key, uint256 _index) internal view returns (bytes memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -646,7 +724,9 @@ library Dynamics2 { } } - /** Push a slice to b */ + /** + * @notice Push a slice to b + */ function pushB(bytes32 key, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -654,7 +734,9 @@ library Dynamics2 { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 2, bytes((_slice))); } - /** Push a slice to b */ + /** + * @notice Push a slice to b + */ function _pushB(bytes32 key, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -662,7 +744,9 @@ library Dynamics2 { StoreCore.pushToDynamicField(_tableId, _keyTuple, 2, bytes((_slice))); } - /** Push a slice to b (using the specified store) */ + /** + * @notice Push a slice to b (using the specified store) + */ function pushB(IStore _store, bytes32 key, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -670,7 +754,9 @@ library Dynamics2 { _store.pushToDynamicField(_tableId, _keyTuple, 2, bytes((_slice))); } - /** Pop a slice from b */ + /** + * @notice Pop a slice from b + */ function popB(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -678,7 +764,9 @@ library Dynamics2 { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 2, 1); } - /** Pop a slice from b */ + /** + * @notice Pop a slice from b + */ function _popB(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -686,7 +774,9 @@ library Dynamics2 { StoreCore.popFromDynamicField(_tableId, _keyTuple, 2, 1); } - /** Pop a slice from b (using the specified store) */ + /** + * @notice Pop a slice from b (using the specified store) + */ function popB(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -695,8 +785,8 @@ library Dynamics2 { } /** - * Update a slice of b at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of b at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateB(bytes32 key, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -709,8 +799,8 @@ library Dynamics2 { } /** - * Update a slice of b at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of b at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateB(bytes32 key, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -723,8 +813,8 @@ library Dynamics2 { } /** - * Update a slice of b (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of b (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateB(IStore _store, bytes32 key, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/cli/contracts/src/codegen/tables/Offchain.sol b/packages/cli/contracts/src/codegen/tables/Offchain.sol index bc428c7f0c..86f4304a23 100644 --- a/packages/cli/contracts/src/codegen/tables/Offchain.sol +++ b/packages/cli/contracts/src/codegen/tables/Offchain.sol @@ -78,7 +78,9 @@ library Offchain { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Set value */ + /** + * @notice Set value + */ function setValue(bytes32 key, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -86,7 +88,9 @@ library Offchain { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function _setValue(bytes32 key, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -94,7 +98,9 @@ library Offchain { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function setValue(IStore _store, bytes32 key, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; diff --git a/packages/cli/contracts/src/codegen/tables/Singleton.sol b/packages/cli/contracts/src/codegen/tables/Singleton.sol index 1d44b0d39c..d10a1e2a51 100644 --- a/packages/cli/contracts/src/codegen/tables/Singleton.sol +++ b/packages/cli/contracts/src/codegen/tables/Singleton.sol @@ -82,7 +82,9 @@ library Singleton { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get v1 */ + /** + * @notice Get v1 + */ function getV1() internal view returns (int256 v1) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -90,7 +92,9 @@ library Singleton { return (int256(uint256(bytes32(_blob)))); } - /** Get v1 */ + /** + * @notice Get v1 + */ function _getV1() internal view returns (int256 v1) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -98,7 +102,9 @@ library Singleton { return (int256(uint256(bytes32(_blob)))); } - /** Get v1 (using the specified store) */ + /** + * @notice Get v1 (using the specified store) + */ function getV1(IStore _store) internal view returns (int256 v1) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -106,28 +112,36 @@ library Singleton { return (int256(uint256(bytes32(_blob)))); } - /** Set v1 */ + /** + * @notice Set v1 + */ function setV1(int256 v1) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((v1)), _fieldLayout); } - /** Set v1 */ + /** + * @notice Set v1 + */ function _setV1(int256 v1) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((v1)), _fieldLayout); } - /** Set v1 (using the specified store) */ + /** + * @notice Set v1 (using the specified store) + */ function setV1(IStore _store, int256 v1) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((v1)), _fieldLayout); } - /** Get v2 */ + /** + * @notice Get v2 + */ function getV2() internal view returns (uint32[2] memory v2) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -135,7 +149,9 @@ library Singleton { return toStaticArray_uint32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Get v2 */ + /** + * @notice Get v2 + */ function _getV2() internal view returns (uint32[2] memory v2) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -143,7 +159,9 @@ library Singleton { return toStaticArray_uint32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Get v2 (using the specified store) */ + /** + * @notice Get v2 (using the specified store) + */ function getV2(IStore _store) internal view returns (uint32[2] memory v2) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -151,28 +169,36 @@ library Singleton { return toStaticArray_uint32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Set v2 */ + /** + * @notice Set v2 + */ function setV2(uint32[2] memory v2) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode(fromStaticArray_uint32_2(v2))); } - /** Set v2 */ + /** + * @notice Set v2 + */ function _setV2(uint32[2] memory v2) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode(fromStaticArray_uint32_2(v2))); } - /** Set v2 (using the specified store) */ + /** + * @notice Set v2 (using the specified store) + */ function setV2(IStore _store, uint32[2] memory v2) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode(fromStaticArray_uint32_2(v2))); } - /** Get the length of v2 */ + /** + * @notice Get length of v2 + */ function lengthV2() internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -182,7 +208,9 @@ library Singleton { } } - /** Get the length of v2 */ + /** + * @notice Get length of v2 + */ function _lengthV2() internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -192,7 +220,9 @@ library Singleton { } } - /** Get the length of v2 (using the specified store) */ + /** + * @notice Get length of v2 (using the specified store) + */ function lengthV2(IStore _store) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -203,8 +233,8 @@ library Singleton { } /** - * Get an item of v2 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v2 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemV2(uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -216,8 +246,8 @@ library Singleton { } /** - * Get an item of v2 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v2 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemV2(uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -229,8 +259,8 @@ library Singleton { } /** - * Get an item of v2 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v2 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemV2(IStore _store, uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -241,42 +271,54 @@ library Singleton { } } - /** Push an element to v2 */ + /** + * @notice Push an element to v2 + */ function pushV2(uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to v2 */ + /** + * @notice Push an element to v2 + */ function _pushV2(uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to v2 (using the specified store) */ + /** + * @notice Push an element to v2 (using the specified store) + */ function pushV2(IStore _store, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from v2 */ + /** + * @notice Pop an element from v2 + */ function popV2() internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 4); } - /** Pop an element from v2 */ + /** + * @notice Pop an element from v2 + */ function _popV2() internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 4); } - /** Pop an element from v2 (using the specified store) */ + /** + * @notice Pop an element from v2 (using the specified store) + */ function popV2(IStore _store) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -284,8 +326,8 @@ library Singleton { } /** - * Update an element of v2 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v2 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateV2(uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -297,8 +339,8 @@ library Singleton { } /** - * Update an element of v2 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v2 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateV2(uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -310,8 +352,8 @@ library Singleton { } /** - * Update an element of v2 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v2 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateV2(IStore _store, uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -322,7 +364,9 @@ library Singleton { } } - /** Get v3 */ + /** + * @notice Get v3 + */ function getV3() internal view returns (uint32[2] memory v3) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -330,7 +374,9 @@ library Singleton { return toStaticArray_uint32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Get v3 */ + /** + * @notice Get v3 + */ function _getV3() internal view returns (uint32[2] memory v3) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -338,7 +384,9 @@ library Singleton { return toStaticArray_uint32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Get v3 (using the specified store) */ + /** + * @notice Get v3 (using the specified store) + */ function getV3(IStore _store) internal view returns (uint32[2] memory v3) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -346,28 +394,36 @@ library Singleton { return toStaticArray_uint32_2(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Set v3 */ + /** + * @notice Set v3 + */ function setV3(uint32[2] memory v3) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode(fromStaticArray_uint32_2(v3))); } - /** Set v3 */ + /** + * @notice Set v3 + */ function _setV3(uint32[2] memory v3) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode(fromStaticArray_uint32_2(v3))); } - /** Set v3 (using the specified store) */ + /** + * @notice Set v3 (using the specified store) + */ function setV3(IStore _store, uint32[2] memory v3) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode(fromStaticArray_uint32_2(v3))); } - /** Get the length of v3 */ + /** + * @notice Get length of v3 + */ function lengthV3() internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -377,7 +433,9 @@ library Singleton { } } - /** Get the length of v3 */ + /** + * @notice Get length of v3 + */ function _lengthV3() internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -387,7 +445,9 @@ library Singleton { } } - /** Get the length of v3 (using the specified store) */ + /** + * @notice Get length of v3 (using the specified store) + */ function lengthV3(IStore _store) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -398,8 +458,8 @@ library Singleton { } /** - * Get an item of v3 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v3 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemV3(uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -411,8 +471,8 @@ library Singleton { } /** - * Get an item of v3 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v3 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemV3(uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -424,8 +484,8 @@ library Singleton { } /** - * Get an item of v3 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v3 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemV3(IStore _store, uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -436,42 +496,54 @@ library Singleton { } } - /** Push an element to v3 */ + /** + * @notice Push an element to v3 + */ function pushV3(uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Push an element to v3 */ + /** + * @notice Push an element to v3 + */ function _pushV3(uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Push an element to v3 (using the specified store) */ + /** + * @notice Push an element to v3 (using the specified store) + */ function pushV3(IStore _store, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Pop an element from v3 */ + /** + * @notice Pop an element from v3 + */ function popV3() internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 1, 4); } - /** Pop an element from v3 */ + /** + * @notice Pop an element from v3 + */ function _popV3() internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.popFromDynamicField(_tableId, _keyTuple, 1, 4); } - /** Pop an element from v3 (using the specified store) */ + /** + * @notice Pop an element from v3 (using the specified store) + */ function popV3(IStore _store) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -479,8 +551,8 @@ library Singleton { } /** - * Update an element of v3 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v3 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateV3(uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -492,8 +564,8 @@ library Singleton { } /** - * Update an element of v3 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v3 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateV3(uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -505,8 +577,8 @@ library Singleton { } /** - * Update an element of v3 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v3 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateV3(IStore _store, uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -517,7 +589,9 @@ library Singleton { } } - /** Get v4 */ + /** + * @notice Get v4 + */ function getV4() internal view returns (uint32[1] memory v4) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -525,7 +599,9 @@ library Singleton { return toStaticArray_uint32_1(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Get v4 */ + /** + * @notice Get v4 + */ function _getV4() internal view returns (uint32[1] memory v4) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -533,7 +609,9 @@ library Singleton { return toStaticArray_uint32_1(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Get v4 (using the specified store) */ + /** + * @notice Get v4 (using the specified store) + */ function getV4(IStore _store) internal view returns (uint32[1] memory v4) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -541,28 +619,36 @@ library Singleton { return toStaticArray_uint32_1(SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Set v4 */ + /** + * @notice Set v4 + */ function setV4(uint32[1] memory v4) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode(fromStaticArray_uint32_1(v4))); } - /** Set v4 */ + /** + * @notice Set v4 + */ function _setV4(uint32[1] memory v4) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode(fromStaticArray_uint32_1(v4))); } - /** Set v4 (using the specified store) */ + /** + * @notice Set v4 (using the specified store) + */ function setV4(IStore _store, uint32[1] memory v4) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode(fromStaticArray_uint32_1(v4))); } - /** Get the length of v4 */ + /** + * @notice Get length of v4 + */ function lengthV4() internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -572,7 +658,9 @@ library Singleton { } } - /** Get the length of v4 */ + /** + * @notice Get length of v4 + */ function _lengthV4() internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -582,7 +670,9 @@ library Singleton { } } - /** Get the length of v4 (using the specified store) */ + /** + * @notice Get length of v4 (using the specified store) + */ function lengthV4(IStore _store) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -593,8 +683,8 @@ library Singleton { } /** - * Get an item of v4 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v4 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemV4(uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -606,8 +696,8 @@ library Singleton { } /** - * Get an item of v4 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v4 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemV4(uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -619,8 +709,8 @@ library Singleton { } /** - * Get an item of v4 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of v4 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemV4(IStore _store, uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -631,42 +721,54 @@ library Singleton { } } - /** Push an element to v4 */ + /** + * @notice Push an element to v4 + */ function pushV4(uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Push an element to v4 */ + /** + * @notice Push an element to v4 + */ function _pushV4(uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Push an element to v4 (using the specified store) */ + /** + * @notice Push an element to v4 (using the specified store) + */ function pushV4(IStore _store, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Pop an element from v4 */ + /** + * @notice Pop an element from v4 + */ function popV4() internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 2, 4); } - /** Pop an element from v4 */ + /** + * @notice Pop an element from v4 + */ function _popV4() internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.popFromDynamicField(_tableId, _keyTuple, 2, 4); } - /** Pop an element from v4 (using the specified store) */ + /** + * @notice Pop an element from v4 (using the specified store) + */ function popV4(IStore _store) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -674,8 +776,8 @@ library Singleton { } /** - * Update an element of v4 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v4 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateV4(uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -687,8 +789,8 @@ library Singleton { } /** - * Update an element of v4 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v4 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateV4(uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); @@ -700,8 +802,8 @@ library Singleton { } /** - * Update an element of v4 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of v4 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateV4(IStore _store, uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](0); diff --git a/packages/cli/contracts/src/codegen/tables/Statics.sol b/packages/cli/contracts/src/codegen/tables/Statics.sol index 2177a5282a..9796cc4fa0 100644 --- a/packages/cli/contracts/src/codegen/tables/Statics.sol +++ b/packages/cli/contracts/src/codegen/tables/Statics.sol @@ -110,7 +110,9 @@ library Statics { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get v1 */ + /** + * @notice Get v1 + */ function getV1(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (uint256 v1) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -124,7 +126,9 @@ library Statics { return (uint256(bytes32(_blob))); } - /** Get v1 */ + /** + * @notice Get v1 + */ function _getV1(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (uint256 v1) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -138,7 +142,9 @@ library Statics { return (uint256(bytes32(_blob))); } - /** Get v1 (using the specified store) */ + /** + * @notice Get v1 (using the specified store) + */ function getV1( IStore _store, uint256 k1, @@ -160,7 +166,9 @@ library Statics { return (uint256(bytes32(_blob))); } - /** Set v1 */ + /** + * @notice Set v1 + */ function setV1(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, uint256 v1) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -173,7 +181,9 @@ library Statics { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((v1)), _fieldLayout); } - /** Set v1 */ + /** + * @notice Set v1 + */ function _setV1(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, uint256 v1) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -186,7 +196,9 @@ library Statics { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((v1)), _fieldLayout); } - /** Set v1 (using the specified store) */ + /** + * @notice Set v1 (using the specified store) + */ function setV1(IStore _store, uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, uint256 v1) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -199,7 +211,9 @@ library Statics { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((v1)), _fieldLayout); } - /** Get v2 */ + /** + * @notice Get v2 + */ function getV2(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (int32 v2) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -213,7 +227,9 @@ library Statics { return (int32(uint32(bytes4(_blob)))); } - /** Get v2 */ + /** + * @notice Get v2 + */ function _getV2(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (int32 v2) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -227,7 +243,9 @@ library Statics { return (int32(uint32(bytes4(_blob)))); } - /** Get v2 (using the specified store) */ + /** + * @notice Get v2 (using the specified store) + */ function getV2( IStore _store, uint256 k1, @@ -249,7 +267,9 @@ library Statics { return (int32(uint32(bytes4(_blob)))); } - /** Set v2 */ + /** + * @notice Set v2 + */ function setV2(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, int32 v2) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -262,7 +282,9 @@ library Statics { StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((v2)), _fieldLayout); } - /** Set v2 */ + /** + * @notice Set v2 + */ function _setV2(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, int32 v2) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -275,7 +297,9 @@ library Statics { StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((v2)), _fieldLayout); } - /** Set v2 (using the specified store) */ + /** + * @notice Set v2 (using the specified store) + */ function setV2(IStore _store, uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, int32 v2) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -288,7 +312,9 @@ library Statics { _store.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((v2)), _fieldLayout); } - /** Get v3 */ + /** + * @notice Get v3 + */ function getV3(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (bytes16 v3) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -302,7 +328,9 @@ library Statics { return (bytes16(_blob)); } - /** Get v3 */ + /** + * @notice Get v3 + */ function _getV3(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (bytes16 v3) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -316,7 +344,9 @@ library Statics { return (bytes16(_blob)); } - /** Get v3 (using the specified store) */ + /** + * @notice Get v3 (using the specified store) + */ function getV3( IStore _store, uint256 k1, @@ -338,7 +368,9 @@ library Statics { return (bytes16(_blob)); } - /** Set v3 */ + /** + * @notice Set v3 + */ function setV3(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, bytes16 v3) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -351,7 +383,9 @@ library Statics { StoreSwitch.setStaticField(_tableId, _keyTuple, 2, abi.encodePacked((v3)), _fieldLayout); } - /** Set v3 */ + /** + * @notice Set v3 + */ function _setV3(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, bytes16 v3) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -364,7 +398,9 @@ library Statics { StoreCore.setStaticField(_tableId, _keyTuple, 2, abi.encodePacked((v3)), _fieldLayout); } - /** Set v3 (using the specified store) */ + /** + * @notice Set v3 (using the specified store) + */ function setV3(IStore _store, uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, bytes16 v3) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -377,7 +413,9 @@ library Statics { _store.setStaticField(_tableId, _keyTuple, 2, abi.encodePacked((v3)), _fieldLayout); } - /** Get v4 */ + /** + * @notice Get v4 + */ function getV4(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (address v4) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -391,7 +429,9 @@ library Statics { return (address(bytes20(_blob))); } - /** Get v4 */ + /** + * @notice Get v4 + */ function _getV4(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (address v4) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -405,7 +445,9 @@ library Statics { return (address(bytes20(_blob))); } - /** Get v4 (using the specified store) */ + /** + * @notice Get v4 (using the specified store) + */ function getV4( IStore _store, uint256 k1, @@ -427,7 +469,9 @@ library Statics { return (address(bytes20(_blob))); } - /** Set v4 */ + /** + * @notice Set v4 + */ function setV4(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, address v4) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -440,7 +484,9 @@ library Statics { StoreSwitch.setStaticField(_tableId, _keyTuple, 3, abi.encodePacked((v4)), _fieldLayout); } - /** Set v4 */ + /** + * @notice Set v4 + */ function _setV4(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, address v4) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -453,7 +499,9 @@ library Statics { StoreCore.setStaticField(_tableId, _keyTuple, 3, abi.encodePacked((v4)), _fieldLayout); } - /** Set v4 (using the specified store) */ + /** + * @notice Set v4 (using the specified store) + */ function setV4(IStore _store, uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, address v4) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -466,7 +514,9 @@ library Statics { _store.setStaticField(_tableId, _keyTuple, 3, abi.encodePacked((v4)), _fieldLayout); } - /** Get v5 */ + /** + * @notice Get v5 + */ function getV5(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (bool v5) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -480,7 +530,9 @@ library Statics { return (_toBool(uint8(bytes1(_blob)))); } - /** Get v5 */ + /** + * @notice Get v5 + */ function _getV5(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (bool v5) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -494,7 +546,9 @@ library Statics { return (_toBool(uint8(bytes1(_blob)))); } - /** Get v5 (using the specified store) */ + /** + * @notice Get v5 (using the specified store) + */ function getV5( IStore _store, uint256 k1, @@ -516,7 +570,9 @@ library Statics { return (_toBool(uint8(bytes1(_blob)))); } - /** Set v5 */ + /** + * @notice Set v5 + */ function setV5(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, bool v5) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -529,7 +585,9 @@ library Statics { StoreSwitch.setStaticField(_tableId, _keyTuple, 4, abi.encodePacked((v5)), _fieldLayout); } - /** Set v5 */ + /** + * @notice Set v5 + */ function _setV5(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, bool v5) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -542,7 +600,9 @@ library Statics { StoreCore.setStaticField(_tableId, _keyTuple, 4, abi.encodePacked((v5)), _fieldLayout); } - /** Set v5 (using the specified store) */ + /** + * @notice Set v5 (using the specified store) + */ function setV5(IStore _store, uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, bool v5) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -555,7 +615,9 @@ library Statics { _store.setStaticField(_tableId, _keyTuple, 4, abi.encodePacked((v5)), _fieldLayout); } - /** Get v6 */ + /** + * @notice Get v6 + */ function getV6(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (Enum1 v6) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -569,7 +631,9 @@ library Statics { return Enum1(uint8(bytes1(_blob))); } - /** Get v6 */ + /** + * @notice Get v6 + */ function _getV6(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6) internal view returns (Enum1 v6) { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -583,7 +647,9 @@ library Statics { return Enum1(uint8(bytes1(_blob))); } - /** Get v6 (using the specified store) */ + /** + * @notice Get v6 (using the specified store) + */ function getV6( IStore _store, uint256 k1, @@ -605,7 +671,9 @@ library Statics { return Enum1(uint8(bytes1(_blob))); } - /** Set v6 */ + /** + * @notice Set v6 + */ function setV6(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, Enum1 v6) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -618,7 +686,9 @@ library Statics { StoreSwitch.setStaticField(_tableId, _keyTuple, 5, abi.encodePacked(uint8(v6)), _fieldLayout); } - /** Set v6 */ + /** + * @notice Set v6 + */ function _setV6(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, Enum1 v6) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -631,7 +701,9 @@ library Statics { StoreCore.setStaticField(_tableId, _keyTuple, 5, abi.encodePacked(uint8(v6)), _fieldLayout); } - /** Set v6 (using the specified store) */ + /** + * @notice Set v6 (using the specified store) + */ function setV6(IStore _store, uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, Enum2 k6, Enum1 v6) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); diff --git a/packages/cli/contracts/src/codegen/tables/UserTyped.sol b/packages/cli/contracts/src/codegen/tables/UserTyped.sol index fd2d41f421..83bd7575ea 100644 --- a/packages/cli/contracts/src/codegen/tables/UserTyped.sol +++ b/packages/cli/contracts/src/codegen/tables/UserTyped.sol @@ -106,7 +106,9 @@ library UserTyped { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get v1 */ + /** + * @notice Get v1 + */ function getV1( TestTypeAddress k1, TestTypeInt64 k2, @@ -125,7 +127,9 @@ library UserTyped { return TestTypeAddress.wrap(address(bytes20(_blob))); } - /** Get v1 */ + /** + * @notice Get v1 + */ function _getV1( TestTypeAddress k1, TestTypeInt64 k2, @@ -144,7 +148,9 @@ library UserTyped { return TestTypeAddress.wrap(address(bytes20(_blob))); } - /** Get v1 (using the specified store) */ + /** + * @notice Get v1 (using the specified store) + */ function getV1( IStore _store, TestTypeAddress k1, @@ -164,7 +170,9 @@ library UserTyped { return TestTypeAddress.wrap(address(bytes20(_blob))); } - /** Set v1 */ + /** + * @notice Set v1 + */ function setV1( TestTypeAddress k1, TestTypeInt64 k2, @@ -183,7 +191,9 @@ library UserTyped { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(TestTypeAddress.unwrap(v1)), _fieldLayout); } - /** Set v1 */ + /** + * @notice Set v1 + */ function _setV1( TestTypeAddress k1, TestTypeInt64 k2, @@ -202,7 +212,9 @@ library UserTyped { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(TestTypeAddress.unwrap(v1)), _fieldLayout); } - /** Set v1 (using the specified store) */ + /** + * @notice Set v1 (using the specified store) + */ function setV1( IStore _store, TestTypeAddress k1, @@ -222,7 +234,9 @@ library UserTyped { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(TestTypeAddress.unwrap(v1)), _fieldLayout); } - /** Get v2 */ + /** + * @notice Get v2 + */ function getV2( TestTypeAddress k1, TestTypeInt64 k2, @@ -241,7 +255,9 @@ library UserTyped { return TestTypeInt64.wrap(int64(uint64(bytes8(_blob)))); } - /** Get v2 */ + /** + * @notice Get v2 + */ function _getV2( TestTypeAddress k1, TestTypeInt64 k2, @@ -260,7 +276,9 @@ library UserTyped { return TestTypeInt64.wrap(int64(uint64(bytes8(_blob)))); } - /** Get v2 (using the specified store) */ + /** + * @notice Get v2 (using the specified store) + */ function getV2( IStore _store, TestTypeAddress k1, @@ -280,7 +298,9 @@ library UserTyped { return TestTypeInt64.wrap(int64(uint64(bytes8(_blob)))); } - /** Set v2 */ + /** + * @notice Set v2 + */ function setV2( TestTypeAddress k1, TestTypeInt64 k2, @@ -299,7 +319,9 @@ library UserTyped { StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked(TestTypeInt64.unwrap(v2)), _fieldLayout); } - /** Set v2 */ + /** + * @notice Set v2 + */ function _setV2( TestTypeAddress k1, TestTypeInt64 k2, @@ -318,7 +340,9 @@ library UserTyped { StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked(TestTypeInt64.unwrap(v2)), _fieldLayout); } - /** Set v2 (using the specified store) */ + /** + * @notice Set v2 (using the specified store) + */ function setV2( IStore _store, TestTypeAddress k1, @@ -338,7 +362,9 @@ library UserTyped { _store.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked(TestTypeInt64.unwrap(v2)), _fieldLayout); } - /** Get v3 */ + /** + * @notice Get v3 + */ function getV3( TestTypeAddress k1, TestTypeInt64 k2, @@ -357,7 +383,9 @@ library UserTyped { return TestTypeLibrary.TestTypeBool.wrap(_toBool(uint8(bytes1(_blob)))); } - /** Get v3 */ + /** + * @notice Get v3 + */ function _getV3( TestTypeAddress k1, TestTypeInt64 k2, @@ -376,7 +404,9 @@ library UserTyped { return TestTypeLibrary.TestTypeBool.wrap(_toBool(uint8(bytes1(_blob)))); } - /** Get v3 (using the specified store) */ + /** + * @notice Get v3 (using the specified store) + */ function getV3( IStore _store, TestTypeAddress k1, @@ -396,7 +426,9 @@ library UserTyped { return TestTypeLibrary.TestTypeBool.wrap(_toBool(uint8(bytes1(_blob)))); } - /** Set v3 */ + /** + * @notice Set v3 + */ function setV3( TestTypeAddress k1, TestTypeInt64 k2, @@ -421,7 +453,9 @@ library UserTyped { ); } - /** Set v3 */ + /** + * @notice Set v3 + */ function _setV3( TestTypeAddress k1, TestTypeInt64 k2, @@ -446,7 +480,9 @@ library UserTyped { ); } - /** Set v3 (using the specified store) */ + /** + * @notice Set v3 (using the specified store) + */ function setV3( IStore _store, TestTypeAddress k1, @@ -472,7 +508,9 @@ library UserTyped { ); } - /** Get v4 */ + /** + * @notice Get v4 + */ function getV4( TestTypeAddress k1, TestTypeInt64 k2, @@ -491,7 +529,9 @@ library UserTyped { return TestTypeLibrary.TestTypeUint128.wrap(uint128(bytes16(_blob))); } - /** Get v4 */ + /** + * @notice Get v4 + */ function _getV4( TestTypeAddress k1, TestTypeInt64 k2, @@ -510,7 +550,9 @@ library UserTyped { return TestTypeLibrary.TestTypeUint128.wrap(uint128(bytes16(_blob))); } - /** Get v4 (using the specified store) */ + /** + * @notice Get v4 (using the specified store) + */ function getV4( IStore _store, TestTypeAddress k1, @@ -530,7 +572,9 @@ library UserTyped { return TestTypeLibrary.TestTypeUint128.wrap(uint128(bytes16(_blob))); } - /** Set v4 */ + /** + * @notice Set v4 + */ function setV4( TestTypeAddress k1, TestTypeInt64 k2, @@ -555,7 +599,9 @@ library UserTyped { ); } - /** Set v4 */ + /** + * @notice Set v4 + */ function _setV4( TestTypeAddress k1, TestTypeInt64 k2, @@ -580,7 +626,9 @@ library UserTyped { ); } - /** Set v4 (using the specified store) */ + /** + * @notice Set v4 (using the specified store) + */ function setV4( IStore _store, TestTypeAddress k1, @@ -606,7 +654,9 @@ library UserTyped { ); } - /** Get v5 */ + /** + * @notice Get v5 + */ function getV5( TestTypeAddress k1, TestTypeInt64 k2, @@ -625,7 +675,9 @@ library UserTyped { return ResourceId.wrap(bytes32(_blob)); } - /** Get v5 */ + /** + * @notice Get v5 + */ function _getV5( TestTypeAddress k1, TestTypeInt64 k2, @@ -644,7 +696,9 @@ library UserTyped { return ResourceId.wrap(bytes32(_blob)); } - /** Get v5 (using the specified store) */ + /** + * @notice Get v5 (using the specified store) + */ function getV5( IStore _store, TestTypeAddress k1, @@ -664,7 +718,9 @@ library UserTyped { return ResourceId.wrap(bytes32(_blob)); } - /** Set v5 */ + /** + * @notice Set v5 + */ function setV5( TestTypeAddress k1, TestTypeInt64 k2, @@ -683,7 +739,9 @@ library UserTyped { StoreSwitch.setStaticField(_tableId, _keyTuple, 4, abi.encodePacked(ResourceId.unwrap(v5)), _fieldLayout); } - /** Set v5 */ + /** + * @notice Set v5 + */ function _setV5( TestTypeAddress k1, TestTypeInt64 k2, @@ -702,7 +760,9 @@ library UserTyped { StoreCore.setStaticField(_tableId, _keyTuple, 4, abi.encodePacked(ResourceId.unwrap(v5)), _fieldLayout); } - /** Set v5 (using the specified store) */ + /** + * @notice Set v5 (using the specified store) + */ function setV5( IStore _store, TestTypeAddress k1, diff --git a/packages/store/src/codegen/tables/Hooks.sol b/packages/store/src/codegen/tables/Hooks.sol index 38c3365681..84c15e086c 100644 --- a/packages/store/src/codegen/tables/Hooks.sol +++ b/packages/store/src/codegen/tables/Hooks.sol @@ -76,7 +76,9 @@ library Hooks { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get hooks */ + /** + * @notice Get hooks + */ function getHooks(ResourceId _tableId, ResourceId resourceId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -85,7 +87,9 @@ library Hooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks */ + /** + * @notice Get hooks + */ function _getHooks(ResourceId _tableId, ResourceId resourceId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -94,7 +98,9 @@ library Hooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks (using the specified store) */ + /** + * @notice Get hooks (using the specified store) + */ function getHooks( IStore _store, ResourceId _tableId, @@ -107,7 +113,9 @@ library Hooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks */ + /** + * @notice Get hooks + */ function get(ResourceId _tableId, ResourceId resourceId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -116,7 +124,9 @@ library Hooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks */ + /** + * @notice Get hooks + */ function _get(ResourceId _tableId, ResourceId resourceId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -125,7 +135,9 @@ library Hooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks (using the specified store) */ + /** + * @notice Get hooks (using the specified store) + */ function get( IStore _store, ResourceId _tableId, @@ -138,7 +150,9 @@ library Hooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Set hooks */ + /** + * @notice Set hooks + */ function setHooks(ResourceId _tableId, ResourceId resourceId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -146,7 +160,9 @@ library Hooks { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks */ + /** + * @notice Set hooks + */ function _setHooks(ResourceId _tableId, ResourceId resourceId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -154,7 +170,9 @@ library Hooks { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks (using the specified store) */ + /** + * @notice Set hooks (using the specified store) + */ function setHooks(IStore _store, ResourceId _tableId, ResourceId resourceId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -162,7 +180,9 @@ library Hooks { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks */ + /** + * @notice Set hooks + */ function set(ResourceId _tableId, ResourceId resourceId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -170,7 +190,9 @@ library Hooks { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks */ + /** + * @notice Set hooks + */ function _set(ResourceId _tableId, ResourceId resourceId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -178,7 +200,9 @@ library Hooks { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks (using the specified store) */ + /** + * @notice Set hooks (using the specified store) + */ function set(IStore _store, ResourceId _tableId, ResourceId resourceId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -186,7 +210,9 @@ library Hooks { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Get the length of hooks */ + /** + * @notice Get length of hooks + */ function lengthHooks(ResourceId _tableId, ResourceId resourceId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -197,7 +223,9 @@ library Hooks { } } - /** Get the length of hooks */ + /** + * @notice Get length of hooks + */ function _lengthHooks(ResourceId _tableId, ResourceId resourceId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -208,7 +236,9 @@ library Hooks { } } - /** Get the length of hooks (using the specified store) */ + /** + * @notice Get length of hooks (using the specified store) + */ function lengthHooks(IStore _store, ResourceId _tableId, ResourceId resourceId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -219,7 +249,9 @@ library Hooks { } } - /** Get the length of hooks */ + /** + * @notice Get length of hooks + */ function length(ResourceId _tableId, ResourceId resourceId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -230,7 +262,9 @@ library Hooks { } } - /** Get the length of hooks */ + /** + * @notice Get length of hooks + */ function _length(ResourceId _tableId, ResourceId resourceId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -241,7 +275,9 @@ library Hooks { } } - /** Get the length of hooks (using the specified store) */ + /** + * @notice Get length of hooks (using the specified store) + */ function length(IStore _store, ResourceId _tableId, ResourceId resourceId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -253,8 +289,8 @@ library Hooks { } /** - * Get an item of hooks - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks + * @dev (unchecked, returns invalid data if index overflows) */ function getItemHooks(ResourceId _tableId, ResourceId resourceId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -267,8 +303,8 @@ library Hooks { } /** - * Get an item of hooks - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemHooks(ResourceId _tableId, ResourceId resourceId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -281,8 +317,8 @@ library Hooks { } /** - * Get an item of hooks (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemHooks( IStore _store, @@ -300,8 +336,8 @@ library Hooks { } /** - * Get an item of hooks - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(ResourceId _tableId, ResourceId resourceId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -314,8 +350,8 @@ library Hooks { } /** - * Get an item of hooks - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks + * @dev (unchecked, returns invalid data if index overflows) */ function _getItem(ResourceId _tableId, ResourceId resourceId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -328,8 +364,8 @@ library Hooks { } /** - * Get an item of hooks (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItem( IStore _store, @@ -346,7 +382,9 @@ library Hooks { } } - /** Push an element to hooks */ + /** + * @notice Push an element to hooks + */ function pushHooks(ResourceId _tableId, ResourceId resourceId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -354,7 +392,9 @@ library Hooks { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks */ + /** + * @notice Push an element to hooks + */ function _pushHooks(ResourceId _tableId, ResourceId resourceId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -362,7 +402,9 @@ library Hooks { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks (using the specified store) */ + /** + * @notice Push an element to hooks (using the specified store) + */ function pushHooks(IStore _store, ResourceId _tableId, ResourceId resourceId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -370,7 +412,9 @@ library Hooks { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks */ + /** + * @notice Push an element to hooks + */ function push(ResourceId _tableId, ResourceId resourceId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -378,7 +422,9 @@ library Hooks { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks */ + /** + * @notice Push an element to hooks + */ function _push(ResourceId _tableId, ResourceId resourceId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -386,7 +432,9 @@ library Hooks { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks (using the specified store) */ + /** + * @notice Push an element to hooks (using the specified store) + */ function push(IStore _store, ResourceId _tableId, ResourceId resourceId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -394,7 +442,9 @@ library Hooks { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from hooks */ + /** + * @notice Pop an element from hooks + */ function popHooks(ResourceId _tableId, ResourceId resourceId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -402,7 +452,9 @@ library Hooks { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks */ + /** + * @notice Pop an element from hooks + */ function _popHooks(ResourceId _tableId, ResourceId resourceId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -410,7 +462,9 @@ library Hooks { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks (using the specified store) */ + /** + * @notice Pop an element from hooks (using the specified store) + */ function popHooks(IStore _store, ResourceId _tableId, ResourceId resourceId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -418,7 +472,9 @@ library Hooks { _store.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks */ + /** + * @notice Pop an element from hooks + */ function pop(ResourceId _tableId, ResourceId resourceId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -426,7 +482,9 @@ library Hooks { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks */ + /** + * @notice Pop an element from hooks + */ function _pop(ResourceId _tableId, ResourceId resourceId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -434,7 +492,9 @@ library Hooks { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks (using the specified store) */ + /** + * @notice Pop an element from hooks (using the specified store) + */ function pop(IStore _store, ResourceId _tableId, ResourceId resourceId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -443,8 +503,8 @@ library Hooks { } /** - * Update an element of hooks at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateHooks(ResourceId _tableId, ResourceId resourceId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -457,8 +517,8 @@ library Hooks { } /** - * Update an element of hooks at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateHooks(ResourceId _tableId, ResourceId resourceId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -471,8 +531,8 @@ library Hooks { } /** - * Update an element of hooks (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateHooks( IStore _store, @@ -491,8 +551,8 @@ library Hooks { } /** - * Update an element of hooks at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(ResourceId _tableId, ResourceId resourceId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -505,8 +565,8 @@ library Hooks { } /** - * Update an element of hooks at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _update(ResourceId _tableId, ResourceId resourceId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -519,8 +579,8 @@ library Hooks { } /** - * Update an element of hooks (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update( IStore _store, diff --git a/packages/store/src/codegen/tables/ResourceIds.sol b/packages/store/src/codegen/tables/ResourceIds.sol index e60fc7f863..ca67221972 100644 --- a/packages/store/src/codegen/tables/ResourceIds.sol +++ b/packages/store/src/codegen/tables/ResourceIds.sol @@ -81,7 +81,9 @@ library ResourceIds { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get exists */ + /** + * @notice Get exists + */ function getExists(ResourceId resourceId) internal view returns (bool exists) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -90,7 +92,9 @@ library ResourceIds { return (_toBool(uint8(bytes1(_blob)))); } - /** Get exists */ + /** + * @notice Get exists + */ function _getExists(ResourceId resourceId) internal view returns (bool exists) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -99,7 +103,9 @@ library ResourceIds { return (_toBool(uint8(bytes1(_blob)))); } - /** Get exists (using the specified store) */ + /** + * @notice Get exists (using the specified store) + */ function getExists(IStore _store, ResourceId resourceId) internal view returns (bool exists) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -108,7 +114,9 @@ library ResourceIds { return (_toBool(uint8(bytes1(_blob)))); } - /** Get exists */ + /** + * @notice Get exists + */ function get(ResourceId resourceId) internal view returns (bool exists) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -117,7 +125,9 @@ library ResourceIds { return (_toBool(uint8(bytes1(_blob)))); } - /** Get exists */ + /** + * @notice Get exists + */ function _get(ResourceId resourceId) internal view returns (bool exists) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -126,7 +136,9 @@ library ResourceIds { return (_toBool(uint8(bytes1(_blob)))); } - /** Get exists (using the specified store) */ + /** + * @notice Get exists (using the specified store) + */ function get(IStore _store, ResourceId resourceId) internal view returns (bool exists) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -135,7 +147,9 @@ library ResourceIds { return (_toBool(uint8(bytes1(_blob)))); } - /** Set exists */ + /** + * @notice Set exists + */ function setExists(ResourceId resourceId, bool exists) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -143,7 +157,9 @@ library ResourceIds { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((exists)), _fieldLayout); } - /** Set exists */ + /** + * @notice Set exists + */ function _setExists(ResourceId resourceId, bool exists) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -151,7 +167,9 @@ library ResourceIds { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((exists)), _fieldLayout); } - /** Set exists (using the specified store) */ + /** + * @notice Set exists (using the specified store) + */ function setExists(IStore _store, ResourceId resourceId, bool exists) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -159,7 +177,9 @@ library ResourceIds { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((exists)), _fieldLayout); } - /** Set exists */ + /** + * @notice Set exists + */ function set(ResourceId resourceId, bool exists) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -167,7 +187,9 @@ library ResourceIds { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((exists)), _fieldLayout); } - /** Set exists */ + /** + * @notice Set exists + */ function _set(ResourceId resourceId, bool exists) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -175,7 +197,9 @@ library ResourceIds { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((exists)), _fieldLayout); } - /** Set exists (using the specified store) */ + /** + * @notice Set exists (using the specified store) + */ function set(IStore _store, ResourceId resourceId, bool exists) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(resourceId); diff --git a/packages/store/src/codegen/tables/StoreHooks.sol b/packages/store/src/codegen/tables/StoreHooks.sol index da54eae3e2..61071ae348 100644 --- a/packages/store/src/codegen/tables/StoreHooks.sol +++ b/packages/store/src/codegen/tables/StoreHooks.sol @@ -81,7 +81,9 @@ library StoreHooks { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get hooks */ + /** + * @notice Get hooks + */ function getHooks(ResourceId tableId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -90,7 +92,9 @@ library StoreHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks */ + /** + * @notice Get hooks + */ function _getHooks(ResourceId tableId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -99,7 +103,9 @@ library StoreHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks (using the specified store) */ + /** + * @notice Get hooks (using the specified store) + */ function getHooks(IStore _store, ResourceId tableId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -108,7 +114,9 @@ library StoreHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks */ + /** + * @notice Get hooks + */ function get(ResourceId tableId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -117,7 +125,9 @@ library StoreHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks */ + /** + * @notice Get hooks + */ function _get(ResourceId tableId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -126,7 +136,9 @@ library StoreHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get hooks (using the specified store) */ + /** + * @notice Get hooks (using the specified store) + */ function get(IStore _store, ResourceId tableId) internal view returns (bytes21[] memory hooks) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -135,7 +147,9 @@ library StoreHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Set hooks */ + /** + * @notice Set hooks + */ function setHooks(ResourceId tableId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -143,7 +157,9 @@ library StoreHooks { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks */ + /** + * @notice Set hooks + */ function _setHooks(ResourceId tableId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -151,7 +167,9 @@ library StoreHooks { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks (using the specified store) */ + /** + * @notice Set hooks (using the specified store) + */ function setHooks(IStore _store, ResourceId tableId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -159,7 +177,9 @@ library StoreHooks { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks */ + /** + * @notice Set hooks + */ function set(ResourceId tableId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -167,7 +187,9 @@ library StoreHooks { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks */ + /** + * @notice Set hooks + */ function _set(ResourceId tableId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -175,7 +197,9 @@ library StoreHooks { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Set hooks (using the specified store) */ + /** + * @notice Set hooks (using the specified store) + */ function set(IStore _store, ResourceId tableId, bytes21[] memory hooks) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -183,7 +207,9 @@ library StoreHooks { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((hooks))); } - /** Get the length of hooks */ + /** + * @notice Get length of hooks + */ function lengthHooks(ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -194,7 +220,9 @@ library StoreHooks { } } - /** Get the length of hooks */ + /** + * @notice Get length of hooks + */ function _lengthHooks(ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -205,7 +233,9 @@ library StoreHooks { } } - /** Get the length of hooks (using the specified store) */ + /** + * @notice Get length of hooks (using the specified store) + */ function lengthHooks(IStore _store, ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -216,7 +246,9 @@ library StoreHooks { } } - /** Get the length of hooks */ + /** + * @notice Get length of hooks + */ function length(ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -227,7 +259,9 @@ library StoreHooks { } } - /** Get the length of hooks */ + /** + * @notice Get length of hooks + */ function _length(ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -238,7 +272,9 @@ library StoreHooks { } } - /** Get the length of hooks (using the specified store) */ + /** + * @notice Get length of hooks (using the specified store) + */ function length(IStore _store, ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -250,8 +286,8 @@ library StoreHooks { } /** - * Get an item of hooks - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks + * @dev (unchecked, returns invalid data if index overflows) */ function getItemHooks(ResourceId tableId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -264,8 +300,8 @@ library StoreHooks { } /** - * Get an item of hooks - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemHooks(ResourceId tableId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -278,8 +314,8 @@ library StoreHooks { } /** - * Get an item of hooks (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemHooks(IStore _store, ResourceId tableId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -292,8 +328,8 @@ library StoreHooks { } /** - * Get an item of hooks - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(ResourceId tableId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -306,8 +342,8 @@ library StoreHooks { } /** - * Get an item of hooks - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks + * @dev (unchecked, returns invalid data if index overflows) */ function _getItem(ResourceId tableId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -320,8 +356,8 @@ library StoreHooks { } /** - * Get an item of hooks (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of hooks (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(IStore _store, ResourceId tableId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -333,7 +369,9 @@ library StoreHooks { } } - /** Push an element to hooks */ + /** + * @notice Push an element to hooks + */ function pushHooks(ResourceId tableId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -341,7 +379,9 @@ library StoreHooks { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks */ + /** + * @notice Push an element to hooks + */ function _pushHooks(ResourceId tableId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -349,7 +389,9 @@ library StoreHooks { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks (using the specified store) */ + /** + * @notice Push an element to hooks (using the specified store) + */ function pushHooks(IStore _store, ResourceId tableId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -357,7 +399,9 @@ library StoreHooks { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks */ + /** + * @notice Push an element to hooks + */ function push(ResourceId tableId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -365,7 +409,9 @@ library StoreHooks { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks */ + /** + * @notice Push an element to hooks + */ function _push(ResourceId tableId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -373,7 +419,9 @@ library StoreHooks { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to hooks (using the specified store) */ + /** + * @notice Push an element to hooks (using the specified store) + */ function push(IStore _store, ResourceId tableId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -381,7 +429,9 @@ library StoreHooks { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from hooks */ + /** + * @notice Pop an element from hooks + */ function popHooks(ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -389,7 +439,9 @@ library StoreHooks { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks */ + /** + * @notice Pop an element from hooks + */ function _popHooks(ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -397,7 +449,9 @@ library StoreHooks { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks (using the specified store) */ + /** + * @notice Pop an element from hooks (using the specified store) + */ function popHooks(IStore _store, ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -405,7 +459,9 @@ library StoreHooks { _store.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks */ + /** + * @notice Pop an element from hooks + */ function pop(ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -413,7 +469,9 @@ library StoreHooks { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks */ + /** + * @notice Pop an element from hooks + */ function _pop(ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -421,7 +479,9 @@ library StoreHooks { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from hooks (using the specified store) */ + /** + * @notice Pop an element from hooks (using the specified store) + */ function pop(IStore _store, ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -430,8 +490,8 @@ library StoreHooks { } /** - * Update an element of hooks at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateHooks(ResourceId tableId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -444,8 +504,8 @@ library StoreHooks { } /** - * Update an element of hooks at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateHooks(ResourceId tableId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -458,8 +518,8 @@ library StoreHooks { } /** - * Update an element of hooks (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateHooks(IStore _store, ResourceId tableId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -472,8 +532,8 @@ library StoreHooks { } /** - * Update an element of hooks at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(ResourceId tableId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -486,8 +546,8 @@ library StoreHooks { } /** - * Update an element of hooks at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _update(ResourceId tableId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -500,8 +560,8 @@ library StoreHooks { } /** - * Update an element of hooks (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of hooks (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(IStore _store, ResourceId tableId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/store/src/codegen/tables/Tables.sol b/packages/store/src/codegen/tables/Tables.sol index 905afab95e..35ce722829 100644 --- a/packages/store/src/codegen/tables/Tables.sol +++ b/packages/store/src/codegen/tables/Tables.sol @@ -99,7 +99,9 @@ library Tables { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get fieldLayout */ + /** + * @notice Get fieldLayout + */ function getFieldLayout(ResourceId tableId) internal view returns (FieldLayout fieldLayout) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -108,7 +110,9 @@ library Tables { return FieldLayout.wrap(bytes32(_blob)); } - /** Get fieldLayout */ + /** + * @notice Get fieldLayout + */ function _getFieldLayout(ResourceId tableId) internal view returns (FieldLayout fieldLayout) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -117,7 +121,9 @@ library Tables { return FieldLayout.wrap(bytes32(_blob)); } - /** Get fieldLayout (using the specified store) */ + /** + * @notice Get fieldLayout (using the specified store) + */ function getFieldLayout(IStore _store, ResourceId tableId) internal view returns (FieldLayout fieldLayout) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -126,7 +132,9 @@ library Tables { return FieldLayout.wrap(bytes32(_blob)); } - /** Set fieldLayout */ + /** + * @notice Set fieldLayout + */ function setFieldLayout(ResourceId tableId, FieldLayout fieldLayout) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -134,7 +142,9 @@ library Tables { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(FieldLayout.unwrap(fieldLayout)), _fieldLayout); } - /** Set fieldLayout */ + /** + * @notice Set fieldLayout + */ function _setFieldLayout(ResourceId tableId, FieldLayout fieldLayout) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -142,7 +152,9 @@ library Tables { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(FieldLayout.unwrap(fieldLayout)), _fieldLayout); } - /** Set fieldLayout (using the specified store) */ + /** + * @notice Set fieldLayout (using the specified store) + */ function setFieldLayout(IStore _store, ResourceId tableId, FieldLayout fieldLayout) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -150,7 +162,9 @@ library Tables { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(FieldLayout.unwrap(fieldLayout)), _fieldLayout); } - /** Get keySchema */ + /** + * @notice Get keySchema + */ function getKeySchema(ResourceId tableId) internal view returns (Schema keySchema) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -159,7 +173,9 @@ library Tables { return Schema.wrap(bytes32(_blob)); } - /** Get keySchema */ + /** + * @notice Get keySchema + */ function _getKeySchema(ResourceId tableId) internal view returns (Schema keySchema) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -168,7 +184,9 @@ library Tables { return Schema.wrap(bytes32(_blob)); } - /** Get keySchema (using the specified store) */ + /** + * @notice Get keySchema (using the specified store) + */ function getKeySchema(IStore _store, ResourceId tableId) internal view returns (Schema keySchema) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -177,7 +195,9 @@ library Tables { return Schema.wrap(bytes32(_blob)); } - /** Set keySchema */ + /** + * @notice Set keySchema + */ function setKeySchema(ResourceId tableId, Schema keySchema) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -185,7 +205,9 @@ library Tables { StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked(Schema.unwrap(keySchema)), _fieldLayout); } - /** Set keySchema */ + /** + * @notice Set keySchema + */ function _setKeySchema(ResourceId tableId, Schema keySchema) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -193,7 +215,9 @@ library Tables { StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked(Schema.unwrap(keySchema)), _fieldLayout); } - /** Set keySchema (using the specified store) */ + /** + * @notice Set keySchema (using the specified store) + */ function setKeySchema(IStore _store, ResourceId tableId, Schema keySchema) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -201,7 +225,9 @@ library Tables { _store.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked(Schema.unwrap(keySchema)), _fieldLayout); } - /** Get valueSchema */ + /** + * @notice Get valueSchema + */ function getValueSchema(ResourceId tableId) internal view returns (Schema valueSchema) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -210,7 +236,9 @@ library Tables { return Schema.wrap(bytes32(_blob)); } - /** Get valueSchema */ + /** + * @notice Get valueSchema + */ function _getValueSchema(ResourceId tableId) internal view returns (Schema valueSchema) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -219,7 +247,9 @@ library Tables { return Schema.wrap(bytes32(_blob)); } - /** Get valueSchema (using the specified store) */ + /** + * @notice Get valueSchema (using the specified store) + */ function getValueSchema(IStore _store, ResourceId tableId) internal view returns (Schema valueSchema) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -228,7 +258,9 @@ library Tables { return Schema.wrap(bytes32(_blob)); } - /** Set valueSchema */ + /** + * @notice Set valueSchema + */ function setValueSchema(ResourceId tableId, Schema valueSchema) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -236,7 +268,9 @@ library Tables { StoreSwitch.setStaticField(_tableId, _keyTuple, 2, abi.encodePacked(Schema.unwrap(valueSchema)), _fieldLayout); } - /** Set valueSchema */ + /** + * @notice Set valueSchema + */ function _setValueSchema(ResourceId tableId, Schema valueSchema) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -244,7 +278,9 @@ library Tables { StoreCore.setStaticField(_tableId, _keyTuple, 2, abi.encodePacked(Schema.unwrap(valueSchema)), _fieldLayout); } - /** Set valueSchema (using the specified store) */ + /** + * @notice Set valueSchema (using the specified store) + */ function setValueSchema(IStore _store, ResourceId tableId, Schema valueSchema) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -252,7 +288,9 @@ library Tables { _store.setStaticField(_tableId, _keyTuple, 2, abi.encodePacked(Schema.unwrap(valueSchema)), _fieldLayout); } - /** Get abiEncodedKeyNames */ + /** + * @notice Get abiEncodedKeyNames + */ function getAbiEncodedKeyNames(ResourceId tableId) internal view returns (bytes memory abiEncodedKeyNames) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -261,7 +299,9 @@ library Tables { return (bytes(_blob)); } - /** Get abiEncodedKeyNames */ + /** + * @notice Get abiEncodedKeyNames + */ function _getAbiEncodedKeyNames(ResourceId tableId) internal view returns (bytes memory abiEncodedKeyNames) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -270,7 +310,9 @@ library Tables { return (bytes(_blob)); } - /** Get abiEncodedKeyNames (using the specified store) */ + /** + * @notice Get abiEncodedKeyNames (using the specified store) + */ function getAbiEncodedKeyNames( IStore _store, ResourceId tableId @@ -282,7 +324,9 @@ library Tables { return (bytes(_blob)); } - /** Set abiEncodedKeyNames */ + /** + * @notice Set abiEncodedKeyNames + */ function setAbiEncodedKeyNames(ResourceId tableId, bytes memory abiEncodedKeyNames) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -290,7 +334,9 @@ library Tables { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, bytes((abiEncodedKeyNames))); } - /** Set abiEncodedKeyNames */ + /** + * @notice Set abiEncodedKeyNames + */ function _setAbiEncodedKeyNames(ResourceId tableId, bytes memory abiEncodedKeyNames) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -298,7 +344,9 @@ library Tables { StoreCore.setDynamicField(_tableId, _keyTuple, 0, bytes((abiEncodedKeyNames))); } - /** Set abiEncodedKeyNames (using the specified store) */ + /** + * @notice Set abiEncodedKeyNames (using the specified store) + */ function setAbiEncodedKeyNames(IStore _store, ResourceId tableId, bytes memory abiEncodedKeyNames) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -306,7 +354,9 @@ library Tables { _store.setDynamicField(_tableId, _keyTuple, 0, bytes((abiEncodedKeyNames))); } - /** Get the length of abiEncodedKeyNames */ + /** + * @notice Get length of abiEncodedKeyNames + */ function lengthAbiEncodedKeyNames(ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -317,7 +367,9 @@ library Tables { } } - /** Get the length of abiEncodedKeyNames */ + /** + * @notice Get length of abiEncodedKeyNames + */ function _lengthAbiEncodedKeyNames(ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -328,7 +380,9 @@ library Tables { } } - /** Get the length of abiEncodedKeyNames (using the specified store) */ + /** + * @notice Get length of abiEncodedKeyNames (using the specified store) + */ function lengthAbiEncodedKeyNames(IStore _store, ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -340,8 +394,8 @@ library Tables { } /** - * Get an item of abiEncodedKeyNames - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of abiEncodedKeyNames + * @dev (unchecked, returns invalid data if index overflows) */ function getItemAbiEncodedKeyNames(ResourceId tableId, uint256 _index) internal view returns (bytes memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -354,8 +408,8 @@ library Tables { } /** - * Get an item of abiEncodedKeyNames - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of abiEncodedKeyNames + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemAbiEncodedKeyNames(ResourceId tableId, uint256 _index) internal view returns (bytes memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -368,8 +422,8 @@ library Tables { } /** - * Get an item of abiEncodedKeyNames (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of abiEncodedKeyNames (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemAbiEncodedKeyNames( IStore _store, @@ -385,7 +439,9 @@ library Tables { } } - /** Push a slice to abiEncodedKeyNames */ + /** + * @notice Push a slice to abiEncodedKeyNames + */ function pushAbiEncodedKeyNames(ResourceId tableId, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -393,7 +449,9 @@ library Tables { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, bytes((_slice))); } - /** Push a slice to abiEncodedKeyNames */ + /** + * @notice Push a slice to abiEncodedKeyNames + */ function _pushAbiEncodedKeyNames(ResourceId tableId, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -401,7 +459,9 @@ library Tables { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, bytes((_slice))); } - /** Push a slice to abiEncodedKeyNames (using the specified store) */ + /** + * @notice Push a slice to abiEncodedKeyNames (using the specified store) + */ function pushAbiEncodedKeyNames(IStore _store, ResourceId tableId, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -409,7 +469,9 @@ library Tables { _store.pushToDynamicField(_tableId, _keyTuple, 0, bytes((_slice))); } - /** Pop a slice from abiEncodedKeyNames */ + /** + * @notice Pop a slice from abiEncodedKeyNames + */ function popAbiEncodedKeyNames(ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -417,7 +479,9 @@ library Tables { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 1); } - /** Pop a slice from abiEncodedKeyNames */ + /** + * @notice Pop a slice from abiEncodedKeyNames + */ function _popAbiEncodedKeyNames(ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -425,7 +489,9 @@ library Tables { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 1); } - /** Pop a slice from abiEncodedKeyNames (using the specified store) */ + /** + * @notice Pop a slice from abiEncodedKeyNames (using the specified store) + */ function popAbiEncodedKeyNames(IStore _store, ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -434,8 +500,8 @@ library Tables { } /** - * Update a slice of abiEncodedKeyNames at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of abiEncodedKeyNames at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateAbiEncodedKeyNames(ResourceId tableId, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -448,8 +514,8 @@ library Tables { } /** - * Update a slice of abiEncodedKeyNames at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of abiEncodedKeyNames at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateAbiEncodedKeyNames(ResourceId tableId, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -462,8 +528,8 @@ library Tables { } /** - * Update a slice of abiEncodedKeyNames (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of abiEncodedKeyNames (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateAbiEncodedKeyNames(IStore _store, ResourceId tableId, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -475,7 +541,9 @@ library Tables { } } - /** Get abiEncodedFieldNames */ + /** + * @notice Get abiEncodedFieldNames + */ function getAbiEncodedFieldNames(ResourceId tableId) internal view returns (bytes memory abiEncodedFieldNames) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -484,7 +552,9 @@ library Tables { return (bytes(_blob)); } - /** Get abiEncodedFieldNames */ + /** + * @notice Get abiEncodedFieldNames + */ function _getAbiEncodedFieldNames(ResourceId tableId) internal view returns (bytes memory abiEncodedFieldNames) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -493,7 +563,9 @@ library Tables { return (bytes(_blob)); } - /** Get abiEncodedFieldNames (using the specified store) */ + /** + * @notice Get abiEncodedFieldNames (using the specified store) + */ function getAbiEncodedFieldNames( IStore _store, ResourceId tableId @@ -505,7 +577,9 @@ library Tables { return (bytes(_blob)); } - /** Set abiEncodedFieldNames */ + /** + * @notice Set abiEncodedFieldNames + */ function setAbiEncodedFieldNames(ResourceId tableId, bytes memory abiEncodedFieldNames) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -513,7 +587,9 @@ library Tables { StoreSwitch.setDynamicField(_tableId, _keyTuple, 1, bytes((abiEncodedFieldNames))); } - /** Set abiEncodedFieldNames */ + /** + * @notice Set abiEncodedFieldNames + */ function _setAbiEncodedFieldNames(ResourceId tableId, bytes memory abiEncodedFieldNames) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -521,7 +597,9 @@ library Tables { StoreCore.setDynamicField(_tableId, _keyTuple, 1, bytes((abiEncodedFieldNames))); } - /** Set abiEncodedFieldNames (using the specified store) */ + /** + * @notice Set abiEncodedFieldNames (using the specified store) + */ function setAbiEncodedFieldNames(IStore _store, ResourceId tableId, bytes memory abiEncodedFieldNames) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -529,7 +607,9 @@ library Tables { _store.setDynamicField(_tableId, _keyTuple, 1, bytes((abiEncodedFieldNames))); } - /** Get the length of abiEncodedFieldNames */ + /** + * @notice Get length of abiEncodedFieldNames + */ function lengthAbiEncodedFieldNames(ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -540,7 +620,9 @@ library Tables { } } - /** Get the length of abiEncodedFieldNames */ + /** + * @notice Get length of abiEncodedFieldNames + */ function _lengthAbiEncodedFieldNames(ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -551,7 +633,9 @@ library Tables { } } - /** Get the length of abiEncodedFieldNames (using the specified store) */ + /** + * @notice Get length of abiEncodedFieldNames (using the specified store) + */ function lengthAbiEncodedFieldNames(IStore _store, ResourceId tableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -563,8 +647,8 @@ library Tables { } /** - * Get an item of abiEncodedFieldNames - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of abiEncodedFieldNames + * @dev (unchecked, returns invalid data if index overflows) */ function getItemAbiEncodedFieldNames(ResourceId tableId, uint256 _index) internal view returns (bytes memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -577,8 +661,8 @@ library Tables { } /** - * Get an item of abiEncodedFieldNames - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of abiEncodedFieldNames + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemAbiEncodedFieldNames(ResourceId tableId, uint256 _index) internal view returns (bytes memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -591,8 +675,8 @@ library Tables { } /** - * Get an item of abiEncodedFieldNames (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of abiEncodedFieldNames (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemAbiEncodedFieldNames( IStore _store, @@ -608,7 +692,9 @@ library Tables { } } - /** Push a slice to abiEncodedFieldNames */ + /** + * @notice Push a slice to abiEncodedFieldNames + */ function pushAbiEncodedFieldNames(ResourceId tableId, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -616,7 +702,9 @@ library Tables { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Push a slice to abiEncodedFieldNames */ + /** + * @notice Push a slice to abiEncodedFieldNames + */ function _pushAbiEncodedFieldNames(ResourceId tableId, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -624,7 +712,9 @@ library Tables { StoreCore.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Push a slice to abiEncodedFieldNames (using the specified store) */ + /** + * @notice Push a slice to abiEncodedFieldNames (using the specified store) + */ function pushAbiEncodedFieldNames(IStore _store, ResourceId tableId, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -632,7 +722,9 @@ library Tables { _store.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Pop a slice from abiEncodedFieldNames */ + /** + * @notice Pop a slice from abiEncodedFieldNames + */ function popAbiEncodedFieldNames(ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -640,7 +732,9 @@ library Tables { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 1, 1); } - /** Pop a slice from abiEncodedFieldNames */ + /** + * @notice Pop a slice from abiEncodedFieldNames + */ function _popAbiEncodedFieldNames(ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -648,7 +742,9 @@ library Tables { StoreCore.popFromDynamicField(_tableId, _keyTuple, 1, 1); } - /** Pop a slice from abiEncodedFieldNames (using the specified store) */ + /** + * @notice Pop a slice from abiEncodedFieldNames (using the specified store) + */ function popAbiEncodedFieldNames(IStore _store, ResourceId tableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(tableId); @@ -657,8 +753,8 @@ library Tables { } /** - * Update a slice of abiEncodedFieldNames at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of abiEncodedFieldNames at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateAbiEncodedFieldNames(ResourceId tableId, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -671,8 +767,8 @@ library Tables { } /** - * Update a slice of abiEncodedFieldNames at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of abiEncodedFieldNames at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateAbiEncodedFieldNames(ResourceId tableId, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -685,8 +781,8 @@ library Tables { } /** - * Update a slice of abiEncodedFieldNames (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of abiEncodedFieldNames (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateAbiEncodedFieldNames(IStore _store, ResourceId tableId, uint256 _index, bytes memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/store/test/codegen/tables/Callbacks.sol b/packages/store/test/codegen/tables/Callbacks.sol index 8f2bfa82e8..858dbae210 100644 --- a/packages/store/test/codegen/tables/Callbacks.sol +++ b/packages/store/test/codegen/tables/Callbacks.sol @@ -78,7 +78,9 @@ library Callbacks { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get value */ + /** + * @notice Get value + */ function getValue(bytes32 key) internal view returns (bytes24[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -87,7 +89,9 @@ library Callbacks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes24()); } - /** Get value */ + /** + * @notice Get value + */ function _getValue(bytes32 key) internal view returns (bytes24[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -96,7 +100,9 @@ library Callbacks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes24()); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function getValue(IStore _store, bytes32 key) internal view returns (bytes24[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -105,7 +111,9 @@ library Callbacks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes24()); } - /** Get value */ + /** + * @notice Get value + */ function get(bytes32 key) internal view returns (bytes24[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -114,7 +122,9 @@ library Callbacks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes24()); } - /** Get value */ + /** + * @notice Get value + */ function _get(bytes32 key) internal view returns (bytes24[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -123,7 +133,9 @@ library Callbacks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes24()); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function get(IStore _store, bytes32 key) internal view returns (bytes24[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -132,7 +144,9 @@ library Callbacks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes24()); } - /** Set value */ + /** + * @notice Set value + */ function setValue(bytes32 key, bytes24[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -140,7 +154,9 @@ library Callbacks { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function _setValue(bytes32 key, bytes24[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -148,7 +164,9 @@ library Callbacks { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function setValue(IStore _store, bytes32 key, bytes24[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -156,7 +174,9 @@ library Callbacks { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function set(bytes32 key, bytes24[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -164,7 +184,9 @@ library Callbacks { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function _set(bytes32 key, bytes24[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -172,7 +194,9 @@ library Callbacks { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function set(IStore _store, bytes32 key, bytes24[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -180,7 +204,9 @@ library Callbacks { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Get the length of value */ + /** + * @notice Get length of value + */ function lengthValue(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -191,7 +217,9 @@ library Callbacks { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function _lengthValue(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -202,7 +230,9 @@ library Callbacks { } } - /** Get the length of value (using the specified store) */ + /** + * @notice Get length of value (using the specified store) + */ function lengthValue(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -213,7 +243,9 @@ library Callbacks { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function length(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -224,7 +256,9 @@ library Callbacks { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function _length(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -235,7 +269,9 @@ library Callbacks { } } - /** Get the length of value (using the specified store) */ + /** + * @notice Get length of value (using the specified store) + */ function length(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -247,8 +283,8 @@ library Callbacks { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function getItemValue(bytes32 key, uint256 _index) internal view returns (bytes24) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -261,8 +297,8 @@ library Callbacks { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemValue(bytes32 key, uint256 _index) internal view returns (bytes24) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -275,8 +311,8 @@ library Callbacks { } /** - * Get an item of value (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemValue(IStore _store, bytes32 key, uint256 _index) internal view returns (bytes24) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -289,8 +325,8 @@ library Callbacks { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(bytes32 key, uint256 _index) internal view returns (bytes24) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -303,8 +339,8 @@ library Callbacks { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function _getItem(bytes32 key, uint256 _index) internal view returns (bytes24) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -317,8 +353,8 @@ library Callbacks { } /** - * Get an item of value (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(IStore _store, bytes32 key, uint256 _index) internal view returns (bytes24) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -330,7 +366,9 @@ library Callbacks { } } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function pushValue(bytes32 key, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -338,7 +376,9 @@ library Callbacks { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function _pushValue(bytes32 key, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -346,7 +386,9 @@ library Callbacks { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value (using the specified store) */ + /** + * @notice Push an element to value (using the specified store) + */ function pushValue(IStore _store, bytes32 key, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -354,7 +396,9 @@ library Callbacks { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function push(bytes32 key, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -362,7 +406,9 @@ library Callbacks { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function _push(bytes32 key, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -370,7 +416,9 @@ library Callbacks { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value (using the specified store) */ + /** + * @notice Push an element to value (using the specified store) + */ function push(IStore _store, bytes32 key, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -378,7 +426,9 @@ library Callbacks { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function popValue(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -386,7 +436,9 @@ library Callbacks { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 24); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function _popValue(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -394,7 +446,9 @@ library Callbacks { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 24); } - /** Pop an element from value (using the specified store) */ + /** + * @notice Pop an element from value (using the specified store) + */ function popValue(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -402,7 +456,9 @@ library Callbacks { _store.popFromDynamicField(_tableId, _keyTuple, 0, 24); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function pop(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -410,7 +466,9 @@ library Callbacks { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 24); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function _pop(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -418,7 +476,9 @@ library Callbacks { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 24); } - /** Pop an element from value (using the specified store) */ + /** + * @notice Pop an element from value (using the specified store) + */ function pop(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -427,8 +487,8 @@ library Callbacks { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateValue(bytes32 key, uint256 _index, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -441,8 +501,8 @@ library Callbacks { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateValue(bytes32 key, uint256 _index, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -455,8 +515,8 @@ library Callbacks { } /** - * Update an element of value (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateValue(IStore _store, bytes32 key, uint256 _index, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -469,8 +529,8 @@ library Callbacks { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(bytes32 key, uint256 _index, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -483,8 +543,8 @@ library Callbacks { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _update(bytes32 key, uint256 _index, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -497,8 +557,8 @@ library Callbacks { } /** - * Update an element of value (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(IStore _store, bytes32 key, uint256 _index, bytes24 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/store/test/codegen/tables/KeyEncoding.sol b/packages/store/test/codegen/tables/KeyEncoding.sol index 26608f1940..556c7ff696 100644 --- a/packages/store/test/codegen/tables/KeyEncoding.sol +++ b/packages/store/test/codegen/tables/KeyEncoding.sol @@ -91,7 +91,9 @@ library KeyEncoding { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get value */ + /** + * @notice Get value + */ function getValue( uint256 k1, int32 k2, @@ -112,7 +114,9 @@ library KeyEncoding { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value */ + /** + * @notice Get value + */ function _getValue( uint256 k1, int32 k2, @@ -133,7 +137,9 @@ library KeyEncoding { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function getValue( IStore _store, uint256 k1, @@ -155,7 +161,9 @@ library KeyEncoding { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value */ + /** + * @notice Get value + */ function get( uint256 k1, int32 k2, @@ -176,7 +184,9 @@ library KeyEncoding { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value */ + /** + * @notice Get value + */ function _get( uint256 k1, int32 k2, @@ -197,7 +207,9 @@ library KeyEncoding { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function get( IStore _store, uint256 k1, @@ -219,7 +231,9 @@ library KeyEncoding { return (_toBool(uint8(bytes1(_blob)))); } - /** Set value */ + /** + * @notice Set value + */ function setValue(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, ExampleEnum k6, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -232,7 +246,9 @@ library KeyEncoding { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function _setValue(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, ExampleEnum k6, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -245,7 +261,9 @@ library KeyEncoding { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function setValue( IStore _store, uint256 k1, @@ -267,7 +285,9 @@ library KeyEncoding { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function set(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, ExampleEnum k6, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -280,7 +300,9 @@ library KeyEncoding { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function _set(uint256 k1, int32 k2, bytes16 k3, address k4, bool k5, ExampleEnum k6, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](6); _keyTuple[0] = bytes32(uint256(k1)); @@ -293,7 +315,9 @@ library KeyEncoding { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function set( IStore _store, uint256 k1, diff --git a/packages/store/test/codegen/tables/Mixed.sol b/packages/store/test/codegen/tables/Mixed.sol index c433428efa..c54fa7b48c 100644 --- a/packages/store/test/codegen/tables/Mixed.sol +++ b/packages/store/test/codegen/tables/Mixed.sol @@ -91,7 +91,9 @@ library Mixed { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get u32 */ + /** + * @notice Get u32 + */ function getU32(bytes32 key) internal view returns (uint32 u32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -100,7 +102,9 @@ library Mixed { return (uint32(bytes4(_blob))); } - /** Get u32 */ + /** + * @notice Get u32 + */ function _getU32(bytes32 key) internal view returns (uint32 u32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -109,7 +113,9 @@ library Mixed { return (uint32(bytes4(_blob))); } - /** Get u32 (using the specified store) */ + /** + * @notice Get u32 (using the specified store) + */ function getU32(IStore _store, bytes32 key) internal view returns (uint32 u32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -118,7 +124,9 @@ library Mixed { return (uint32(bytes4(_blob))); } - /** Set u32 */ + /** + * @notice Set u32 + */ function setU32(bytes32 key, uint32 u32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -126,7 +134,9 @@ library Mixed { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((u32)), _fieldLayout); } - /** Set u32 */ + /** + * @notice Set u32 + */ function _setU32(bytes32 key, uint32 u32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -134,7 +144,9 @@ library Mixed { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((u32)), _fieldLayout); } - /** Set u32 (using the specified store) */ + /** + * @notice Set u32 (using the specified store) + */ function setU32(IStore _store, bytes32 key, uint32 u32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -142,7 +154,9 @@ library Mixed { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((u32)), _fieldLayout); } - /** Get u128 */ + /** + * @notice Get u128 + */ function getU128(bytes32 key) internal view returns (uint128 u128) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -151,7 +165,9 @@ library Mixed { return (uint128(bytes16(_blob))); } - /** Get u128 */ + /** + * @notice Get u128 + */ function _getU128(bytes32 key) internal view returns (uint128 u128) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -160,7 +176,9 @@ library Mixed { return (uint128(bytes16(_blob))); } - /** Get u128 (using the specified store) */ + /** + * @notice Get u128 (using the specified store) + */ function getU128(IStore _store, bytes32 key) internal view returns (uint128 u128) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -169,7 +187,9 @@ library Mixed { return (uint128(bytes16(_blob))); } - /** Set u128 */ + /** + * @notice Set u128 + */ function setU128(bytes32 key, uint128 u128) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -177,7 +197,9 @@ library Mixed { StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((u128)), _fieldLayout); } - /** Set u128 */ + /** + * @notice Set u128 + */ function _setU128(bytes32 key, uint128 u128) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -185,7 +207,9 @@ library Mixed { StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((u128)), _fieldLayout); } - /** Set u128 (using the specified store) */ + /** + * @notice Set u128 (using the specified store) + */ function setU128(IStore _store, bytes32 key, uint128 u128) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -193,7 +217,9 @@ library Mixed { _store.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((u128)), _fieldLayout); } - /** Get a32 */ + /** + * @notice Get a32 + */ function getA32(bytes32 key) internal view returns (uint32[] memory a32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -202,7 +228,9 @@ library Mixed { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Get a32 */ + /** + * @notice Get a32 + */ function _getA32(bytes32 key) internal view returns (uint32[] memory a32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -211,7 +239,9 @@ library Mixed { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Get a32 (using the specified store) */ + /** + * @notice Get a32 (using the specified store) + */ function getA32(IStore _store, bytes32 key) internal view returns (uint32[] memory a32) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -220,7 +250,9 @@ library Mixed { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_uint32()); } - /** Set a32 */ + /** + * @notice Set a32 + */ function setA32(bytes32 key, uint32[] memory a32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -228,7 +260,9 @@ library Mixed { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((a32))); } - /** Set a32 */ + /** + * @notice Set a32 + */ function _setA32(bytes32 key, uint32[] memory a32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -236,7 +270,9 @@ library Mixed { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((a32))); } - /** Set a32 (using the specified store) */ + /** + * @notice Set a32 (using the specified store) + */ function setA32(IStore _store, bytes32 key, uint32[] memory a32) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -244,7 +280,9 @@ library Mixed { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((a32))); } - /** Get the length of a32 */ + /** + * @notice Get length of a32 + */ function lengthA32(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -255,7 +293,9 @@ library Mixed { } } - /** Get the length of a32 */ + /** + * @notice Get length of a32 + */ function _lengthA32(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -266,7 +306,9 @@ library Mixed { } } - /** Get the length of a32 (using the specified store) */ + /** + * @notice Get length of a32 (using the specified store) + */ function lengthA32(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -278,8 +320,8 @@ library Mixed { } /** - * Get an item of a32 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of a32 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemA32(bytes32 key, uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -292,8 +334,8 @@ library Mixed { } /** - * Get an item of a32 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of a32 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemA32(bytes32 key, uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -306,8 +348,8 @@ library Mixed { } /** - * Get an item of a32 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of a32 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemA32(IStore _store, bytes32 key, uint256 _index) internal view returns (uint32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -319,7 +361,9 @@ library Mixed { } } - /** Push an element to a32 */ + /** + * @notice Push an element to a32 + */ function pushA32(bytes32 key, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -327,7 +371,9 @@ library Mixed { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to a32 */ + /** + * @notice Push an element to a32 + */ function _pushA32(bytes32 key, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -335,7 +381,9 @@ library Mixed { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to a32 (using the specified store) */ + /** + * @notice Push an element to a32 (using the specified store) + */ function pushA32(IStore _store, bytes32 key, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -343,7 +391,9 @@ library Mixed { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from a32 */ + /** + * @notice Pop an element from a32 + */ function popA32(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -351,7 +401,9 @@ library Mixed { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 4); } - /** Pop an element from a32 */ + /** + * @notice Pop an element from a32 + */ function _popA32(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -359,7 +411,9 @@ library Mixed { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 4); } - /** Pop an element from a32 (using the specified store) */ + /** + * @notice Pop an element from a32 (using the specified store) + */ function popA32(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -368,8 +422,8 @@ library Mixed { } /** - * Update an element of a32 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of a32 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateA32(bytes32 key, uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -382,8 +436,8 @@ library Mixed { } /** - * Update an element of a32 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of a32 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateA32(bytes32 key, uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -396,8 +450,8 @@ library Mixed { } /** - * Update an element of a32 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of a32 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateA32(IStore _store, bytes32 key, uint256 _index, uint32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -409,7 +463,9 @@ library Mixed { } } - /** Get s */ + /** + * @notice Get s + */ function getS(bytes32 key) internal view returns (string memory s) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -418,7 +474,9 @@ library Mixed { return (string(_blob)); } - /** Get s */ + /** + * @notice Get s + */ function _getS(bytes32 key) internal view returns (string memory s) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -427,7 +485,9 @@ library Mixed { return (string(_blob)); } - /** Get s (using the specified store) */ + /** + * @notice Get s (using the specified store) + */ function getS(IStore _store, bytes32 key) internal view returns (string memory s) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -436,7 +496,9 @@ library Mixed { return (string(_blob)); } - /** Set s */ + /** + * @notice Set s + */ function setS(bytes32 key, string memory s) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -444,7 +506,9 @@ library Mixed { StoreSwitch.setDynamicField(_tableId, _keyTuple, 1, bytes((s))); } - /** Set s */ + /** + * @notice Set s + */ function _setS(bytes32 key, string memory s) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -452,7 +516,9 @@ library Mixed { StoreCore.setDynamicField(_tableId, _keyTuple, 1, bytes((s))); } - /** Set s (using the specified store) */ + /** + * @notice Set s (using the specified store) + */ function setS(IStore _store, bytes32 key, string memory s) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -460,7 +526,9 @@ library Mixed { _store.setDynamicField(_tableId, _keyTuple, 1, bytes((s))); } - /** Get the length of s */ + /** + * @notice Get length of s + */ function lengthS(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -471,7 +539,9 @@ library Mixed { } } - /** Get the length of s */ + /** + * @notice Get length of s + */ function _lengthS(bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -482,7 +552,9 @@ library Mixed { } } - /** Get the length of s (using the specified store) */ + /** + * @notice Get length of s (using the specified store) + */ function lengthS(IStore _store, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -494,8 +566,8 @@ library Mixed { } /** - * Get an item of s - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of s + * @dev (unchecked, returns invalid data if index overflows) */ function getItemS(bytes32 key, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -508,8 +580,8 @@ library Mixed { } /** - * Get an item of s - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of s + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemS(bytes32 key, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -522,8 +594,8 @@ library Mixed { } /** - * Get an item of s (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of s (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemS(IStore _store, bytes32 key, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -535,7 +607,9 @@ library Mixed { } } - /** Push a slice to s */ + /** + * @notice Push a slice to s + */ function pushS(bytes32 key, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -543,7 +617,9 @@ library Mixed { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Push a slice to s */ + /** + * @notice Push a slice to s + */ function _pushS(bytes32 key, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -551,7 +627,9 @@ library Mixed { StoreCore.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Push a slice to s (using the specified store) */ + /** + * @notice Push a slice to s (using the specified store) + */ function pushS(IStore _store, bytes32 key, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -559,7 +637,9 @@ library Mixed { _store.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } - /** Pop a slice from s */ + /** + * @notice Pop a slice from s + */ function popS(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -567,7 +647,9 @@ library Mixed { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 1, 1); } - /** Pop a slice from s */ + /** + * @notice Pop a slice from s + */ function _popS(bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -575,7 +657,9 @@ library Mixed { StoreCore.popFromDynamicField(_tableId, _keyTuple, 1, 1); } - /** Pop a slice from s (using the specified store) */ + /** + * @notice Pop a slice from s (using the specified store) + */ function popS(IStore _store, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -584,8 +668,8 @@ library Mixed { } /** - * Update a slice of s at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of s at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateS(bytes32 key, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -598,8 +682,8 @@ library Mixed { } /** - * Update a slice of s at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of s at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateS(bytes32 key, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -612,8 +696,8 @@ library Mixed { } /** - * Update a slice of s (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update a slice of s (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateS(IStore _store, bytes32 key, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/store/test/codegen/tables/Vector2.sol b/packages/store/test/codegen/tables/Vector2.sol index c05d7c8552..aa306a639e 100644 --- a/packages/store/test/codegen/tables/Vector2.sol +++ b/packages/store/test/codegen/tables/Vector2.sol @@ -85,7 +85,9 @@ library Vector2 { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get x */ + /** + * @notice Get x + */ function getX(bytes32 key) internal view returns (uint32 x) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -94,7 +96,9 @@ library Vector2 { return (uint32(bytes4(_blob))); } - /** Get x */ + /** + * @notice Get x + */ function _getX(bytes32 key) internal view returns (uint32 x) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -103,7 +107,9 @@ library Vector2 { return (uint32(bytes4(_blob))); } - /** Get x (using the specified store) */ + /** + * @notice Get x (using the specified store) + */ function getX(IStore _store, bytes32 key) internal view returns (uint32 x) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -112,7 +118,9 @@ library Vector2 { return (uint32(bytes4(_blob))); } - /** Set x */ + /** + * @notice Set x + */ function setX(bytes32 key, uint32 x) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -120,7 +128,9 @@ library Vector2 { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((x)), _fieldLayout); } - /** Set x */ + /** + * @notice Set x + */ function _setX(bytes32 key, uint32 x) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -128,7 +138,9 @@ library Vector2 { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((x)), _fieldLayout); } - /** Set x (using the specified store) */ + /** + * @notice Set x (using the specified store) + */ function setX(IStore _store, bytes32 key, uint32 x) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -136,7 +148,9 @@ library Vector2 { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((x)), _fieldLayout); } - /** Get y */ + /** + * @notice Get y + */ function getY(bytes32 key) internal view returns (uint32 y) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -145,7 +159,9 @@ library Vector2 { return (uint32(bytes4(_blob))); } - /** Get y */ + /** + * @notice Get y + */ function _getY(bytes32 key) internal view returns (uint32 y) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -154,7 +170,9 @@ library Vector2 { return (uint32(bytes4(_blob))); } - /** Get y (using the specified store) */ + /** + * @notice Get y (using the specified store) + */ function getY(IStore _store, bytes32 key) internal view returns (uint32 y) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -163,7 +181,9 @@ library Vector2 { return (uint32(bytes4(_blob))); } - /** Set y */ + /** + * @notice Set y + */ function setY(bytes32 key, uint32 y) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -171,7 +191,9 @@ library Vector2 { StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((y)), _fieldLayout); } - /** Set y */ + /** + * @notice Set y + */ function _setY(bytes32 key, uint32 y) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -179,7 +201,9 @@ library Vector2 { StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((y)), _fieldLayout); } - /** Set y (using the specified store) */ + /** + * @notice Set y (using the specified store) + */ function setY(IStore _store, bytes32 key, uint32 y) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; diff --git a/packages/store/ts/codegen/field.ts b/packages/store/ts/codegen/field.ts index 30b0beeebe..44ab2bdee6 100644 --- a/packages/store/ts/codegen/field.ts +++ b/packages/store/ts/codegen/field.ts @@ -26,7 +26,9 @@ export function renderFieldMethods(options: RenderTableOptions) { renderWithStore( storeArgument, (_typedStore, _store, _commentSuffix, _untypedStore, _methodNamePrefix) => ` - /** Get ${field.name}${_commentSuffix} */ + /** + * @notice Get ${field.name}${_commentSuffix} + */ function ${_methodNamePrefix}get${_methodNameSuffix}(${renderArguments([ _typedStore, _typedTableId, @@ -64,7 +66,9 @@ export function renderFieldMethods(options: RenderTableOptions) { : `_tableId, _keyTuple, ${schemaIndex}, ${encodeFieldSingle}, _fieldLayout`; return ` - /** Set ${field.name}${_commentSuffix} */ + /** + * @notice Set ${field.name}${_commentSuffix} + */ function ${_methodNamePrefix}set${_methodNameSuffix}(${externalArguments}) internal { ${_keyTupleDefinition} ${_store}.${setFieldMethod}(${internalArguments}); @@ -82,7 +86,9 @@ export function renderFieldMethods(options: RenderTableOptions) { renderWithStore( storeArgument, (_typedStore, _store, _commentSuffix, _untypedStore, _methodNamePrefix) => ` - /** Get the length of ${field.name}${_commentSuffix} */ + /** + * @notice Get length of ${field.name}${_commentSuffix} + */ function ${_methodNamePrefix}length${_methodNameSuffix}(${renderArguments([ _typedStore, _typedTableId, @@ -103,9 +109,9 @@ export function renderFieldMethods(options: RenderTableOptions) { storeArgument, (_typedStore, _store, _commentSuffix, _untypedStore, _methodNamePrefix) => ` /** - * Get an item of ${field.name}${_commentSuffix} - * (unchecked, returns invalid data if index overflows) - */ + * @notice Get an item of ${field.name}${_commentSuffix} + * @dev (unchecked, returns invalid data if index overflows) + */ function ${_methodNamePrefix}getItem${_methodNameSuffix}(${renderArguments([ _typedStore, _typedTableId, @@ -133,7 +139,9 @@ export function renderFieldMethods(options: RenderTableOptions) { renderWithStore( storeArgument, (_typedStore, _store, _commentSuffix, _untypedStore, _methodNamePrefix) => ` - /** Push ${portionData.title} to ${field.name}${_commentSuffix} */ + /** + * @notice Push ${portionData.title} to ${field.name}${_commentSuffix} + */ function ${_methodNamePrefix}push${_methodNameSuffix}(${renderArguments([ _typedStore, _typedTableId, @@ -151,7 +159,9 @@ export function renderFieldMethods(options: RenderTableOptions) { renderWithStore( storeArgument, (_typedStore, _store, _commentSuffix, _untypedStore, _methodNamePrefix) => ` - /** Pop ${portionData.title} from ${field.name}${_commentSuffix} */ + /** + * @notice Pop ${portionData.title} from ${field.name}${_commentSuffix} + */ function ${_methodNamePrefix}pop${_methodNameSuffix}(${renderArguments([ _typedStore, _typedTableId, @@ -184,10 +194,10 @@ export function renderFieldMethods(options: RenderTableOptions) { `; return ` - /** - * Update ${portionData.title} of ${field.name}${_commentSuffix} at \`_index\` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) - */ + /** + * @notice Update ${portionData.title} of ${field.name}${_commentSuffix} at \`_index\` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) + */ function ${_methodNamePrefix}update${_methodNameSuffix}(${externalArguments}) internal { ${_keyTupleDefinition} unchecked { diff --git a/packages/world-modules/src/interfaces/IBaseWorld.sol b/packages/world-modules/src/interfaces/IBaseWorld.sol index f29e3b53db..bdba13f19a 100644 --- a/packages/world-modules/src/interfaces/IBaseWorld.sol +++ b/packages/world-modules/src/interfaces/IBaseWorld.sol @@ -7,8 +7,9 @@ import { IStore } from "@latticexyz/store/src/IStore.sol"; import { IWorldKernel } from "@latticexyz/world/src/IWorldKernel.sol"; /** - * The IBaseWorld interface includes all systems dynamically added to the World - * during the deploy process. + * @title IBaseWorld + * @notice This interface integrates all systems that are dynamically added to the World during deployment. + * @dev This is an autogenerated file; do not edit manually. */ interface IBaseWorld is IStore, IWorldKernel { diff --git a/packages/world-modules/src/modules/keysintable/tables/KeysInTable.sol b/packages/world-modules/src/modules/keysintable/tables/KeysInTable.sol index ccaab3133b..3d375cabef 100644 --- a/packages/world-modules/src/modules/keysintable/tables/KeysInTable.sol +++ b/packages/world-modules/src/modules/keysintable/tables/KeysInTable.sol @@ -97,7 +97,9 @@ library KeysInTable { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get keys0 */ + /** + * @notice Get keys0 + */ function getKeys0(ResourceId sourceTableId) internal view returns (bytes32[] memory keys0) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -106,7 +108,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys0 */ + /** + * @notice Get keys0 + */ function _getKeys0(ResourceId sourceTableId) internal view returns (bytes32[] memory keys0) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -115,7 +119,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys0 (using the specified store) */ + /** + * @notice Get keys0 (using the specified store) + */ function getKeys0(IStore _store, ResourceId sourceTableId) internal view returns (bytes32[] memory keys0) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -124,7 +130,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Set keys0 */ + /** + * @notice Set keys0 + */ function setKeys0(ResourceId sourceTableId, bytes32[] memory keys0) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -132,7 +140,9 @@ library KeysInTable { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keys0))); } - /** Set keys0 */ + /** + * @notice Set keys0 + */ function _setKeys0(ResourceId sourceTableId, bytes32[] memory keys0) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -140,7 +150,9 @@ library KeysInTable { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keys0))); } - /** Set keys0 (using the specified store) */ + /** + * @notice Set keys0 (using the specified store) + */ function setKeys0(IStore _store, ResourceId sourceTableId, bytes32[] memory keys0) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -148,7 +160,9 @@ library KeysInTable { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keys0))); } - /** Get the length of keys0 */ + /** + * @notice Get length of keys0 + */ function lengthKeys0(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -159,7 +173,9 @@ library KeysInTable { } } - /** Get the length of keys0 */ + /** + * @notice Get length of keys0 + */ function _lengthKeys0(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -170,7 +186,9 @@ library KeysInTable { } } - /** Get the length of keys0 (using the specified store) */ + /** + * @notice Get length of keys0 (using the specified store) + */ function lengthKeys0(IStore _store, ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -182,8 +200,8 @@ library KeysInTable { } /** - * Get an item of keys0 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys0 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys0(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -196,8 +214,8 @@ library KeysInTable { } /** - * Get an item of keys0 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys0 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemKeys0(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -210,8 +228,8 @@ library KeysInTable { } /** - * Get an item of keys0 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys0 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys0(IStore _store, ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -223,7 +241,9 @@ library KeysInTable { } } - /** Push an element to keys0 */ + /** + * @notice Push an element to keys0 + */ function pushKeys0(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -231,7 +251,9 @@ library KeysInTable { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to keys0 */ + /** + * @notice Push an element to keys0 + */ function _pushKeys0(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -239,7 +261,9 @@ library KeysInTable { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to keys0 (using the specified store) */ + /** + * @notice Push an element to keys0 (using the specified store) + */ function pushKeys0(IStore _store, ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -247,7 +271,9 @@ library KeysInTable { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from keys0 */ + /** + * @notice Pop an element from keys0 + */ function popKeys0(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -255,7 +281,9 @@ library KeysInTable { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from keys0 */ + /** + * @notice Pop an element from keys0 + */ function _popKeys0(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -263,7 +291,9 @@ library KeysInTable { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from keys0 (using the specified store) */ + /** + * @notice Pop an element from keys0 (using the specified store) + */ function popKeys0(IStore _store, ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -272,8 +302,8 @@ library KeysInTable { } /** - * Update an element of keys0 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys0 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys0(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -286,8 +316,8 @@ library KeysInTable { } /** - * Update an element of keys0 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys0 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateKeys0(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -300,8 +330,8 @@ library KeysInTable { } /** - * Update an element of keys0 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys0 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys0(IStore _store, ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -313,7 +343,9 @@ library KeysInTable { } } - /** Get keys1 */ + /** + * @notice Get keys1 + */ function getKeys1(ResourceId sourceTableId) internal view returns (bytes32[] memory keys1) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -322,7 +354,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys1 */ + /** + * @notice Get keys1 + */ function _getKeys1(ResourceId sourceTableId) internal view returns (bytes32[] memory keys1) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -331,7 +365,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys1 (using the specified store) */ + /** + * @notice Get keys1 (using the specified store) + */ function getKeys1(IStore _store, ResourceId sourceTableId) internal view returns (bytes32[] memory keys1) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -340,7 +376,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Set keys1 */ + /** + * @notice Set keys1 + */ function setKeys1(ResourceId sourceTableId, bytes32[] memory keys1) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -348,7 +386,9 @@ library KeysInTable { StoreSwitch.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode((keys1))); } - /** Set keys1 */ + /** + * @notice Set keys1 + */ function _setKeys1(ResourceId sourceTableId, bytes32[] memory keys1) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -356,7 +396,9 @@ library KeysInTable { StoreCore.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode((keys1))); } - /** Set keys1 (using the specified store) */ + /** + * @notice Set keys1 (using the specified store) + */ function setKeys1(IStore _store, ResourceId sourceTableId, bytes32[] memory keys1) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -364,7 +406,9 @@ library KeysInTable { _store.setDynamicField(_tableId, _keyTuple, 1, EncodeArray.encode((keys1))); } - /** Get the length of keys1 */ + /** + * @notice Get length of keys1 + */ function lengthKeys1(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -375,7 +419,9 @@ library KeysInTable { } } - /** Get the length of keys1 */ + /** + * @notice Get length of keys1 + */ function _lengthKeys1(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -386,7 +432,9 @@ library KeysInTable { } } - /** Get the length of keys1 (using the specified store) */ + /** + * @notice Get length of keys1 (using the specified store) + */ function lengthKeys1(IStore _store, ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -398,8 +446,8 @@ library KeysInTable { } /** - * Get an item of keys1 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys1 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys1(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -412,8 +460,8 @@ library KeysInTable { } /** - * Get an item of keys1 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys1 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemKeys1(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -426,8 +474,8 @@ library KeysInTable { } /** - * Get an item of keys1 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys1 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys1(IStore _store, ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -439,7 +487,9 @@ library KeysInTable { } } - /** Push an element to keys1 */ + /** + * @notice Push an element to keys1 + */ function pushKeys1(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -447,7 +497,9 @@ library KeysInTable { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Push an element to keys1 */ + /** + * @notice Push an element to keys1 + */ function _pushKeys1(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -455,7 +507,9 @@ library KeysInTable { StoreCore.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Push an element to keys1 (using the specified store) */ + /** + * @notice Push an element to keys1 (using the specified store) + */ function pushKeys1(IStore _store, ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -463,7 +517,9 @@ library KeysInTable { _store.pushToDynamicField(_tableId, _keyTuple, 1, abi.encodePacked((_element))); } - /** Pop an element from keys1 */ + /** + * @notice Pop an element from keys1 + */ function popKeys1(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -471,7 +527,9 @@ library KeysInTable { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 1, 32); } - /** Pop an element from keys1 */ + /** + * @notice Pop an element from keys1 + */ function _popKeys1(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -479,7 +537,9 @@ library KeysInTable { StoreCore.popFromDynamicField(_tableId, _keyTuple, 1, 32); } - /** Pop an element from keys1 (using the specified store) */ + /** + * @notice Pop an element from keys1 (using the specified store) + */ function popKeys1(IStore _store, ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -488,8 +548,8 @@ library KeysInTable { } /** - * Update an element of keys1 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys1 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys1(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -502,8 +562,8 @@ library KeysInTable { } /** - * Update an element of keys1 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys1 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateKeys1(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -516,8 +576,8 @@ library KeysInTable { } /** - * Update an element of keys1 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys1 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys1(IStore _store, ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -529,7 +589,9 @@ library KeysInTable { } } - /** Get keys2 */ + /** + * @notice Get keys2 + */ function getKeys2(ResourceId sourceTableId) internal view returns (bytes32[] memory keys2) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -538,7 +600,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys2 */ + /** + * @notice Get keys2 + */ function _getKeys2(ResourceId sourceTableId) internal view returns (bytes32[] memory keys2) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -547,7 +611,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys2 (using the specified store) */ + /** + * @notice Get keys2 (using the specified store) + */ function getKeys2(IStore _store, ResourceId sourceTableId) internal view returns (bytes32[] memory keys2) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -556,7 +622,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Set keys2 */ + /** + * @notice Set keys2 + */ function setKeys2(ResourceId sourceTableId, bytes32[] memory keys2) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -564,7 +632,9 @@ library KeysInTable { StoreSwitch.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode((keys2))); } - /** Set keys2 */ + /** + * @notice Set keys2 + */ function _setKeys2(ResourceId sourceTableId, bytes32[] memory keys2) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -572,7 +642,9 @@ library KeysInTable { StoreCore.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode((keys2))); } - /** Set keys2 (using the specified store) */ + /** + * @notice Set keys2 (using the specified store) + */ function setKeys2(IStore _store, ResourceId sourceTableId, bytes32[] memory keys2) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -580,7 +652,9 @@ library KeysInTable { _store.setDynamicField(_tableId, _keyTuple, 2, EncodeArray.encode((keys2))); } - /** Get the length of keys2 */ + /** + * @notice Get length of keys2 + */ function lengthKeys2(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -591,7 +665,9 @@ library KeysInTable { } } - /** Get the length of keys2 */ + /** + * @notice Get length of keys2 + */ function _lengthKeys2(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -602,7 +678,9 @@ library KeysInTable { } } - /** Get the length of keys2 (using the specified store) */ + /** + * @notice Get length of keys2 (using the specified store) + */ function lengthKeys2(IStore _store, ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -614,8 +692,8 @@ library KeysInTable { } /** - * Get an item of keys2 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys2 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys2(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -628,8 +706,8 @@ library KeysInTable { } /** - * Get an item of keys2 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys2 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemKeys2(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -642,8 +720,8 @@ library KeysInTable { } /** - * Get an item of keys2 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys2 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys2(IStore _store, ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -655,7 +733,9 @@ library KeysInTable { } } - /** Push an element to keys2 */ + /** + * @notice Push an element to keys2 + */ function pushKeys2(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -663,7 +743,9 @@ library KeysInTable { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Push an element to keys2 */ + /** + * @notice Push an element to keys2 + */ function _pushKeys2(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -671,7 +753,9 @@ library KeysInTable { StoreCore.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Push an element to keys2 (using the specified store) */ + /** + * @notice Push an element to keys2 (using the specified store) + */ function pushKeys2(IStore _store, ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -679,7 +763,9 @@ library KeysInTable { _store.pushToDynamicField(_tableId, _keyTuple, 2, abi.encodePacked((_element))); } - /** Pop an element from keys2 */ + /** + * @notice Pop an element from keys2 + */ function popKeys2(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -687,7 +773,9 @@ library KeysInTable { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 2, 32); } - /** Pop an element from keys2 */ + /** + * @notice Pop an element from keys2 + */ function _popKeys2(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -695,7 +783,9 @@ library KeysInTable { StoreCore.popFromDynamicField(_tableId, _keyTuple, 2, 32); } - /** Pop an element from keys2 (using the specified store) */ + /** + * @notice Pop an element from keys2 (using the specified store) + */ function popKeys2(IStore _store, ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -704,8 +794,8 @@ library KeysInTable { } /** - * Update an element of keys2 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys2 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys2(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -718,8 +808,8 @@ library KeysInTable { } /** - * Update an element of keys2 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys2 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateKeys2(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -732,8 +822,8 @@ library KeysInTable { } /** - * Update an element of keys2 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys2 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys2(IStore _store, ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -745,7 +835,9 @@ library KeysInTable { } } - /** Get keys3 */ + /** + * @notice Get keys3 + */ function getKeys3(ResourceId sourceTableId) internal view returns (bytes32[] memory keys3) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -754,7 +846,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys3 */ + /** + * @notice Get keys3 + */ function _getKeys3(ResourceId sourceTableId) internal view returns (bytes32[] memory keys3) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -763,7 +857,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys3 (using the specified store) */ + /** + * @notice Get keys3 (using the specified store) + */ function getKeys3(IStore _store, ResourceId sourceTableId) internal view returns (bytes32[] memory keys3) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -772,7 +868,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Set keys3 */ + /** + * @notice Set keys3 + */ function setKeys3(ResourceId sourceTableId, bytes32[] memory keys3) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -780,7 +878,9 @@ library KeysInTable { StoreSwitch.setDynamicField(_tableId, _keyTuple, 3, EncodeArray.encode((keys3))); } - /** Set keys3 */ + /** + * @notice Set keys3 + */ function _setKeys3(ResourceId sourceTableId, bytes32[] memory keys3) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -788,7 +888,9 @@ library KeysInTable { StoreCore.setDynamicField(_tableId, _keyTuple, 3, EncodeArray.encode((keys3))); } - /** Set keys3 (using the specified store) */ + /** + * @notice Set keys3 (using the specified store) + */ function setKeys3(IStore _store, ResourceId sourceTableId, bytes32[] memory keys3) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -796,7 +898,9 @@ library KeysInTable { _store.setDynamicField(_tableId, _keyTuple, 3, EncodeArray.encode((keys3))); } - /** Get the length of keys3 */ + /** + * @notice Get length of keys3 + */ function lengthKeys3(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -807,7 +911,9 @@ library KeysInTable { } } - /** Get the length of keys3 */ + /** + * @notice Get length of keys3 + */ function _lengthKeys3(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -818,7 +924,9 @@ library KeysInTable { } } - /** Get the length of keys3 (using the specified store) */ + /** + * @notice Get length of keys3 (using the specified store) + */ function lengthKeys3(IStore _store, ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -830,8 +938,8 @@ library KeysInTable { } /** - * Get an item of keys3 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys3 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys3(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -844,8 +952,8 @@ library KeysInTable { } /** - * Get an item of keys3 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys3 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemKeys3(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -858,8 +966,8 @@ library KeysInTable { } /** - * Get an item of keys3 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys3 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys3(IStore _store, ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -871,7 +979,9 @@ library KeysInTable { } } - /** Push an element to keys3 */ + /** + * @notice Push an element to keys3 + */ function pushKeys3(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -879,7 +989,9 @@ library KeysInTable { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 3, abi.encodePacked((_element))); } - /** Push an element to keys3 */ + /** + * @notice Push an element to keys3 + */ function _pushKeys3(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -887,7 +999,9 @@ library KeysInTable { StoreCore.pushToDynamicField(_tableId, _keyTuple, 3, abi.encodePacked((_element))); } - /** Push an element to keys3 (using the specified store) */ + /** + * @notice Push an element to keys3 (using the specified store) + */ function pushKeys3(IStore _store, ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -895,7 +1009,9 @@ library KeysInTable { _store.pushToDynamicField(_tableId, _keyTuple, 3, abi.encodePacked((_element))); } - /** Pop an element from keys3 */ + /** + * @notice Pop an element from keys3 + */ function popKeys3(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -903,7 +1019,9 @@ library KeysInTable { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 3, 32); } - /** Pop an element from keys3 */ + /** + * @notice Pop an element from keys3 + */ function _popKeys3(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -911,7 +1029,9 @@ library KeysInTable { StoreCore.popFromDynamicField(_tableId, _keyTuple, 3, 32); } - /** Pop an element from keys3 (using the specified store) */ + /** + * @notice Pop an element from keys3 (using the specified store) + */ function popKeys3(IStore _store, ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -920,8 +1040,8 @@ library KeysInTable { } /** - * Update an element of keys3 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys3 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys3(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -934,8 +1054,8 @@ library KeysInTable { } /** - * Update an element of keys3 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys3 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateKeys3(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -948,8 +1068,8 @@ library KeysInTable { } /** - * Update an element of keys3 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys3 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys3(IStore _store, ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -961,7 +1081,9 @@ library KeysInTable { } } - /** Get keys4 */ + /** + * @notice Get keys4 + */ function getKeys4(ResourceId sourceTableId) internal view returns (bytes32[] memory keys4) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -970,7 +1092,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys4 */ + /** + * @notice Get keys4 + */ function _getKeys4(ResourceId sourceTableId) internal view returns (bytes32[] memory keys4) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -979,7 +1103,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keys4 (using the specified store) */ + /** + * @notice Get keys4 (using the specified store) + */ function getKeys4(IStore _store, ResourceId sourceTableId) internal view returns (bytes32[] memory keys4) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -988,7 +1114,9 @@ library KeysInTable { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Set keys4 */ + /** + * @notice Set keys4 + */ function setKeys4(ResourceId sourceTableId, bytes32[] memory keys4) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -996,7 +1124,9 @@ library KeysInTable { StoreSwitch.setDynamicField(_tableId, _keyTuple, 4, EncodeArray.encode((keys4))); } - /** Set keys4 */ + /** + * @notice Set keys4 + */ function _setKeys4(ResourceId sourceTableId, bytes32[] memory keys4) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1004,7 +1134,9 @@ library KeysInTable { StoreCore.setDynamicField(_tableId, _keyTuple, 4, EncodeArray.encode((keys4))); } - /** Set keys4 (using the specified store) */ + /** + * @notice Set keys4 (using the specified store) + */ function setKeys4(IStore _store, ResourceId sourceTableId, bytes32[] memory keys4) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1012,7 +1144,9 @@ library KeysInTable { _store.setDynamicField(_tableId, _keyTuple, 4, EncodeArray.encode((keys4))); } - /** Get the length of keys4 */ + /** + * @notice Get length of keys4 + */ function lengthKeys4(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1023,7 +1157,9 @@ library KeysInTable { } } - /** Get the length of keys4 */ + /** + * @notice Get length of keys4 + */ function _lengthKeys4(ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1034,7 +1170,9 @@ library KeysInTable { } } - /** Get the length of keys4 (using the specified store) */ + /** + * @notice Get length of keys4 (using the specified store) + */ function lengthKeys4(IStore _store, ResourceId sourceTableId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1046,8 +1184,8 @@ library KeysInTable { } /** - * Get an item of keys4 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys4 + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys4(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1060,8 +1198,8 @@ library KeysInTable { } /** - * Get an item of keys4 - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys4 + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemKeys4(ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1074,8 +1212,8 @@ library KeysInTable { } /** - * Get an item of keys4 (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keys4 (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeys4(IStore _store, ResourceId sourceTableId, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1087,7 +1225,9 @@ library KeysInTable { } } - /** Push an element to keys4 */ + /** + * @notice Push an element to keys4 + */ function pushKeys4(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1095,7 +1235,9 @@ library KeysInTable { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 4, abi.encodePacked((_element))); } - /** Push an element to keys4 */ + /** + * @notice Push an element to keys4 + */ function _pushKeys4(ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1103,7 +1245,9 @@ library KeysInTable { StoreCore.pushToDynamicField(_tableId, _keyTuple, 4, abi.encodePacked((_element))); } - /** Push an element to keys4 (using the specified store) */ + /** + * @notice Push an element to keys4 (using the specified store) + */ function pushKeys4(IStore _store, ResourceId sourceTableId, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1111,7 +1255,9 @@ library KeysInTable { _store.pushToDynamicField(_tableId, _keyTuple, 4, abi.encodePacked((_element))); } - /** Pop an element from keys4 */ + /** + * @notice Pop an element from keys4 + */ function popKeys4(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1119,7 +1265,9 @@ library KeysInTable { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 4, 32); } - /** Pop an element from keys4 */ + /** + * @notice Pop an element from keys4 + */ function _popKeys4(ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1127,7 +1275,9 @@ library KeysInTable { StoreCore.popFromDynamicField(_tableId, _keyTuple, 4, 32); } - /** Pop an element from keys4 (using the specified store) */ + /** + * @notice Pop an element from keys4 (using the specified store) + */ function popKeys4(IStore _store, ResourceId sourceTableId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -1136,8 +1286,8 @@ library KeysInTable { } /** - * Update an element of keys4 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys4 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys4(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1150,8 +1300,8 @@ library KeysInTable { } /** - * Update an element of keys4 at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys4 at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateKeys4(ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -1164,8 +1314,8 @@ library KeysInTable { } /** - * Update an element of keys4 (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keys4 (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeys4(IStore _store, ResourceId sourceTableId, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/world-modules/src/modules/keysintable/tables/UsedKeysIndex.sol b/packages/world-modules/src/modules/keysintable/tables/UsedKeysIndex.sol index afb8a8ebd8..69e80ad7e5 100644 --- a/packages/world-modules/src/modules/keysintable/tables/UsedKeysIndex.sol +++ b/packages/world-modules/src/modules/keysintable/tables/UsedKeysIndex.sol @@ -85,7 +85,9 @@ library UsedKeysIndex { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get has */ + /** + * @notice Get has + */ function getHas(ResourceId sourceTableId, bytes32 keysHash) internal view returns (bool has) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -95,7 +97,9 @@ library UsedKeysIndex { return (_toBool(uint8(bytes1(_blob)))); } - /** Get has */ + /** + * @notice Get has + */ function _getHas(ResourceId sourceTableId, bytes32 keysHash) internal view returns (bool has) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -105,7 +109,9 @@ library UsedKeysIndex { return (_toBool(uint8(bytes1(_blob)))); } - /** Get has (using the specified store) */ + /** + * @notice Get has (using the specified store) + */ function getHas(IStore _store, ResourceId sourceTableId, bytes32 keysHash) internal view returns (bool has) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -115,7 +121,9 @@ library UsedKeysIndex { return (_toBool(uint8(bytes1(_blob)))); } - /** Set has */ + /** + * @notice Set has + */ function setHas(ResourceId sourceTableId, bytes32 keysHash, bool has) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -124,7 +132,9 @@ library UsedKeysIndex { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((has)), _fieldLayout); } - /** Set has */ + /** + * @notice Set has + */ function _setHas(ResourceId sourceTableId, bytes32 keysHash, bool has) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -133,7 +143,9 @@ library UsedKeysIndex { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((has)), _fieldLayout); } - /** Set has (using the specified store) */ + /** + * @notice Set has (using the specified store) + */ function setHas(IStore _store, ResourceId sourceTableId, bytes32 keysHash, bool has) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -142,7 +154,9 @@ library UsedKeysIndex { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((has)), _fieldLayout); } - /** Get index */ + /** + * @notice Get index + */ function getIndex(ResourceId sourceTableId, bytes32 keysHash) internal view returns (uint40 index) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -152,7 +166,9 @@ library UsedKeysIndex { return (uint40(bytes5(_blob))); } - /** Get index */ + /** + * @notice Get index + */ function _getIndex(ResourceId sourceTableId, bytes32 keysHash) internal view returns (uint40 index) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -162,7 +178,9 @@ library UsedKeysIndex { return (uint40(bytes5(_blob))); } - /** Get index (using the specified store) */ + /** + * @notice Get index (using the specified store) + */ function getIndex(IStore _store, ResourceId sourceTableId, bytes32 keysHash) internal view returns (uint40 index) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -172,7 +190,9 @@ library UsedKeysIndex { return (uint40(bytes5(_blob))); } - /** Set index */ + /** + * @notice Set index + */ function setIndex(ResourceId sourceTableId, bytes32 keysHash, uint40 index) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -181,7 +201,9 @@ library UsedKeysIndex { StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((index)), _fieldLayout); } - /** Set index */ + /** + * @notice Set index + */ function _setIndex(ResourceId sourceTableId, bytes32 keysHash, uint40 index) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); @@ -190,7 +212,9 @@ library UsedKeysIndex { StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((index)), _fieldLayout); } - /** Set index (using the specified store) */ + /** + * @notice Set index (using the specified store) + */ function setIndex(IStore _store, ResourceId sourceTableId, bytes32 keysHash, uint40 index) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(sourceTableId); diff --git a/packages/world-modules/src/modules/keyswithvalue/tables/KeysWithValue.sol b/packages/world-modules/src/modules/keyswithvalue/tables/KeysWithValue.sol index eb6625f4dd..9e3cf27068 100644 --- a/packages/world-modules/src/modules/keyswithvalue/tables/KeysWithValue.sol +++ b/packages/world-modules/src/modules/keyswithvalue/tables/KeysWithValue.sol @@ -73,7 +73,9 @@ library KeysWithValue { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get keysWithValue */ + /** + * @notice Get keysWithValue + */ function getKeysWithValue( ResourceId _tableId, bytes32 valueHash @@ -85,7 +87,9 @@ library KeysWithValue { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keysWithValue */ + /** + * @notice Get keysWithValue + */ function _getKeysWithValue( ResourceId _tableId, bytes32 valueHash @@ -97,7 +101,9 @@ library KeysWithValue { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keysWithValue (using the specified store) */ + /** + * @notice Get keysWithValue (using the specified store) + */ function getKeysWithValue( IStore _store, ResourceId _tableId, @@ -110,7 +116,9 @@ library KeysWithValue { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keysWithValue */ + /** + * @notice Get keysWithValue + */ function get(ResourceId _tableId, bytes32 valueHash) internal view returns (bytes32[] memory keysWithValue) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -119,7 +127,9 @@ library KeysWithValue { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keysWithValue */ + /** + * @notice Get keysWithValue + */ function _get(ResourceId _tableId, bytes32 valueHash) internal view returns (bytes32[] memory keysWithValue) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -128,7 +138,9 @@ library KeysWithValue { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Get keysWithValue (using the specified store) */ + /** + * @notice Get keysWithValue (using the specified store) + */ function get( IStore _store, ResourceId _tableId, @@ -141,7 +153,9 @@ library KeysWithValue { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes32()); } - /** Set keysWithValue */ + /** + * @notice Set keysWithValue + */ function setKeysWithValue(ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -149,7 +163,9 @@ library KeysWithValue { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue))); } - /** Set keysWithValue */ + /** + * @notice Set keysWithValue + */ function _setKeysWithValue(ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -157,7 +173,9 @@ library KeysWithValue { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue))); } - /** Set keysWithValue (using the specified store) */ + /** + * @notice Set keysWithValue (using the specified store) + */ function setKeysWithValue( IStore _store, ResourceId _tableId, @@ -170,7 +188,9 @@ library KeysWithValue { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue))); } - /** Set keysWithValue */ + /** + * @notice Set keysWithValue + */ function set(ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -178,7 +198,9 @@ library KeysWithValue { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue))); } - /** Set keysWithValue */ + /** + * @notice Set keysWithValue + */ function _set(ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -186,7 +208,9 @@ library KeysWithValue { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue))); } - /** Set keysWithValue (using the specified store) */ + /** + * @notice Set keysWithValue (using the specified store) + */ function set(IStore _store, ResourceId _tableId, bytes32 valueHash, bytes32[] memory keysWithValue) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -194,7 +218,9 @@ library KeysWithValue { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((keysWithValue))); } - /** Get the length of keysWithValue */ + /** + * @notice Get length of keysWithValue + */ function lengthKeysWithValue(ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -205,7 +231,9 @@ library KeysWithValue { } } - /** Get the length of keysWithValue */ + /** + * @notice Get length of keysWithValue + */ function _lengthKeysWithValue(ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -216,7 +244,9 @@ library KeysWithValue { } } - /** Get the length of keysWithValue (using the specified store) */ + /** + * @notice Get length of keysWithValue (using the specified store) + */ function lengthKeysWithValue(IStore _store, ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -227,7 +257,9 @@ library KeysWithValue { } } - /** Get the length of keysWithValue */ + /** + * @notice Get length of keysWithValue + */ function length(ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -238,7 +270,9 @@ library KeysWithValue { } } - /** Get the length of keysWithValue */ + /** + * @notice Get length of keysWithValue + */ function _length(ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -249,7 +283,9 @@ library KeysWithValue { } } - /** Get the length of keysWithValue (using the specified store) */ + /** + * @notice Get length of keysWithValue (using the specified store) + */ function length(IStore _store, ResourceId _tableId, bytes32 valueHash) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -261,8 +297,8 @@ library KeysWithValue { } /** - * Get an item of keysWithValue - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keysWithValue + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeysWithValue( ResourceId _tableId, @@ -279,8 +315,8 @@ library KeysWithValue { } /** - * Get an item of keysWithValue - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keysWithValue + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemKeysWithValue( ResourceId _tableId, @@ -297,8 +333,8 @@ library KeysWithValue { } /** - * Get an item of keysWithValue (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keysWithValue (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemKeysWithValue( IStore _store, @@ -316,8 +352,8 @@ library KeysWithValue { } /** - * Get an item of keysWithValue - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keysWithValue + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(ResourceId _tableId, bytes32 valueHash, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -330,8 +366,8 @@ library KeysWithValue { } /** - * Get an item of keysWithValue - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keysWithValue + * @dev (unchecked, returns invalid data if index overflows) */ function _getItem(ResourceId _tableId, bytes32 valueHash, uint256 _index) internal view returns (bytes32) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -344,8 +380,8 @@ library KeysWithValue { } /** - * Get an item of keysWithValue (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of keysWithValue (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItem( IStore _store, @@ -362,7 +398,9 @@ library KeysWithValue { } } - /** Push an element to keysWithValue */ + /** + * @notice Push an element to keysWithValue + */ function pushKeysWithValue(ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -370,7 +408,9 @@ library KeysWithValue { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to keysWithValue */ + /** + * @notice Push an element to keysWithValue + */ function _pushKeysWithValue(ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -378,7 +418,9 @@ library KeysWithValue { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to keysWithValue (using the specified store) */ + /** + * @notice Push an element to keysWithValue (using the specified store) + */ function pushKeysWithValue(IStore _store, ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -386,7 +428,9 @@ library KeysWithValue { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to keysWithValue */ + /** + * @notice Push an element to keysWithValue + */ function push(ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -394,7 +438,9 @@ library KeysWithValue { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to keysWithValue */ + /** + * @notice Push an element to keysWithValue + */ function _push(ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -402,7 +448,9 @@ library KeysWithValue { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to keysWithValue (using the specified store) */ + /** + * @notice Push an element to keysWithValue (using the specified store) + */ function push(IStore _store, ResourceId _tableId, bytes32 valueHash, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -410,7 +458,9 @@ library KeysWithValue { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from keysWithValue */ + /** + * @notice Pop an element from keysWithValue + */ function popKeysWithValue(ResourceId _tableId, bytes32 valueHash) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -418,7 +468,9 @@ library KeysWithValue { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from keysWithValue */ + /** + * @notice Pop an element from keysWithValue + */ function _popKeysWithValue(ResourceId _tableId, bytes32 valueHash) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -426,7 +478,9 @@ library KeysWithValue { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from keysWithValue (using the specified store) */ + /** + * @notice Pop an element from keysWithValue (using the specified store) + */ function popKeysWithValue(IStore _store, ResourceId _tableId, bytes32 valueHash) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -434,7 +488,9 @@ library KeysWithValue { _store.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from keysWithValue */ + /** + * @notice Pop an element from keysWithValue + */ function pop(ResourceId _tableId, bytes32 valueHash) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -442,7 +498,9 @@ library KeysWithValue { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from keysWithValue */ + /** + * @notice Pop an element from keysWithValue + */ function _pop(ResourceId _tableId, bytes32 valueHash) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -450,7 +508,9 @@ library KeysWithValue { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 32); } - /** Pop an element from keysWithValue (using the specified store) */ + /** + * @notice Pop an element from keysWithValue (using the specified store) + */ function pop(IStore _store, ResourceId _tableId, bytes32 valueHash) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = valueHash; @@ -459,8 +519,8 @@ library KeysWithValue { } /** - * Update an element of keysWithValue at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keysWithValue at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeysWithValue(ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -473,8 +533,8 @@ library KeysWithValue { } /** - * Update an element of keysWithValue at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keysWithValue at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateKeysWithValue(ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -487,8 +547,8 @@ library KeysWithValue { } /** - * Update an element of keysWithValue (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keysWithValue (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateKeysWithValue( IStore _store, @@ -507,8 +567,8 @@ library KeysWithValue { } /** - * Update an element of keysWithValue at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keysWithValue at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -521,8 +581,8 @@ library KeysWithValue { } /** - * Update an element of keysWithValue at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keysWithValue at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _update(ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -535,8 +595,8 @@ library KeysWithValue { } /** - * Update an element of keysWithValue (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of keysWithValue (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(IStore _store, ResourceId _tableId, bytes32 valueHash, uint256 _index, bytes32 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/world-modules/src/modules/std-delegations/tables/CallboundDelegations.sol b/packages/world-modules/src/modules/std-delegations/tables/CallboundDelegations.sol index f97ebe09d7..bb6ec9aba0 100644 --- a/packages/world-modules/src/modules/std-delegations/tables/CallboundDelegations.sol +++ b/packages/world-modules/src/modules/std-delegations/tables/CallboundDelegations.sol @@ -87,7 +87,9 @@ library CallboundDelegations { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get availableCalls */ + /** + * @notice Get availableCalls + */ function getAvailableCalls( address delegator, address delegatee, @@ -104,7 +106,9 @@ library CallboundDelegations { return (uint256(bytes32(_blob))); } - /** Get availableCalls */ + /** + * @notice Get availableCalls + */ function _getAvailableCalls( address delegator, address delegatee, @@ -121,7 +125,9 @@ library CallboundDelegations { return (uint256(bytes32(_blob))); } - /** Get availableCalls (using the specified store) */ + /** + * @notice Get availableCalls (using the specified store) + */ function getAvailableCalls( IStore _store, address delegator, @@ -139,7 +145,9 @@ library CallboundDelegations { return (uint256(bytes32(_blob))); } - /** Get availableCalls */ + /** + * @notice Get availableCalls + */ function get( address delegator, address delegatee, @@ -156,7 +164,9 @@ library CallboundDelegations { return (uint256(bytes32(_blob))); } - /** Get availableCalls */ + /** + * @notice Get availableCalls + */ function _get( address delegator, address delegatee, @@ -173,7 +183,9 @@ library CallboundDelegations { return (uint256(bytes32(_blob))); } - /** Get availableCalls (using the specified store) */ + /** + * @notice Get availableCalls (using the specified store) + */ function get( IStore _store, address delegator, @@ -191,7 +203,9 @@ library CallboundDelegations { return (uint256(bytes32(_blob))); } - /** Set availableCalls */ + /** + * @notice Set availableCalls + */ function setAvailableCalls( address delegator, address delegatee, @@ -208,7 +222,9 @@ library CallboundDelegations { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((availableCalls)), _fieldLayout); } - /** Set availableCalls */ + /** + * @notice Set availableCalls + */ function _setAvailableCalls( address delegator, address delegatee, @@ -225,7 +241,9 @@ library CallboundDelegations { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((availableCalls)), _fieldLayout); } - /** Set availableCalls (using the specified store) */ + /** + * @notice Set availableCalls (using the specified store) + */ function setAvailableCalls( IStore _store, address delegator, @@ -243,7 +261,9 @@ library CallboundDelegations { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((availableCalls)), _fieldLayout); } - /** Set availableCalls */ + /** + * @notice Set availableCalls + */ function set( address delegator, address delegatee, @@ -260,7 +280,9 @@ library CallboundDelegations { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((availableCalls)), _fieldLayout); } - /** Set availableCalls */ + /** + * @notice Set availableCalls + */ function _set( address delegator, address delegatee, @@ -277,7 +299,9 @@ library CallboundDelegations { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((availableCalls)), _fieldLayout); } - /** Set availableCalls (using the specified store) */ + /** + * @notice Set availableCalls (using the specified store) + */ function set( IStore _store, address delegator, diff --git a/packages/world-modules/src/modules/std-delegations/tables/TimeboundDelegations.sol b/packages/world-modules/src/modules/std-delegations/tables/TimeboundDelegations.sol index 977442857c..9d96554096 100644 --- a/packages/world-modules/src/modules/std-delegations/tables/TimeboundDelegations.sol +++ b/packages/world-modules/src/modules/std-delegations/tables/TimeboundDelegations.sol @@ -80,7 +80,9 @@ library TimeboundDelegations { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get maxTimestamp */ + /** + * @notice Get maxTimestamp + */ function getMaxTimestamp(address delegator, address delegatee) internal view returns (uint256 maxTimestamp) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -90,7 +92,9 @@ library TimeboundDelegations { return (uint256(bytes32(_blob))); } - /** Get maxTimestamp */ + /** + * @notice Get maxTimestamp + */ function _getMaxTimestamp(address delegator, address delegatee) internal view returns (uint256 maxTimestamp) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -100,7 +104,9 @@ library TimeboundDelegations { return (uint256(bytes32(_blob))); } - /** Get maxTimestamp (using the specified store) */ + /** + * @notice Get maxTimestamp (using the specified store) + */ function getMaxTimestamp( IStore _store, address delegator, @@ -114,7 +120,9 @@ library TimeboundDelegations { return (uint256(bytes32(_blob))); } - /** Get maxTimestamp */ + /** + * @notice Get maxTimestamp + */ function get(address delegator, address delegatee) internal view returns (uint256 maxTimestamp) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -124,7 +132,9 @@ library TimeboundDelegations { return (uint256(bytes32(_blob))); } - /** Get maxTimestamp */ + /** + * @notice Get maxTimestamp + */ function _get(address delegator, address delegatee) internal view returns (uint256 maxTimestamp) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -134,7 +144,9 @@ library TimeboundDelegations { return (uint256(bytes32(_blob))); } - /** Get maxTimestamp (using the specified store) */ + /** + * @notice Get maxTimestamp (using the specified store) + */ function get(IStore _store, address delegator, address delegatee) internal view returns (uint256 maxTimestamp) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -144,7 +156,9 @@ library TimeboundDelegations { return (uint256(bytes32(_blob))); } - /** Set maxTimestamp */ + /** + * @notice Set maxTimestamp + */ function setMaxTimestamp(address delegator, address delegatee, uint256 maxTimestamp) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -153,7 +167,9 @@ library TimeboundDelegations { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((maxTimestamp)), _fieldLayout); } - /** Set maxTimestamp */ + /** + * @notice Set maxTimestamp + */ function _setMaxTimestamp(address delegator, address delegatee, uint256 maxTimestamp) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -162,7 +178,9 @@ library TimeboundDelegations { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((maxTimestamp)), _fieldLayout); } - /** Set maxTimestamp (using the specified store) */ + /** + * @notice Set maxTimestamp (using the specified store) + */ function setMaxTimestamp(IStore _store, address delegator, address delegatee, uint256 maxTimestamp) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -171,7 +189,9 @@ library TimeboundDelegations { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((maxTimestamp)), _fieldLayout); } - /** Set maxTimestamp */ + /** + * @notice Set maxTimestamp + */ function set(address delegator, address delegatee, uint256 maxTimestamp) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -180,7 +200,9 @@ library TimeboundDelegations { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((maxTimestamp)), _fieldLayout); } - /** Set maxTimestamp */ + /** + * @notice Set maxTimestamp + */ function _set(address delegator, address delegatee, uint256 maxTimestamp) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -189,7 +211,9 @@ library TimeboundDelegations { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((maxTimestamp)), _fieldLayout); } - /** Set maxTimestamp (using the specified store) */ + /** + * @notice Set maxTimestamp (using the specified store) + */ function set(IStore _store, address delegator, address delegatee, uint256 maxTimestamp) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); diff --git a/packages/world-modules/src/modules/uniqueentity/tables/UniqueEntity.sol b/packages/world-modules/src/modules/uniqueentity/tables/UniqueEntity.sol index a62887d571..09b42773a3 100644 --- a/packages/world-modules/src/modules/uniqueentity/tables/UniqueEntity.sol +++ b/packages/world-modules/src/modules/uniqueentity/tables/UniqueEntity.sol @@ -71,7 +71,9 @@ library UniqueEntity { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get value */ + /** + * @notice Get value + */ function getValue(ResourceId _tableId) internal view returns (uint256 value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -79,7 +81,9 @@ library UniqueEntity { return (uint256(bytes32(_blob))); } - /** Get value */ + /** + * @notice Get value + */ function _getValue(ResourceId _tableId) internal view returns (uint256 value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -87,7 +91,9 @@ library UniqueEntity { return (uint256(bytes32(_blob))); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function getValue(IStore _store, ResourceId _tableId) internal view returns (uint256 value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -95,7 +101,9 @@ library UniqueEntity { return (uint256(bytes32(_blob))); } - /** Get value */ + /** + * @notice Get value + */ function get(ResourceId _tableId) internal view returns (uint256 value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -103,7 +111,9 @@ library UniqueEntity { return (uint256(bytes32(_blob))); } - /** Get value */ + /** + * @notice Get value + */ function _get(ResourceId _tableId) internal view returns (uint256 value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -111,7 +121,9 @@ library UniqueEntity { return (uint256(bytes32(_blob))); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function get(IStore _store, ResourceId _tableId) internal view returns (uint256 value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -119,42 +131,54 @@ library UniqueEntity { return (uint256(bytes32(_blob))); } - /** Set value */ + /** + * @notice Set value + */ function setValue(ResourceId _tableId, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function _setValue(ResourceId _tableId, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function setValue(IStore _store, ResourceId _tableId, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function set(ResourceId _tableId, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function _set(ResourceId _tableId, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function set(IStore _store, ResourceId _tableId, uint256 value) internal { bytes32[] memory _keyTuple = new bytes32[](0); diff --git a/packages/world/src/codegen/interfaces/IBaseWorld.sol b/packages/world/src/codegen/interfaces/IBaseWorld.sol index 4d0e1d410d..3ef34179a7 100644 --- a/packages/world/src/codegen/interfaces/IBaseWorld.sol +++ b/packages/world/src/codegen/interfaces/IBaseWorld.sol @@ -14,8 +14,9 @@ import { IModuleInstallationSystem } from "./IModuleInstallationSystem.sol"; import { IWorldRegistrationSystem } from "./IWorldRegistrationSystem.sol"; /** - * The IBaseWorld interface includes all systems dynamically added to the World - * during the deploy process. + * @title IBaseWorld + * @notice This interface integrates all systems that are dynamically added to the World during deployment. + * @dev This is an autogenerated file; do not edit manually. */ interface IBaseWorld is IStore, diff --git a/packages/world/src/codegen/tables/Balances.sol b/packages/world/src/codegen/tables/Balances.sol index e21473bba5..6b5b87a862 100644 --- a/packages/world/src/codegen/tables/Balances.sol +++ b/packages/world/src/codegen/tables/Balances.sol @@ -81,7 +81,9 @@ library Balances { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get balance */ + /** + * @notice Get balance + */ function getBalance(ResourceId namespaceId) internal view returns (uint256 balance) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -90,7 +92,9 @@ library Balances { return (uint256(bytes32(_blob))); } - /** Get balance */ + /** + * @notice Get balance + */ function _getBalance(ResourceId namespaceId) internal view returns (uint256 balance) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -99,7 +103,9 @@ library Balances { return (uint256(bytes32(_blob))); } - /** Get balance (using the specified store) */ + /** + * @notice Get balance (using the specified store) + */ function getBalance(IStore _store, ResourceId namespaceId) internal view returns (uint256 balance) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -108,7 +114,9 @@ library Balances { return (uint256(bytes32(_blob))); } - /** Get balance */ + /** + * @notice Get balance + */ function get(ResourceId namespaceId) internal view returns (uint256 balance) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -117,7 +125,9 @@ library Balances { return (uint256(bytes32(_blob))); } - /** Get balance */ + /** + * @notice Get balance + */ function _get(ResourceId namespaceId) internal view returns (uint256 balance) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -126,7 +136,9 @@ library Balances { return (uint256(bytes32(_blob))); } - /** Get balance (using the specified store) */ + /** + * @notice Get balance (using the specified store) + */ function get(IStore _store, ResourceId namespaceId) internal view returns (uint256 balance) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -135,7 +147,9 @@ library Balances { return (uint256(bytes32(_blob))); } - /** Set balance */ + /** + * @notice Set balance + */ function setBalance(ResourceId namespaceId, uint256 balance) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -143,7 +157,9 @@ library Balances { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((balance)), _fieldLayout); } - /** Set balance */ + /** + * @notice Set balance + */ function _setBalance(ResourceId namespaceId, uint256 balance) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -151,7 +167,9 @@ library Balances { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((balance)), _fieldLayout); } - /** Set balance (using the specified store) */ + /** + * @notice Set balance (using the specified store) + */ function setBalance(IStore _store, ResourceId namespaceId, uint256 balance) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -159,7 +177,9 @@ library Balances { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((balance)), _fieldLayout); } - /** Set balance */ + /** + * @notice Set balance + */ function set(ResourceId namespaceId, uint256 balance) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -167,7 +187,9 @@ library Balances { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((balance)), _fieldLayout); } - /** Set balance */ + /** + * @notice Set balance + */ function _set(ResourceId namespaceId, uint256 balance) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -175,7 +197,9 @@ library Balances { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((balance)), _fieldLayout); } - /** Set balance (using the specified store) */ + /** + * @notice Set balance (using the specified store) + */ function set(IStore _store, ResourceId namespaceId, uint256 balance) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); diff --git a/packages/world/src/codegen/tables/FunctionSelectors.sol b/packages/world/src/codegen/tables/FunctionSelectors.sol index c8dcf655a6..8521eaa58f 100644 --- a/packages/world/src/codegen/tables/FunctionSelectors.sol +++ b/packages/world/src/codegen/tables/FunctionSelectors.sol @@ -83,7 +83,9 @@ library FunctionSelectors { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get systemId */ + /** + * @notice Get systemId + */ function getSystemId(bytes4 functionSelector) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -92,7 +94,9 @@ library FunctionSelectors { return ResourceId.wrap(bytes32(_blob)); } - /** Get systemId */ + /** + * @notice Get systemId + */ function _getSystemId(bytes4 functionSelector) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -101,7 +105,9 @@ library FunctionSelectors { return ResourceId.wrap(bytes32(_blob)); } - /** Get systemId (using the specified store) */ + /** + * @notice Get systemId (using the specified store) + */ function getSystemId(IStore _store, bytes4 functionSelector) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -110,7 +116,9 @@ library FunctionSelectors { return ResourceId.wrap(bytes32(_blob)); } - /** Set systemId */ + /** + * @notice Set systemId + */ function setSystemId(bytes4 functionSelector, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -118,7 +126,9 @@ library FunctionSelectors { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(ResourceId.unwrap(systemId)), _fieldLayout); } - /** Set systemId */ + /** + * @notice Set systemId + */ function _setSystemId(bytes4 functionSelector, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -126,7 +136,9 @@ library FunctionSelectors { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(ResourceId.unwrap(systemId)), _fieldLayout); } - /** Set systemId (using the specified store) */ + /** + * @notice Set systemId (using the specified store) + */ function setSystemId(IStore _store, bytes4 functionSelector, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -134,7 +146,9 @@ library FunctionSelectors { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(ResourceId.unwrap(systemId)), _fieldLayout); } - /** Get systemFunctionSelector */ + /** + * @notice Get systemFunctionSelector + */ function getSystemFunctionSelector(bytes4 functionSelector) internal view returns (bytes4 systemFunctionSelector) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -143,7 +157,9 @@ library FunctionSelectors { return (bytes4(_blob)); } - /** Get systemFunctionSelector */ + /** + * @notice Get systemFunctionSelector + */ function _getSystemFunctionSelector(bytes4 functionSelector) internal view returns (bytes4 systemFunctionSelector) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -152,7 +168,9 @@ library FunctionSelectors { return (bytes4(_blob)); } - /** Get systemFunctionSelector (using the specified store) */ + /** + * @notice Get systemFunctionSelector (using the specified store) + */ function getSystemFunctionSelector( IStore _store, bytes4 functionSelector @@ -164,7 +182,9 @@ library FunctionSelectors { return (bytes4(_blob)); } - /** Set systemFunctionSelector */ + /** + * @notice Set systemFunctionSelector + */ function setSystemFunctionSelector(bytes4 functionSelector, bytes4 systemFunctionSelector) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -172,7 +192,9 @@ library FunctionSelectors { StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((systemFunctionSelector)), _fieldLayout); } - /** Set systemFunctionSelector */ + /** + * @notice Set systemFunctionSelector + */ function _setSystemFunctionSelector(bytes4 functionSelector, bytes4 systemFunctionSelector) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); @@ -180,7 +202,9 @@ library FunctionSelectors { StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((systemFunctionSelector)), _fieldLayout); } - /** Set systemFunctionSelector (using the specified store) */ + /** + * @notice Set systemFunctionSelector (using the specified store) + */ function setSystemFunctionSelector(IStore _store, bytes4 functionSelector, bytes4 systemFunctionSelector) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(functionSelector); diff --git a/packages/world/src/codegen/tables/InstalledModules.sol b/packages/world/src/codegen/tables/InstalledModules.sol index 7318d17531..6c0c644d51 100644 --- a/packages/world/src/codegen/tables/InstalledModules.sol +++ b/packages/world/src/codegen/tables/InstalledModules.sol @@ -80,7 +80,9 @@ library InstalledModules { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get moduleAddress */ + /** + * @notice Get moduleAddress + */ function getModuleAddress(bytes16 moduleName, bytes32 argumentsHash) internal view returns (address moduleAddress) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -90,7 +92,9 @@ library InstalledModules { return (address(bytes20(_blob))); } - /** Get moduleAddress */ + /** + * @notice Get moduleAddress + */ function _getModuleAddress(bytes16 moduleName, bytes32 argumentsHash) internal view returns (address moduleAddress) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -100,7 +104,9 @@ library InstalledModules { return (address(bytes20(_blob))); } - /** Get moduleAddress (using the specified store) */ + /** + * @notice Get moduleAddress (using the specified store) + */ function getModuleAddress( IStore _store, bytes16 moduleName, @@ -114,7 +120,9 @@ library InstalledModules { return (address(bytes20(_blob))); } - /** Get moduleAddress */ + /** + * @notice Get moduleAddress + */ function get(bytes16 moduleName, bytes32 argumentsHash) internal view returns (address moduleAddress) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -124,7 +132,9 @@ library InstalledModules { return (address(bytes20(_blob))); } - /** Get moduleAddress */ + /** + * @notice Get moduleAddress + */ function _get(bytes16 moduleName, bytes32 argumentsHash) internal view returns (address moduleAddress) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -134,7 +144,9 @@ library InstalledModules { return (address(bytes20(_blob))); } - /** Get moduleAddress (using the specified store) */ + /** + * @notice Get moduleAddress (using the specified store) + */ function get(IStore _store, bytes16 moduleName, bytes32 argumentsHash) internal view returns (address moduleAddress) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -144,7 +156,9 @@ library InstalledModules { return (address(bytes20(_blob))); } - /** Set moduleAddress */ + /** + * @notice Set moduleAddress + */ function setModuleAddress(bytes16 moduleName, bytes32 argumentsHash, address moduleAddress) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -153,7 +167,9 @@ library InstalledModules { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((moduleAddress)), _fieldLayout); } - /** Set moduleAddress */ + /** + * @notice Set moduleAddress + */ function _setModuleAddress(bytes16 moduleName, bytes32 argumentsHash, address moduleAddress) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -162,7 +178,9 @@ library InstalledModules { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((moduleAddress)), _fieldLayout); } - /** Set moduleAddress (using the specified store) */ + /** + * @notice Set moduleAddress (using the specified store) + */ function setModuleAddress(IStore _store, bytes16 moduleName, bytes32 argumentsHash, address moduleAddress) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -171,7 +189,9 @@ library InstalledModules { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((moduleAddress)), _fieldLayout); } - /** Set moduleAddress */ + /** + * @notice Set moduleAddress + */ function set(bytes16 moduleName, bytes32 argumentsHash, address moduleAddress) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -180,7 +200,9 @@ library InstalledModules { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((moduleAddress)), _fieldLayout); } - /** Set moduleAddress */ + /** + * @notice Set moduleAddress + */ function _set(bytes16 moduleName, bytes32 argumentsHash, address moduleAddress) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); @@ -189,7 +211,9 @@ library InstalledModules { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((moduleAddress)), _fieldLayout); } - /** Set moduleAddress (using the specified store) */ + /** + * @notice Set moduleAddress (using the specified store) + */ function set(IStore _store, bytes16 moduleName, bytes32 argumentsHash, address moduleAddress) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(moduleName); diff --git a/packages/world/src/codegen/tables/NamespaceDelegationControl.sol b/packages/world/src/codegen/tables/NamespaceDelegationControl.sol index e5a0ebcd37..03bb823e87 100644 --- a/packages/world/src/codegen/tables/NamespaceDelegationControl.sol +++ b/packages/world/src/codegen/tables/NamespaceDelegationControl.sol @@ -81,7 +81,9 @@ library NamespaceDelegationControl { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get delegationControlId */ + /** + * @notice Get delegationControlId + */ function getDelegationControlId(ResourceId namespaceId) internal view returns (ResourceId delegationControlId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -90,7 +92,9 @@ library NamespaceDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId */ + /** + * @notice Get delegationControlId + */ function _getDelegationControlId(ResourceId namespaceId) internal view returns (ResourceId delegationControlId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -99,7 +103,9 @@ library NamespaceDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId (using the specified store) */ + /** + * @notice Get delegationControlId (using the specified store) + */ function getDelegationControlId( IStore _store, ResourceId namespaceId @@ -111,7 +117,9 @@ library NamespaceDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId */ + /** + * @notice Get delegationControlId + */ function get(ResourceId namespaceId) internal view returns (ResourceId delegationControlId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -120,7 +128,9 @@ library NamespaceDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId */ + /** + * @notice Get delegationControlId + */ function _get(ResourceId namespaceId) internal view returns (ResourceId delegationControlId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -129,7 +139,9 @@ library NamespaceDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId (using the specified store) */ + /** + * @notice Get delegationControlId (using the specified store) + */ function get(IStore _store, ResourceId namespaceId) internal view returns (ResourceId delegationControlId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -138,7 +150,9 @@ library NamespaceDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Set delegationControlId */ + /** + * @notice Set delegationControlId + */ function setDelegationControlId(ResourceId namespaceId, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -152,7 +166,9 @@ library NamespaceDelegationControl { ); } - /** Set delegationControlId */ + /** + * @notice Set delegationControlId + */ function _setDelegationControlId(ResourceId namespaceId, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -166,7 +182,9 @@ library NamespaceDelegationControl { ); } - /** Set delegationControlId (using the specified store) */ + /** + * @notice Set delegationControlId (using the specified store) + */ function setDelegationControlId(IStore _store, ResourceId namespaceId, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -180,7 +198,9 @@ library NamespaceDelegationControl { ); } - /** Set delegationControlId */ + /** + * @notice Set delegationControlId + */ function set(ResourceId namespaceId, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -194,7 +214,9 @@ library NamespaceDelegationControl { ); } - /** Set delegationControlId */ + /** + * @notice Set delegationControlId + */ function _set(ResourceId namespaceId, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -208,7 +230,9 @@ library NamespaceDelegationControl { ); } - /** Set delegationControlId (using the specified store) */ + /** + * @notice Set delegationControlId (using the specified store) + */ function set(IStore _store, ResourceId namespaceId, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); diff --git a/packages/world/src/codegen/tables/NamespaceOwner.sol b/packages/world/src/codegen/tables/NamespaceOwner.sol index 1480aa917c..f7474c1263 100644 --- a/packages/world/src/codegen/tables/NamespaceOwner.sol +++ b/packages/world/src/codegen/tables/NamespaceOwner.sol @@ -81,7 +81,9 @@ library NamespaceOwner { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get owner */ + /** + * @notice Get owner + */ function getOwner(ResourceId namespaceId) internal view returns (address owner) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -90,7 +92,9 @@ library NamespaceOwner { return (address(bytes20(_blob))); } - /** Get owner */ + /** + * @notice Get owner + */ function _getOwner(ResourceId namespaceId) internal view returns (address owner) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -99,7 +103,9 @@ library NamespaceOwner { return (address(bytes20(_blob))); } - /** Get owner (using the specified store) */ + /** + * @notice Get owner (using the specified store) + */ function getOwner(IStore _store, ResourceId namespaceId) internal view returns (address owner) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -108,7 +114,9 @@ library NamespaceOwner { return (address(bytes20(_blob))); } - /** Get owner */ + /** + * @notice Get owner + */ function get(ResourceId namespaceId) internal view returns (address owner) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -117,7 +125,9 @@ library NamespaceOwner { return (address(bytes20(_blob))); } - /** Get owner */ + /** + * @notice Get owner + */ function _get(ResourceId namespaceId) internal view returns (address owner) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -126,7 +136,9 @@ library NamespaceOwner { return (address(bytes20(_blob))); } - /** Get owner (using the specified store) */ + /** + * @notice Get owner (using the specified store) + */ function get(IStore _store, ResourceId namespaceId) internal view returns (address owner) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -135,7 +147,9 @@ library NamespaceOwner { return (address(bytes20(_blob))); } - /** Set owner */ + /** + * @notice Set owner + */ function setOwner(ResourceId namespaceId, address owner) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -143,7 +157,9 @@ library NamespaceOwner { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((owner)), _fieldLayout); } - /** Set owner */ + /** + * @notice Set owner + */ function _setOwner(ResourceId namespaceId, address owner) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -151,7 +167,9 @@ library NamespaceOwner { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((owner)), _fieldLayout); } - /** Set owner (using the specified store) */ + /** + * @notice Set owner (using the specified store) + */ function setOwner(IStore _store, ResourceId namespaceId, address owner) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -159,7 +177,9 @@ library NamespaceOwner { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((owner)), _fieldLayout); } - /** Set owner */ + /** + * @notice Set owner + */ function set(ResourceId namespaceId, address owner) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -167,7 +187,9 @@ library NamespaceOwner { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((owner)), _fieldLayout); } - /** Set owner */ + /** + * @notice Set owner + */ function _set(ResourceId namespaceId, address owner) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); @@ -175,7 +197,9 @@ library NamespaceOwner { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((owner)), _fieldLayout); } - /** Set owner (using the specified store) */ + /** + * @notice Set owner (using the specified store) + */ function set(IStore _store, ResourceId namespaceId, address owner) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(namespaceId); diff --git a/packages/world/src/codegen/tables/ResourceAccess.sol b/packages/world/src/codegen/tables/ResourceAccess.sol index 52309fdaa6..17d4bd146f 100644 --- a/packages/world/src/codegen/tables/ResourceAccess.sol +++ b/packages/world/src/codegen/tables/ResourceAccess.sol @@ -83,7 +83,9 @@ library ResourceAccess { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get access */ + /** + * @notice Get access + */ function getAccess(ResourceId resourceId, address caller) internal view returns (bool access) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -93,7 +95,9 @@ library ResourceAccess { return (_toBool(uint8(bytes1(_blob)))); } - /** Get access */ + /** + * @notice Get access + */ function _getAccess(ResourceId resourceId, address caller) internal view returns (bool access) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -103,7 +107,9 @@ library ResourceAccess { return (_toBool(uint8(bytes1(_blob)))); } - /** Get access (using the specified store) */ + /** + * @notice Get access (using the specified store) + */ function getAccess(IStore _store, ResourceId resourceId, address caller) internal view returns (bool access) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -113,7 +119,9 @@ library ResourceAccess { return (_toBool(uint8(bytes1(_blob)))); } - /** Get access */ + /** + * @notice Get access + */ function get(ResourceId resourceId, address caller) internal view returns (bool access) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -123,7 +131,9 @@ library ResourceAccess { return (_toBool(uint8(bytes1(_blob)))); } - /** Get access */ + /** + * @notice Get access + */ function _get(ResourceId resourceId, address caller) internal view returns (bool access) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -133,7 +143,9 @@ library ResourceAccess { return (_toBool(uint8(bytes1(_blob)))); } - /** Get access (using the specified store) */ + /** + * @notice Get access (using the specified store) + */ function get(IStore _store, ResourceId resourceId, address caller) internal view returns (bool access) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -143,7 +155,9 @@ library ResourceAccess { return (_toBool(uint8(bytes1(_blob)))); } - /** Set access */ + /** + * @notice Set access + */ function setAccess(ResourceId resourceId, address caller, bool access) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -152,7 +166,9 @@ library ResourceAccess { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((access)), _fieldLayout); } - /** Set access */ + /** + * @notice Set access + */ function _setAccess(ResourceId resourceId, address caller, bool access) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -161,7 +177,9 @@ library ResourceAccess { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((access)), _fieldLayout); } - /** Set access (using the specified store) */ + /** + * @notice Set access (using the specified store) + */ function setAccess(IStore _store, ResourceId resourceId, address caller, bool access) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -170,7 +188,9 @@ library ResourceAccess { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((access)), _fieldLayout); } - /** Set access */ + /** + * @notice Set access + */ function set(ResourceId resourceId, address caller, bool access) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -179,7 +199,9 @@ library ResourceAccess { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((access)), _fieldLayout); } - /** Set access */ + /** + * @notice Set access + */ function _set(ResourceId resourceId, address caller, bool access) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); @@ -188,7 +210,9 @@ library ResourceAccess { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((access)), _fieldLayout); } - /** Set access (using the specified store) */ + /** + * @notice Set access (using the specified store) + */ function set(IStore _store, ResourceId resourceId, address caller, bool access) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = ResourceId.unwrap(resourceId); diff --git a/packages/world/src/codegen/tables/SystemHooks.sol b/packages/world/src/codegen/tables/SystemHooks.sol index 96c79120f6..3c23cd6d9b 100644 --- a/packages/world/src/codegen/tables/SystemHooks.sol +++ b/packages/world/src/codegen/tables/SystemHooks.sol @@ -81,7 +81,9 @@ library SystemHooks { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get value */ + /** + * @notice Get value + */ function getValue(ResourceId systemId) internal view returns (bytes21[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -90,7 +92,9 @@ library SystemHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get value */ + /** + * @notice Get value + */ function _getValue(ResourceId systemId) internal view returns (bytes21[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -99,7 +103,9 @@ library SystemHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function getValue(IStore _store, ResourceId systemId) internal view returns (bytes21[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -108,7 +114,9 @@ library SystemHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get value */ + /** + * @notice Get value + */ function get(ResourceId systemId) internal view returns (bytes21[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -117,7 +125,9 @@ library SystemHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get value */ + /** + * @notice Get value + */ function _get(ResourceId systemId) internal view returns (bytes21[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -126,7 +136,9 @@ library SystemHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function get(IStore _store, ResourceId systemId) internal view returns (bytes21[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -135,7 +147,9 @@ library SystemHooks { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_bytes21()); } - /** Set value */ + /** + * @notice Set value + */ function setValue(ResourceId systemId, bytes21[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -143,7 +157,9 @@ library SystemHooks { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function _setValue(ResourceId systemId, bytes21[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -151,7 +167,9 @@ library SystemHooks { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function setValue(IStore _store, ResourceId systemId, bytes21[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -159,7 +177,9 @@ library SystemHooks { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function set(ResourceId systemId, bytes21[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -167,7 +187,9 @@ library SystemHooks { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function _set(ResourceId systemId, bytes21[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -175,7 +197,9 @@ library SystemHooks { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function set(IStore _store, ResourceId systemId, bytes21[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -183,7 +207,9 @@ library SystemHooks { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Get the length of value */ + /** + * @notice Get length of value + */ function lengthValue(ResourceId systemId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -194,7 +220,9 @@ library SystemHooks { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function _lengthValue(ResourceId systemId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -205,7 +233,9 @@ library SystemHooks { } } - /** Get the length of value (using the specified store) */ + /** + * @notice Get length of value (using the specified store) + */ function lengthValue(IStore _store, ResourceId systemId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -216,7 +246,9 @@ library SystemHooks { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function length(ResourceId systemId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -227,7 +259,9 @@ library SystemHooks { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function _length(ResourceId systemId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -238,7 +272,9 @@ library SystemHooks { } } - /** Get the length of value (using the specified store) */ + /** + * @notice Get length of value (using the specified store) + */ function length(IStore _store, ResourceId systemId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -250,8 +286,8 @@ library SystemHooks { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function getItemValue(ResourceId systemId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -264,8 +300,8 @@ library SystemHooks { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemValue(ResourceId systemId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -278,8 +314,8 @@ library SystemHooks { } /** - * Get an item of value (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemValue(IStore _store, ResourceId systemId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -292,8 +328,8 @@ library SystemHooks { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(ResourceId systemId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -306,8 +342,8 @@ library SystemHooks { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function _getItem(ResourceId systemId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -320,8 +356,8 @@ library SystemHooks { } /** - * Get an item of value (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(IStore _store, ResourceId systemId, uint256 _index) internal view returns (bytes21) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -333,7 +369,9 @@ library SystemHooks { } } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function pushValue(ResourceId systemId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -341,7 +379,9 @@ library SystemHooks { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function _pushValue(ResourceId systemId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -349,7 +389,9 @@ library SystemHooks { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value (using the specified store) */ + /** + * @notice Push an element to value (using the specified store) + */ function pushValue(IStore _store, ResourceId systemId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -357,7 +399,9 @@ library SystemHooks { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function push(ResourceId systemId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -365,7 +409,9 @@ library SystemHooks { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function _push(ResourceId systemId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -373,7 +419,9 @@ library SystemHooks { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value (using the specified store) */ + /** + * @notice Push an element to value (using the specified store) + */ function push(IStore _store, ResourceId systemId, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -381,7 +429,9 @@ library SystemHooks { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function popValue(ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -389,7 +439,9 @@ library SystemHooks { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function _popValue(ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -397,7 +449,9 @@ library SystemHooks { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from value (using the specified store) */ + /** + * @notice Pop an element from value (using the specified store) + */ function popValue(IStore _store, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -405,7 +459,9 @@ library SystemHooks { _store.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function pop(ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -413,7 +469,9 @@ library SystemHooks { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function _pop(ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -421,7 +479,9 @@ library SystemHooks { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 21); } - /** Pop an element from value (using the specified store) */ + /** + * @notice Pop an element from value (using the specified store) + */ function pop(IStore _store, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -430,8 +490,8 @@ library SystemHooks { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateValue(ResourceId systemId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -444,8 +504,8 @@ library SystemHooks { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateValue(ResourceId systemId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -458,8 +518,8 @@ library SystemHooks { } /** - * Update an element of value (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateValue(IStore _store, ResourceId systemId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -472,8 +532,8 @@ library SystemHooks { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(ResourceId systemId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -486,8 +546,8 @@ library SystemHooks { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _update(ResourceId systemId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -500,8 +560,8 @@ library SystemHooks { } /** - * Update an element of value (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(IStore _store, ResourceId systemId, uint256 _index, bytes21 _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/world/src/codegen/tables/SystemRegistry.sol b/packages/world/src/codegen/tables/SystemRegistry.sol index fac136d246..9001cb7233 100644 --- a/packages/world/src/codegen/tables/SystemRegistry.sol +++ b/packages/world/src/codegen/tables/SystemRegistry.sol @@ -81,7 +81,9 @@ library SystemRegistry { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get systemId */ + /** + * @notice Get systemId + */ function getSystemId(address system) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -90,7 +92,9 @@ library SystemRegistry { return ResourceId.wrap(bytes32(_blob)); } - /** Get systemId */ + /** + * @notice Get systemId + */ function _getSystemId(address system) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -99,7 +103,9 @@ library SystemRegistry { return ResourceId.wrap(bytes32(_blob)); } - /** Get systemId (using the specified store) */ + /** + * @notice Get systemId (using the specified store) + */ function getSystemId(IStore _store, address system) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -108,7 +114,9 @@ library SystemRegistry { return ResourceId.wrap(bytes32(_blob)); } - /** Get systemId */ + /** + * @notice Get systemId + */ function get(address system) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -117,7 +125,9 @@ library SystemRegistry { return ResourceId.wrap(bytes32(_blob)); } - /** Get systemId */ + /** + * @notice Get systemId + */ function _get(address system) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -126,7 +136,9 @@ library SystemRegistry { return ResourceId.wrap(bytes32(_blob)); } - /** Get systemId (using the specified store) */ + /** + * @notice Get systemId (using the specified store) + */ function get(IStore _store, address system) internal view returns (ResourceId systemId) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -135,7 +147,9 @@ library SystemRegistry { return ResourceId.wrap(bytes32(_blob)); } - /** Set systemId */ + /** + * @notice Set systemId + */ function setSystemId(address system, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -143,7 +157,9 @@ library SystemRegistry { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(ResourceId.unwrap(systemId)), _fieldLayout); } - /** Set systemId */ + /** + * @notice Set systemId + */ function _setSystemId(address system, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -151,7 +167,9 @@ library SystemRegistry { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(ResourceId.unwrap(systemId)), _fieldLayout); } - /** Set systemId (using the specified store) */ + /** + * @notice Set systemId (using the specified store) + */ function setSystemId(IStore _store, address system, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -159,7 +177,9 @@ library SystemRegistry { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(ResourceId.unwrap(systemId)), _fieldLayout); } - /** Set systemId */ + /** + * @notice Set systemId + */ function set(address system, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -167,7 +187,9 @@ library SystemRegistry { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(ResourceId.unwrap(systemId)), _fieldLayout); } - /** Set systemId */ + /** + * @notice Set systemId + */ function _set(address system, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); @@ -175,7 +197,9 @@ library SystemRegistry { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked(ResourceId.unwrap(systemId)), _fieldLayout); } - /** Set systemId (using the specified store) */ + /** + * @notice Set systemId (using the specified store) + */ function set(IStore _store, address system, ResourceId systemId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(uint160(system))); diff --git a/packages/world/src/codegen/tables/Systems.sol b/packages/world/src/codegen/tables/Systems.sol index f7760a9340..1d50e33a95 100644 --- a/packages/world/src/codegen/tables/Systems.sol +++ b/packages/world/src/codegen/tables/Systems.sol @@ -83,7 +83,9 @@ library Systems { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get system */ + /** + * @notice Get system + */ function getSystem(ResourceId systemId) internal view returns (address system) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -92,7 +94,9 @@ library Systems { return (address(bytes20(_blob))); } - /** Get system */ + /** + * @notice Get system + */ function _getSystem(ResourceId systemId) internal view returns (address system) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -101,7 +105,9 @@ library Systems { return (address(bytes20(_blob))); } - /** Get system (using the specified store) */ + /** + * @notice Get system (using the specified store) + */ function getSystem(IStore _store, ResourceId systemId) internal view returns (address system) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -110,7 +116,9 @@ library Systems { return (address(bytes20(_blob))); } - /** Set system */ + /** + * @notice Set system + */ function setSystem(ResourceId systemId, address system) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -118,7 +126,9 @@ library Systems { StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((system)), _fieldLayout); } - /** Set system */ + /** + * @notice Set system + */ function _setSystem(ResourceId systemId, address system) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -126,7 +136,9 @@ library Systems { StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((system)), _fieldLayout); } - /** Set system (using the specified store) */ + /** + * @notice Set system (using the specified store) + */ function setSystem(IStore _store, ResourceId systemId, address system) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -134,7 +146,9 @@ library Systems { _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((system)), _fieldLayout); } - /** Get publicAccess */ + /** + * @notice Get publicAccess + */ function getPublicAccess(ResourceId systemId) internal view returns (bool publicAccess) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -143,7 +157,9 @@ library Systems { return (_toBool(uint8(bytes1(_blob)))); } - /** Get publicAccess */ + /** + * @notice Get publicAccess + */ function _getPublicAccess(ResourceId systemId) internal view returns (bool publicAccess) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -152,7 +168,9 @@ library Systems { return (_toBool(uint8(bytes1(_blob)))); } - /** Get publicAccess (using the specified store) */ + /** + * @notice Get publicAccess (using the specified store) + */ function getPublicAccess(IStore _store, ResourceId systemId) internal view returns (bool publicAccess) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -161,7 +179,9 @@ library Systems { return (_toBool(uint8(bytes1(_blob)))); } - /** Set publicAccess */ + /** + * @notice Set publicAccess + */ function setPublicAccess(ResourceId systemId, bool publicAccess) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -169,7 +189,9 @@ library Systems { StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((publicAccess)), _fieldLayout); } - /** Set publicAccess */ + /** + * @notice Set publicAccess + */ function _setPublicAccess(ResourceId systemId, bool publicAccess) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); @@ -177,7 +199,9 @@ library Systems { StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((publicAccess)), _fieldLayout); } - /** Set publicAccess (using the specified store) */ + /** + * @notice Set publicAccess (using the specified store) + */ function setPublicAccess(IStore _store, ResourceId systemId, bool publicAccess) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = ResourceId.unwrap(systemId); diff --git a/packages/world/src/codegen/tables/UserDelegationControl.sol b/packages/world/src/codegen/tables/UserDelegationControl.sol index 9d0d290594..a061f955f3 100644 --- a/packages/world/src/codegen/tables/UserDelegationControl.sol +++ b/packages/world/src/codegen/tables/UserDelegationControl.sol @@ -83,7 +83,9 @@ library UserDelegationControl { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get delegationControlId */ + /** + * @notice Get delegationControlId + */ function getDelegationControlId( address delegator, address delegatee @@ -96,7 +98,9 @@ library UserDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId */ + /** + * @notice Get delegationControlId + */ function _getDelegationControlId( address delegator, address delegatee @@ -109,7 +113,9 @@ library UserDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId (using the specified store) */ + /** + * @notice Get delegationControlId (using the specified store) + */ function getDelegationControlId( IStore _store, address delegator, @@ -123,7 +129,9 @@ library UserDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId */ + /** + * @notice Get delegationControlId + */ function get(address delegator, address delegatee) internal view returns (ResourceId delegationControlId) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -133,7 +141,9 @@ library UserDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId */ + /** + * @notice Get delegationControlId + */ function _get(address delegator, address delegatee) internal view returns (ResourceId delegationControlId) { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -143,7 +153,9 @@ library UserDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Get delegationControlId (using the specified store) */ + /** + * @notice Get delegationControlId (using the specified store) + */ function get( IStore _store, address delegator, @@ -157,7 +169,9 @@ library UserDelegationControl { return ResourceId.wrap(bytes32(_blob)); } - /** Set delegationControlId */ + /** + * @notice Set delegationControlId + */ function setDelegationControlId(address delegator, address delegatee, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -172,7 +186,9 @@ library UserDelegationControl { ); } - /** Set delegationControlId */ + /** + * @notice Set delegationControlId + */ function _setDelegationControlId(address delegator, address delegatee, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -187,7 +203,9 @@ library UserDelegationControl { ); } - /** Set delegationControlId (using the specified store) */ + /** + * @notice Set delegationControlId (using the specified store) + */ function setDelegationControlId( IStore _store, address delegator, @@ -207,7 +225,9 @@ library UserDelegationControl { ); } - /** Set delegationControlId */ + /** + * @notice Set delegationControlId + */ function set(address delegator, address delegatee, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -222,7 +242,9 @@ library UserDelegationControl { ); } - /** Set delegationControlId */ + /** + * @notice Set delegationControlId + */ function _set(address delegator, address delegatee, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); @@ -237,7 +259,9 @@ library UserDelegationControl { ); } - /** Set delegationControlId (using the specified store) */ + /** + * @notice Set delegationControlId (using the specified store) + */ function set(IStore _store, address delegator, address delegatee, ResourceId delegationControlId) internal { bytes32[] memory _keyTuple = new bytes32[](2); _keyTuple[0] = bytes32(uint256(uint160(delegator))); diff --git a/packages/world/test/codegen/tables/AddressArray.sol b/packages/world/test/codegen/tables/AddressArray.sol index b9e4230eef..128c2adfa7 100644 --- a/packages/world/test/codegen/tables/AddressArray.sol +++ b/packages/world/test/codegen/tables/AddressArray.sol @@ -73,7 +73,9 @@ library AddressArray { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get value */ + /** + * @notice Get value + */ function getValue(ResourceId _tableId, bytes32 key) internal view returns (address[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -82,7 +84,9 @@ library AddressArray { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Get value */ + /** + * @notice Get value + */ function _getValue(ResourceId _tableId, bytes32 key) internal view returns (address[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -91,7 +95,9 @@ library AddressArray { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function getValue(IStore _store, ResourceId _tableId, bytes32 key) internal view returns (address[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -100,7 +106,9 @@ library AddressArray { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Get value */ + /** + * @notice Get value + */ function get(ResourceId _tableId, bytes32 key) internal view returns (address[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -109,7 +117,9 @@ library AddressArray { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Get value */ + /** + * @notice Get value + */ function _get(ResourceId _tableId, bytes32 key) internal view returns (address[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -118,7 +128,9 @@ library AddressArray { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function get(IStore _store, ResourceId _tableId, bytes32 key) internal view returns (address[] memory value) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -127,7 +139,9 @@ library AddressArray { return (SliceLib.getSubslice(_blob, 0, _blob.length).decodeArray_address()); } - /** Set value */ + /** + * @notice Set value + */ function setValue(ResourceId _tableId, bytes32 key, address[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -135,7 +149,9 @@ library AddressArray { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function _setValue(ResourceId _tableId, bytes32 key, address[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -143,7 +159,9 @@ library AddressArray { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function setValue(IStore _store, ResourceId _tableId, bytes32 key, address[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -151,7 +169,9 @@ library AddressArray { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function set(ResourceId _tableId, bytes32 key, address[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -159,7 +179,9 @@ library AddressArray { StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value */ + /** + * @notice Set value + */ function _set(ResourceId _tableId, bytes32 key, address[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -167,7 +189,9 @@ library AddressArray { StoreCore.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function set(IStore _store, ResourceId _tableId, bytes32 key, address[] memory value) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -175,7 +199,9 @@ library AddressArray { _store.setDynamicField(_tableId, _keyTuple, 0, EncodeArray.encode((value))); } - /** Get the length of value */ + /** + * @notice Get length of value + */ function lengthValue(ResourceId _tableId, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -186,7 +212,9 @@ library AddressArray { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function _lengthValue(ResourceId _tableId, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -197,7 +225,9 @@ library AddressArray { } } - /** Get the length of value (using the specified store) */ + /** + * @notice Get length of value (using the specified store) + */ function lengthValue(IStore _store, ResourceId _tableId, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -208,7 +238,9 @@ library AddressArray { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function length(ResourceId _tableId, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -219,7 +251,9 @@ library AddressArray { } } - /** Get the length of value */ + /** + * @notice Get length of value + */ function _length(ResourceId _tableId, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -230,7 +264,9 @@ library AddressArray { } } - /** Get the length of value (using the specified store) */ + /** + * @notice Get length of value (using the specified store) + */ function length(IStore _store, ResourceId _tableId, bytes32 key) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -242,8 +278,8 @@ library AddressArray { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function getItemValue(ResourceId _tableId, bytes32 key, uint256 _index) internal view returns (address) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -256,8 +292,8 @@ library AddressArray { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function _getItemValue(ResourceId _tableId, bytes32 key, uint256 _index) internal view returns (address) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -270,8 +306,8 @@ library AddressArray { } /** - * Get an item of value (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItemValue( IStore _store, @@ -289,8 +325,8 @@ library AddressArray { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(ResourceId _tableId, bytes32 key, uint256 _index) internal view returns (address) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -303,8 +339,8 @@ library AddressArray { } /** - * Get an item of value - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value + * @dev (unchecked, returns invalid data if index overflows) */ function _getItem(ResourceId _tableId, bytes32 key, uint256 _index) internal view returns (address) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -317,8 +353,8 @@ library AddressArray { } /** - * Get an item of value (using the specified store) - * (unchecked, returns invalid data if index overflows) + * @notice Get an item of value (using the specified store) + * @dev (unchecked, returns invalid data if index overflows) */ function getItem(IStore _store, ResourceId _tableId, bytes32 key, uint256 _index) internal view returns (address) { bytes32[] memory _keyTuple = new bytes32[](1); @@ -330,7 +366,9 @@ library AddressArray { } } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function pushValue(ResourceId _tableId, bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -338,7 +376,9 @@ library AddressArray { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function _pushValue(ResourceId _tableId, bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -346,7 +386,9 @@ library AddressArray { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value (using the specified store) */ + /** + * @notice Push an element to value (using the specified store) + */ function pushValue(IStore _store, ResourceId _tableId, bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -354,7 +396,9 @@ library AddressArray { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function push(ResourceId _tableId, bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -362,7 +406,9 @@ library AddressArray { StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value */ + /** + * @notice Push an element to value + */ function _push(ResourceId _tableId, bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -370,7 +416,9 @@ library AddressArray { StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Push an element to value (using the specified store) */ + /** + * @notice Push an element to value (using the specified store) + */ function push(IStore _store, ResourceId _tableId, bytes32 key, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -378,7 +426,9 @@ library AddressArray { _store.pushToDynamicField(_tableId, _keyTuple, 0, abi.encodePacked((_element))); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function popValue(ResourceId _tableId, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -386,7 +436,9 @@ library AddressArray { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 20); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function _popValue(ResourceId _tableId, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -394,7 +446,9 @@ library AddressArray { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 20); } - /** Pop an element from value (using the specified store) */ + /** + * @notice Pop an element from value (using the specified store) + */ function popValue(IStore _store, ResourceId _tableId, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -402,7 +456,9 @@ library AddressArray { _store.popFromDynamicField(_tableId, _keyTuple, 0, 20); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function pop(ResourceId _tableId, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -410,7 +466,9 @@ library AddressArray { StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 20); } - /** Pop an element from value */ + /** + * @notice Pop an element from value + */ function _pop(ResourceId _tableId, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -418,7 +476,9 @@ library AddressArray { StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 20); } - /** Pop an element from value (using the specified store) */ + /** + * @notice Pop an element from value (using the specified store) + */ function pop(IStore _store, ResourceId _tableId, bytes32 key) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = key; @@ -427,8 +487,8 @@ library AddressArray { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateValue(ResourceId _tableId, bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -441,8 +501,8 @@ library AddressArray { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _updateValue(ResourceId _tableId, bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -455,8 +515,8 @@ library AddressArray { } /** - * Update an element of value (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function updateValue(IStore _store, ResourceId _tableId, bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -469,8 +529,8 @@ library AddressArray { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(ResourceId _tableId, bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -483,8 +543,8 @@ library AddressArray { } /** - * Update an element of value at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function _update(ResourceId _tableId, bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); @@ -497,8 +557,8 @@ library AddressArray { } /** - * Update an element of value (using the specified store) at `_index` - * (checked only to prevent modifying other tables; can corrupt own data if index overflows) + * @notice Update an element of value (using the specified store) at `_index` + * @dev (checked only to prevent modifying other tables; can corrupt own data if index overflows) */ function update(IStore _store, ResourceId _tableId, bytes32 key, uint256 _index, address _element) internal { bytes32[] memory _keyTuple = new bytes32[](1); diff --git a/packages/world/test/codegen/tables/Bool.sol b/packages/world/test/codegen/tables/Bool.sol index e110386002..c7bf5b3f44 100644 --- a/packages/world/test/codegen/tables/Bool.sol +++ b/packages/world/test/codegen/tables/Bool.sol @@ -71,7 +71,9 @@ library Bool { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get value */ + /** + * @notice Get value + */ function getValue(ResourceId _tableId) internal view returns (bool value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -79,7 +81,9 @@ library Bool { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value */ + /** + * @notice Get value + */ function _getValue(ResourceId _tableId) internal view returns (bool value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -87,7 +91,9 @@ library Bool { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function getValue(IStore _store, ResourceId _tableId) internal view returns (bool value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -95,7 +101,9 @@ library Bool { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value */ + /** + * @notice Get value + */ function get(ResourceId _tableId) internal view returns (bool value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -103,7 +111,9 @@ library Bool { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value */ + /** + * @notice Get value + */ function _get(ResourceId _tableId) internal view returns (bool value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -111,7 +121,9 @@ library Bool { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value (using the specified store) */ + /** + * @notice Get value (using the specified store) + */ function get(IStore _store, ResourceId _tableId) internal view returns (bool value) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -119,42 +131,54 @@ library Bool { return (_toBool(uint8(bytes1(_blob)))); } - /** Set value */ + /** + * @notice Set value + */ function setValue(ResourceId _tableId, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function _setValue(ResourceId _tableId, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function setValue(IStore _store, ResourceId _tableId, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function set(ResourceId _tableId, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value */ + /** + * @notice Set value + */ function _set(ResourceId _tableId, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value)), _fieldLayout); } - /** Set value (using the specified store) */ + /** + * @notice Set value (using the specified store) + */ function set(IStore _store, ResourceId _tableId, bool value) internal { bytes32[] memory _keyTuple = new bytes32[](0); diff --git a/packages/world/test/codegen/tables/TwoFields.sol b/packages/world/test/codegen/tables/TwoFields.sol index 8685868093..7e99bd53c0 100644 --- a/packages/world/test/codegen/tables/TwoFields.sol +++ b/packages/world/test/codegen/tables/TwoFields.sol @@ -78,7 +78,9 @@ library TwoFields { _store.registerTable(_tableId, _fieldLayout, getKeySchema(), getValueSchema(), getKeyNames(), getFieldNames()); } - /** Get value1 */ + /** + * @notice Get value1 + */ function getValue1(ResourceId _tableId) internal view returns (bool value1) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -86,7 +88,9 @@ library TwoFields { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value1 */ + /** + * @notice Get value1 + */ function _getValue1(ResourceId _tableId) internal view returns (bool value1) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -94,7 +98,9 @@ library TwoFields { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value1 (using the specified store) */ + /** + * @notice Get value1 (using the specified store) + */ function getValue1(IStore _store, ResourceId _tableId) internal view returns (bool value1) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -102,28 +108,36 @@ library TwoFields { return (_toBool(uint8(bytes1(_blob)))); } - /** Set value1 */ + /** + * @notice Set value1 + */ function setValue1(ResourceId _tableId, bool value1) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value1)), _fieldLayout); } - /** Set value1 */ + /** + * @notice Set value1 + */ function _setValue1(ResourceId _tableId, bool value1) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value1)), _fieldLayout); } - /** Set value1 (using the specified store) */ + /** + * @notice Set value1 (using the specified store) + */ function setValue1(IStore _store, ResourceId _tableId, bool value1) internal { bytes32[] memory _keyTuple = new bytes32[](0); _store.setStaticField(_tableId, _keyTuple, 0, abi.encodePacked((value1)), _fieldLayout); } - /** Get value2 */ + /** + * @notice Get value2 + */ function getValue2(ResourceId _tableId) internal view returns (bool value2) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -131,7 +145,9 @@ library TwoFields { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value2 */ + /** + * @notice Get value2 + */ function _getValue2(ResourceId _tableId) internal view returns (bool value2) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -139,7 +155,9 @@ library TwoFields { return (_toBool(uint8(bytes1(_blob)))); } - /** Get value2 (using the specified store) */ + /** + * @notice Get value2 (using the specified store) + */ function getValue2(IStore _store, ResourceId _tableId) internal view returns (bool value2) { bytes32[] memory _keyTuple = new bytes32[](0); @@ -147,21 +165,27 @@ library TwoFields { return (_toBool(uint8(bytes1(_blob)))); } - /** Set value2 */ + /** + * @notice Set value2 + */ function setValue2(ResourceId _tableId, bool value2) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreSwitch.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((value2)), _fieldLayout); } - /** Set value2 */ + /** + * @notice Set value2 + */ function _setValue2(ResourceId _tableId, bool value2) internal { bytes32[] memory _keyTuple = new bytes32[](0); StoreCore.setStaticField(_tableId, _keyTuple, 1, abi.encodePacked((value2)), _fieldLayout); } - /** Set value2 (using the specified store) */ + /** + * @notice Set value2 (using the specified store) + */ function setValue2(IStore _store, ResourceId _tableId, bool value2) internal { bytes32[] memory _keyTuple = new bytes32[](0); diff --git a/packages/world/ts/node/render-solidity/renderWorld.ts b/packages/world/ts/node/render-solidity/renderWorld.ts index add92e5676..c0e2fdcf5f 100644 --- a/packages/world/ts/node/render-solidity/renderWorld.ts +++ b/packages/world/ts/node/render-solidity/renderWorld.ts @@ -31,8 +31,9 @@ export function renderWorld(options: RenderWorldOptions) { ${renderRelativeImports(imports)} /** - * The ${interfaceName} interface includes all systems dynamically added to the World - * during the deploy process. + * @title ${interfaceName} + * @notice This interface integrates all systems that are dynamically added to the World during deployment. + * @dev This is an autogenerated file; do not edit manually. */ interface ${interfaceName} is ${renderArguments(importSymbols)} { }