From 25b2b79a3ff18de1e6427b6ebac0c49a6853e29f Mon Sep 17 00:00:00 2001 From: Ori Pomerantz Date: Fri, 29 Sep 2023 19:27:15 -0500 Subject: [PATCH] docs(store): add NatSpec to codegen/tightcoder (#1667) --- packages/store/src/tightcoder/DecodeSlice.sol | 593 ++++++++++++++++++ packages/store/src/tightcoder/EncodeArray.sol | 494 +++++++++++++++ .../codegen/tightcoder/renderDecodeSlice.ts | 6 + .../codegen/tightcoder/renderEncodeArray.ts | 5 + .../ts/codegen/tightcoder/renderFunctions.ts | 12 + 5 files changed, 1110 insertions(+) diff --git a/packages/store/src/tightcoder/DecodeSlice.sol b/packages/store/src/tightcoder/DecodeSlice.sol index b6a744ae24..36c5b01eaf 100644 --- a/packages/store/src/tightcoder/DecodeSlice.sol +++ b/packages/store/src/tightcoder/DecodeSlice.sol @@ -5,7 +5,18 @@ pragma solidity >=0.8.21; import { TightCoder } from "./TightCoder.sol"; import { Slice } from "../Slice.sol"; +/** + * @title DecodeSlice Library + * @notice A library for decoding slices of data into specific data types. + * @dev This library provides functions for decoding slices into arrays of basic uint types. + */ library DecodeSlice { + /** + * @notice Decodes a slice into an array of uint8. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint8. + */ function decodeArray_uint8(Slice _input) internal pure returns (uint8[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 1, 248); assembly { @@ -13,6 +24,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint16. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint16. + */ function decodeArray_uint16(Slice _input) internal pure returns (uint16[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 2, 240); assembly { @@ -20,6 +37,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint24. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint24. + */ function decodeArray_uint24(Slice _input) internal pure returns (uint24[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 3, 232); assembly { @@ -27,6 +50,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint32. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint32. + */ function decodeArray_uint32(Slice _input) internal pure returns (uint32[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 4, 224); assembly { @@ -34,6 +63,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint40. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint40. + */ function decodeArray_uint40(Slice _input) internal pure returns (uint40[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 5, 216); assembly { @@ -41,6 +76,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint48. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint48. + */ function decodeArray_uint48(Slice _input) internal pure returns (uint48[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 6, 208); assembly { @@ -48,6 +89,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint56. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint56. + */ function decodeArray_uint56(Slice _input) internal pure returns (uint56[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 7, 200); assembly { @@ -55,6 +102,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint64. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint64. + */ function decodeArray_uint64(Slice _input) internal pure returns (uint64[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 8, 192); assembly { @@ -62,6 +115,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint72. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint72. + */ function decodeArray_uint72(Slice _input) internal pure returns (uint72[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 9, 184); assembly { @@ -69,6 +128,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint80. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint80. + */ function decodeArray_uint80(Slice _input) internal pure returns (uint80[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 10, 176); assembly { @@ -76,6 +141,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint88. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint88. + */ function decodeArray_uint88(Slice _input) internal pure returns (uint88[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 11, 168); assembly { @@ -83,6 +154,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint96. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint96. + */ function decodeArray_uint96(Slice _input) internal pure returns (uint96[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 12, 160); assembly { @@ -90,6 +167,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint104. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint104. + */ function decodeArray_uint104(Slice _input) internal pure returns (uint104[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 13, 152); assembly { @@ -97,6 +180,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint112. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint112. + */ function decodeArray_uint112(Slice _input) internal pure returns (uint112[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 14, 144); assembly { @@ -104,6 +193,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint120. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint120. + */ function decodeArray_uint120(Slice _input) internal pure returns (uint120[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 15, 136); assembly { @@ -111,6 +206,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint128. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint128. + */ function decodeArray_uint128(Slice _input) internal pure returns (uint128[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 16, 128); assembly { @@ -118,6 +219,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint136. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint136. + */ function decodeArray_uint136(Slice _input) internal pure returns (uint136[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 17, 120); assembly { @@ -125,6 +232,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint144. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint144. + */ function decodeArray_uint144(Slice _input) internal pure returns (uint144[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 18, 112); assembly { @@ -132,6 +245,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint152. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint152. + */ function decodeArray_uint152(Slice _input) internal pure returns (uint152[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 19, 104); assembly { @@ -139,6 +258,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint160. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint160. + */ function decodeArray_uint160(Slice _input) internal pure returns (uint160[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 20, 96); assembly { @@ -146,6 +271,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint168. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint168. + */ function decodeArray_uint168(Slice _input) internal pure returns (uint168[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 21, 88); assembly { @@ -153,6 +284,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint176. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint176. + */ function decodeArray_uint176(Slice _input) internal pure returns (uint176[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 22, 80); assembly { @@ -160,6 +297,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint184. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint184. + */ function decodeArray_uint184(Slice _input) internal pure returns (uint184[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 23, 72); assembly { @@ -167,6 +310,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint192. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint192. + */ function decodeArray_uint192(Slice _input) internal pure returns (uint192[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 24, 64); assembly { @@ -174,6 +323,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint200. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint200. + */ function decodeArray_uint200(Slice _input) internal pure returns (uint200[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 25, 56); assembly { @@ -181,6 +336,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint208. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint208. + */ function decodeArray_uint208(Slice _input) internal pure returns (uint208[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 26, 48); assembly { @@ -188,6 +349,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint216. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint216. + */ function decodeArray_uint216(Slice _input) internal pure returns (uint216[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 27, 40); assembly { @@ -195,6 +362,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint224. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint224. + */ function decodeArray_uint224(Slice _input) internal pure returns (uint224[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 28, 32); assembly { @@ -202,6 +375,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint232. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint232. + */ function decodeArray_uint232(Slice _input) internal pure returns (uint232[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 29, 24); assembly { @@ -209,6 +388,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint240. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint240. + */ function decodeArray_uint240(Slice _input) internal pure returns (uint240[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 30, 16); assembly { @@ -216,6 +401,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint248. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint248. + */ function decodeArray_uint248(Slice _input) internal pure returns (uint248[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 31, 8); assembly { @@ -223,6 +414,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of uint256. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of uint256. + */ function decodeArray_uint256(Slice _input) internal pure returns (uint256[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 32, 0); assembly { @@ -230,6 +427,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int8. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int8. + */ function decodeArray_int8(Slice _input) internal pure returns (int8[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 1, 248); assembly { @@ -237,6 +440,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int16. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int16. + */ function decodeArray_int16(Slice _input) internal pure returns (int16[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 2, 240); assembly { @@ -244,6 +453,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int24. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int24. + */ function decodeArray_int24(Slice _input) internal pure returns (int24[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 3, 232); assembly { @@ -251,6 +466,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int32. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int32. + */ function decodeArray_int32(Slice _input) internal pure returns (int32[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 4, 224); assembly { @@ -258,6 +479,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int40. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int40. + */ function decodeArray_int40(Slice _input) internal pure returns (int40[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 5, 216); assembly { @@ -265,6 +492,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int48. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int48. + */ function decodeArray_int48(Slice _input) internal pure returns (int48[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 6, 208); assembly { @@ -272,6 +505,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int56. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int56. + */ function decodeArray_int56(Slice _input) internal pure returns (int56[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 7, 200); assembly { @@ -279,6 +518,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int64. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int64. + */ function decodeArray_int64(Slice _input) internal pure returns (int64[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 8, 192); assembly { @@ -286,6 +531,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int72. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int72. + */ function decodeArray_int72(Slice _input) internal pure returns (int72[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 9, 184); assembly { @@ -293,6 +544,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int80. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int80. + */ function decodeArray_int80(Slice _input) internal pure returns (int80[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 10, 176); assembly { @@ -300,6 +557,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int88. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int88. + */ function decodeArray_int88(Slice _input) internal pure returns (int88[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 11, 168); assembly { @@ -307,6 +570,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int96. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int96. + */ function decodeArray_int96(Slice _input) internal pure returns (int96[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 12, 160); assembly { @@ -314,6 +583,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int104. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int104. + */ function decodeArray_int104(Slice _input) internal pure returns (int104[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 13, 152); assembly { @@ -321,6 +596,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int112. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int112. + */ function decodeArray_int112(Slice _input) internal pure returns (int112[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 14, 144); assembly { @@ -328,6 +609,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int120. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int120. + */ function decodeArray_int120(Slice _input) internal pure returns (int120[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 15, 136); assembly { @@ -335,6 +622,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int128. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int128. + */ function decodeArray_int128(Slice _input) internal pure returns (int128[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 16, 128); assembly { @@ -342,6 +635,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int136. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int136. + */ function decodeArray_int136(Slice _input) internal pure returns (int136[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 17, 120); assembly { @@ -349,6 +648,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int144. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int144. + */ function decodeArray_int144(Slice _input) internal pure returns (int144[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 18, 112); assembly { @@ -356,6 +661,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int152. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int152. + */ function decodeArray_int152(Slice _input) internal pure returns (int152[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 19, 104); assembly { @@ -363,6 +674,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int160. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int160. + */ function decodeArray_int160(Slice _input) internal pure returns (int160[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 20, 96); assembly { @@ -370,6 +687,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int168. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int168. + */ function decodeArray_int168(Slice _input) internal pure returns (int168[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 21, 88); assembly { @@ -377,6 +700,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int176. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int176. + */ function decodeArray_int176(Slice _input) internal pure returns (int176[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 22, 80); assembly { @@ -384,6 +713,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int184. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int184. + */ function decodeArray_int184(Slice _input) internal pure returns (int184[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 23, 72); assembly { @@ -391,6 +726,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int192. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int192. + */ function decodeArray_int192(Slice _input) internal pure returns (int192[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 24, 64); assembly { @@ -398,6 +739,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int200. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int200. + */ function decodeArray_int200(Slice _input) internal pure returns (int200[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 25, 56); assembly { @@ -405,6 +752,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int208. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int208. + */ function decodeArray_int208(Slice _input) internal pure returns (int208[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 26, 48); assembly { @@ -412,6 +765,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int216. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int216. + */ function decodeArray_int216(Slice _input) internal pure returns (int216[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 27, 40); assembly { @@ -419,6 +778,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int224. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int224. + */ function decodeArray_int224(Slice _input) internal pure returns (int224[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 28, 32); assembly { @@ -426,6 +791,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int232. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int232. + */ function decodeArray_int232(Slice _input) internal pure returns (int232[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 29, 24); assembly { @@ -433,6 +804,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int240. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int240. + */ function decodeArray_int240(Slice _input) internal pure returns (int240[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 30, 16); assembly { @@ -440,6 +817,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int248. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int248. + */ function decodeArray_int248(Slice _input) internal pure returns (int248[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 31, 8); assembly { @@ -447,6 +830,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of int256. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of int256. + */ function decodeArray_int256(Slice _input) internal pure returns (int256[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 32, 0); assembly { @@ -454,6 +843,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes1. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes1. + */ function decodeArray_bytes1(Slice _input) internal pure returns (bytes1[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 1, 0); assembly { @@ -461,6 +856,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes2. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes2. + */ function decodeArray_bytes2(Slice _input) internal pure returns (bytes2[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 2, 0); assembly { @@ -468,6 +869,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes3. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes3. + */ function decodeArray_bytes3(Slice _input) internal pure returns (bytes3[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 3, 0); assembly { @@ -475,6 +882,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes4. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes4. + */ function decodeArray_bytes4(Slice _input) internal pure returns (bytes4[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 4, 0); assembly { @@ -482,6 +895,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes5. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes5. + */ function decodeArray_bytes5(Slice _input) internal pure returns (bytes5[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 5, 0); assembly { @@ -489,6 +908,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes6. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes6. + */ function decodeArray_bytes6(Slice _input) internal pure returns (bytes6[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 6, 0); assembly { @@ -496,6 +921,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes7. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes7. + */ function decodeArray_bytes7(Slice _input) internal pure returns (bytes7[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 7, 0); assembly { @@ -503,6 +934,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes8. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes8. + */ function decodeArray_bytes8(Slice _input) internal pure returns (bytes8[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 8, 0); assembly { @@ -510,6 +947,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes9. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes9. + */ function decodeArray_bytes9(Slice _input) internal pure returns (bytes9[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 9, 0); assembly { @@ -517,6 +960,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes10. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes10. + */ function decodeArray_bytes10(Slice _input) internal pure returns (bytes10[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 10, 0); assembly { @@ -524,6 +973,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes11. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes11. + */ function decodeArray_bytes11(Slice _input) internal pure returns (bytes11[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 11, 0); assembly { @@ -531,6 +986,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes12. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes12. + */ function decodeArray_bytes12(Slice _input) internal pure returns (bytes12[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 12, 0); assembly { @@ -538,6 +999,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes13. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes13. + */ function decodeArray_bytes13(Slice _input) internal pure returns (bytes13[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 13, 0); assembly { @@ -545,6 +1012,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes14. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes14. + */ function decodeArray_bytes14(Slice _input) internal pure returns (bytes14[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 14, 0); assembly { @@ -552,6 +1025,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes15. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes15. + */ function decodeArray_bytes15(Slice _input) internal pure returns (bytes15[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 15, 0); assembly { @@ -559,6 +1038,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes16. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes16. + */ function decodeArray_bytes16(Slice _input) internal pure returns (bytes16[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 16, 0); assembly { @@ -566,6 +1051,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes17. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes17. + */ function decodeArray_bytes17(Slice _input) internal pure returns (bytes17[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 17, 0); assembly { @@ -573,6 +1064,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes18. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes18. + */ function decodeArray_bytes18(Slice _input) internal pure returns (bytes18[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 18, 0); assembly { @@ -580,6 +1077,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes19. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes19. + */ function decodeArray_bytes19(Slice _input) internal pure returns (bytes19[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 19, 0); assembly { @@ -587,6 +1090,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes20. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes20. + */ function decodeArray_bytes20(Slice _input) internal pure returns (bytes20[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 20, 0); assembly { @@ -594,6 +1103,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes21. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes21. + */ function decodeArray_bytes21(Slice _input) internal pure returns (bytes21[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 21, 0); assembly { @@ -601,6 +1116,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes22. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes22. + */ function decodeArray_bytes22(Slice _input) internal pure returns (bytes22[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 22, 0); assembly { @@ -608,6 +1129,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes23. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes23. + */ function decodeArray_bytes23(Slice _input) internal pure returns (bytes23[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 23, 0); assembly { @@ -615,6 +1142,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes24. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes24. + */ function decodeArray_bytes24(Slice _input) internal pure returns (bytes24[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 24, 0); assembly { @@ -622,6 +1155,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes25. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes25. + */ function decodeArray_bytes25(Slice _input) internal pure returns (bytes25[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 25, 0); assembly { @@ -629,6 +1168,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes26. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes26. + */ function decodeArray_bytes26(Slice _input) internal pure returns (bytes26[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 26, 0); assembly { @@ -636,6 +1181,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes27. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes27. + */ function decodeArray_bytes27(Slice _input) internal pure returns (bytes27[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 27, 0); assembly { @@ -643,6 +1194,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes28. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes28. + */ function decodeArray_bytes28(Slice _input) internal pure returns (bytes28[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 28, 0); assembly { @@ -650,6 +1207,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes29. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes29. + */ function decodeArray_bytes29(Slice _input) internal pure returns (bytes29[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 29, 0); assembly { @@ -657,6 +1220,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes30. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes30. + */ function decodeArray_bytes30(Slice _input) internal pure returns (bytes30[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 30, 0); assembly { @@ -664,6 +1233,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes31. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes31. + */ function decodeArray_bytes31(Slice _input) internal pure returns (bytes31[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 31, 0); assembly { @@ -671,6 +1246,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bytes32. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bytes32. + */ function decodeArray_bytes32(Slice _input) internal pure returns (bytes32[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 32, 0); assembly { @@ -678,6 +1259,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of bool. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of bool. + */ function decodeArray_bool(Slice _input) internal pure returns (bool[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 1, 248); assembly { @@ -685,6 +1272,12 @@ library DecodeSlice { } } + /** + * @notice Decodes a slice into an array of address. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of address. + */ function decodeArray_address(Slice _input) internal pure returns (address[] memory _output) { bytes32[] memory _genericArray = TightCoder.decode(_input, 20, 96); assembly { diff --git a/packages/store/src/tightcoder/EncodeArray.sol b/packages/store/src/tightcoder/EncodeArray.sol index 816e00407d..a9c8b1edae 100644 --- a/packages/store/src/tightcoder/EncodeArray.sol +++ b/packages/store/src/tightcoder/EncodeArray.sol @@ -4,7 +4,16 @@ pragma solidity >=0.8.21; /* Autogenerated file. Do not edit manually. */ import { TightCoder } from "./TightCoder.sol"; +/** + * @title EncodeArray + * @dev This library provides utilities for encoding arrays into tightly packed bytes representations. + */ library EncodeArray { + /** + * @notice Encodes an array of uint8 into a tightly packed bytes representation. + * @param _input The array of uint8 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint8[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -13,6 +22,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 1, 248); } + /** + * @notice Encodes an array of uint16 into a tightly packed bytes representation. + * @param _input The array of uint16 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint16[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -21,6 +35,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 2, 240); } + /** + * @notice Encodes an array of uint24 into a tightly packed bytes representation. + * @param _input The array of uint24 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint24[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -29,6 +48,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 3, 232); } + /** + * @notice Encodes an array of uint32 into a tightly packed bytes representation. + * @param _input The array of uint32 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint32[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -37,6 +61,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 4, 224); } + /** + * @notice Encodes an array of uint40 into a tightly packed bytes representation. + * @param _input The array of uint40 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint40[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -45,6 +74,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 5, 216); } + /** + * @notice Encodes an array of uint48 into a tightly packed bytes representation. + * @param _input The array of uint48 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint48[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -53,6 +87,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 6, 208); } + /** + * @notice Encodes an array of uint56 into a tightly packed bytes representation. + * @param _input The array of uint56 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint56[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -61,6 +100,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 7, 200); } + /** + * @notice Encodes an array of uint64 into a tightly packed bytes representation. + * @param _input The array of uint64 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint64[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -69,6 +113,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 8, 192); } + /** + * @notice Encodes an array of uint72 into a tightly packed bytes representation. + * @param _input The array of uint72 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint72[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -77,6 +126,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 9, 184); } + /** + * @notice Encodes an array of uint80 into a tightly packed bytes representation. + * @param _input The array of uint80 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint80[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -85,6 +139,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 10, 176); } + /** + * @notice Encodes an array of uint88 into a tightly packed bytes representation. + * @param _input The array of uint88 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint88[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -93,6 +152,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 11, 168); } + /** + * @notice Encodes an array of uint96 into a tightly packed bytes representation. + * @param _input The array of uint96 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint96[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -101,6 +165,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 12, 160); } + /** + * @notice Encodes an array of uint104 into a tightly packed bytes representation. + * @param _input The array of uint104 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint104[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -109,6 +178,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 13, 152); } + /** + * @notice Encodes an array of uint112 into a tightly packed bytes representation. + * @param _input The array of uint112 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint112[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -117,6 +191,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 14, 144); } + /** + * @notice Encodes an array of uint120 into a tightly packed bytes representation. + * @param _input The array of uint120 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint120[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -125,6 +204,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 15, 136); } + /** + * @notice Encodes an array of uint128 into a tightly packed bytes representation. + * @param _input The array of uint128 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint128[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -133,6 +217,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 16, 128); } + /** + * @notice Encodes an array of uint136 into a tightly packed bytes representation. + * @param _input The array of uint136 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint136[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -141,6 +230,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 17, 120); } + /** + * @notice Encodes an array of uint144 into a tightly packed bytes representation. + * @param _input The array of uint144 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint144[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -149,6 +243,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 18, 112); } + /** + * @notice Encodes an array of uint152 into a tightly packed bytes representation. + * @param _input The array of uint152 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint152[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -157,6 +256,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 19, 104); } + /** + * @notice Encodes an array of uint160 into a tightly packed bytes representation. + * @param _input The array of uint160 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint160[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -165,6 +269,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 20, 96); } + /** + * @notice Encodes an array of uint168 into a tightly packed bytes representation. + * @param _input The array of uint168 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint168[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -173,6 +282,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 21, 88); } + /** + * @notice Encodes an array of uint176 into a tightly packed bytes representation. + * @param _input The array of uint176 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint176[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -181,6 +295,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 22, 80); } + /** + * @notice Encodes an array of uint184 into a tightly packed bytes representation. + * @param _input The array of uint184 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint184[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -189,6 +308,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 23, 72); } + /** + * @notice Encodes an array of uint192 into a tightly packed bytes representation. + * @param _input The array of uint192 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint192[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -197,6 +321,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 24, 64); } + /** + * @notice Encodes an array of uint200 into a tightly packed bytes representation. + * @param _input The array of uint200 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint200[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -205,6 +334,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 25, 56); } + /** + * @notice Encodes an array of uint208 into a tightly packed bytes representation. + * @param _input The array of uint208 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint208[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -213,6 +347,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 26, 48); } + /** + * @notice Encodes an array of uint216 into a tightly packed bytes representation. + * @param _input The array of uint216 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint216[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -221,6 +360,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 27, 40); } + /** + * @notice Encodes an array of uint224 into a tightly packed bytes representation. + * @param _input The array of uint224 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint224[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -229,6 +373,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 28, 32); } + /** + * @notice Encodes an array of uint232 into a tightly packed bytes representation. + * @param _input The array of uint232 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint232[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -237,6 +386,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 29, 24); } + /** + * @notice Encodes an array of uint240 into a tightly packed bytes representation. + * @param _input The array of uint240 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint240[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -245,6 +399,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 30, 16); } + /** + * @notice Encodes an array of uint248 into a tightly packed bytes representation. + * @param _input The array of uint248 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint248[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -253,6 +412,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 31, 8); } + /** + * @notice Encodes an array of uint256 into a tightly packed bytes representation. + * @param _input The array of uint256 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(uint256[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -261,6 +425,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 32, 0); } + /** + * @notice Encodes an array of int8 into a tightly packed bytes representation. + * @param _input The array of int8 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int8[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -269,6 +438,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 1, 248); } + /** + * @notice Encodes an array of int16 into a tightly packed bytes representation. + * @param _input The array of int16 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int16[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -277,6 +451,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 2, 240); } + /** + * @notice Encodes an array of int24 into a tightly packed bytes representation. + * @param _input The array of int24 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int24[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -285,6 +464,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 3, 232); } + /** + * @notice Encodes an array of int32 into a tightly packed bytes representation. + * @param _input The array of int32 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int32[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -293,6 +477,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 4, 224); } + /** + * @notice Encodes an array of int40 into a tightly packed bytes representation. + * @param _input The array of int40 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int40[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -301,6 +490,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 5, 216); } + /** + * @notice Encodes an array of int48 into a tightly packed bytes representation. + * @param _input The array of int48 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int48[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -309,6 +503,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 6, 208); } + /** + * @notice Encodes an array of int56 into a tightly packed bytes representation. + * @param _input The array of int56 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int56[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -317,6 +516,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 7, 200); } + /** + * @notice Encodes an array of int64 into a tightly packed bytes representation. + * @param _input The array of int64 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int64[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -325,6 +529,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 8, 192); } + /** + * @notice Encodes an array of int72 into a tightly packed bytes representation. + * @param _input The array of int72 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int72[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -333,6 +542,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 9, 184); } + /** + * @notice Encodes an array of int80 into a tightly packed bytes representation. + * @param _input The array of int80 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int80[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -341,6 +555,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 10, 176); } + /** + * @notice Encodes an array of int88 into a tightly packed bytes representation. + * @param _input The array of int88 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int88[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -349,6 +568,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 11, 168); } + /** + * @notice Encodes an array of int96 into a tightly packed bytes representation. + * @param _input The array of int96 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int96[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -357,6 +581,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 12, 160); } + /** + * @notice Encodes an array of int104 into a tightly packed bytes representation. + * @param _input The array of int104 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int104[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -365,6 +594,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 13, 152); } + /** + * @notice Encodes an array of int112 into a tightly packed bytes representation. + * @param _input The array of int112 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int112[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -373,6 +607,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 14, 144); } + /** + * @notice Encodes an array of int120 into a tightly packed bytes representation. + * @param _input The array of int120 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int120[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -381,6 +620,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 15, 136); } + /** + * @notice Encodes an array of int128 into a tightly packed bytes representation. + * @param _input The array of int128 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int128[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -389,6 +633,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 16, 128); } + /** + * @notice Encodes an array of int136 into a tightly packed bytes representation. + * @param _input The array of int136 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int136[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -397,6 +646,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 17, 120); } + /** + * @notice Encodes an array of int144 into a tightly packed bytes representation. + * @param _input The array of int144 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int144[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -405,6 +659,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 18, 112); } + /** + * @notice Encodes an array of int152 into a tightly packed bytes representation. + * @param _input The array of int152 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int152[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -413,6 +672,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 19, 104); } + /** + * @notice Encodes an array of int160 into a tightly packed bytes representation. + * @param _input The array of int160 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int160[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -421,6 +685,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 20, 96); } + /** + * @notice Encodes an array of int168 into a tightly packed bytes representation. + * @param _input The array of int168 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int168[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -429,6 +698,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 21, 88); } + /** + * @notice Encodes an array of int176 into a tightly packed bytes representation. + * @param _input The array of int176 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int176[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -437,6 +711,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 22, 80); } + /** + * @notice Encodes an array of int184 into a tightly packed bytes representation. + * @param _input The array of int184 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int184[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -445,6 +724,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 23, 72); } + /** + * @notice Encodes an array of int192 into a tightly packed bytes representation. + * @param _input The array of int192 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int192[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -453,6 +737,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 24, 64); } + /** + * @notice Encodes an array of int200 into a tightly packed bytes representation. + * @param _input The array of int200 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int200[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -461,6 +750,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 25, 56); } + /** + * @notice Encodes an array of int208 into a tightly packed bytes representation. + * @param _input The array of int208 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int208[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -469,6 +763,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 26, 48); } + /** + * @notice Encodes an array of int216 into a tightly packed bytes representation. + * @param _input The array of int216 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int216[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -477,6 +776,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 27, 40); } + /** + * @notice Encodes an array of int224 into a tightly packed bytes representation. + * @param _input The array of int224 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int224[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -485,6 +789,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 28, 32); } + /** + * @notice Encodes an array of int232 into a tightly packed bytes representation. + * @param _input The array of int232 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int232[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -493,6 +802,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 29, 24); } + /** + * @notice Encodes an array of int240 into a tightly packed bytes representation. + * @param _input The array of int240 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int240[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -501,6 +815,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 30, 16); } + /** + * @notice Encodes an array of int248 into a tightly packed bytes representation. + * @param _input The array of int248 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int248[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -509,6 +828,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 31, 8); } + /** + * @notice Encodes an array of int256 into a tightly packed bytes representation. + * @param _input The array of int256 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(int256[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -517,6 +841,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 32, 0); } + /** + * @notice Encodes an array of bytes1 into a tightly packed bytes representation. + * @param _input The array of bytes1 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes1[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -525,6 +854,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 1, 0); } + /** + * @notice Encodes an array of bytes2 into a tightly packed bytes representation. + * @param _input The array of bytes2 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes2[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -533,6 +867,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 2, 0); } + /** + * @notice Encodes an array of bytes3 into a tightly packed bytes representation. + * @param _input The array of bytes3 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes3[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -541,6 +880,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 3, 0); } + /** + * @notice Encodes an array of bytes4 into a tightly packed bytes representation. + * @param _input The array of bytes4 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes4[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -549,6 +893,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 4, 0); } + /** + * @notice Encodes an array of bytes5 into a tightly packed bytes representation. + * @param _input The array of bytes5 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes5[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -557,6 +906,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 5, 0); } + /** + * @notice Encodes an array of bytes6 into a tightly packed bytes representation. + * @param _input The array of bytes6 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes6[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -565,6 +919,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 6, 0); } + /** + * @notice Encodes an array of bytes7 into a tightly packed bytes representation. + * @param _input The array of bytes7 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes7[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -573,6 +932,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 7, 0); } + /** + * @notice Encodes an array of bytes8 into a tightly packed bytes representation. + * @param _input The array of bytes8 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes8[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -581,6 +945,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 8, 0); } + /** + * @notice Encodes an array of bytes9 into a tightly packed bytes representation. + * @param _input The array of bytes9 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes9[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -589,6 +958,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 9, 0); } + /** + * @notice Encodes an array of bytes10 into a tightly packed bytes representation. + * @param _input The array of bytes10 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes10[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -597,6 +971,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 10, 0); } + /** + * @notice Encodes an array of bytes11 into a tightly packed bytes representation. + * @param _input The array of bytes11 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes11[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -605,6 +984,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 11, 0); } + /** + * @notice Encodes an array of bytes12 into a tightly packed bytes representation. + * @param _input The array of bytes12 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes12[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -613,6 +997,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 12, 0); } + /** + * @notice Encodes an array of bytes13 into a tightly packed bytes representation. + * @param _input The array of bytes13 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes13[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -621,6 +1010,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 13, 0); } + /** + * @notice Encodes an array of bytes14 into a tightly packed bytes representation. + * @param _input The array of bytes14 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes14[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -629,6 +1023,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 14, 0); } + /** + * @notice Encodes an array of bytes15 into a tightly packed bytes representation. + * @param _input The array of bytes15 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes15[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -637,6 +1036,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 15, 0); } + /** + * @notice Encodes an array of bytes16 into a tightly packed bytes representation. + * @param _input The array of bytes16 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes16[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -645,6 +1049,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 16, 0); } + /** + * @notice Encodes an array of bytes17 into a tightly packed bytes representation. + * @param _input The array of bytes17 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes17[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -653,6 +1062,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 17, 0); } + /** + * @notice Encodes an array of bytes18 into a tightly packed bytes representation. + * @param _input The array of bytes18 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes18[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -661,6 +1075,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 18, 0); } + /** + * @notice Encodes an array of bytes19 into a tightly packed bytes representation. + * @param _input The array of bytes19 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes19[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -669,6 +1088,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 19, 0); } + /** + * @notice Encodes an array of bytes20 into a tightly packed bytes representation. + * @param _input The array of bytes20 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes20[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -677,6 +1101,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 20, 0); } + /** + * @notice Encodes an array of bytes21 into a tightly packed bytes representation. + * @param _input The array of bytes21 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes21[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -685,6 +1114,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 21, 0); } + /** + * @notice Encodes an array of bytes22 into a tightly packed bytes representation. + * @param _input The array of bytes22 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes22[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -693,6 +1127,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 22, 0); } + /** + * @notice Encodes an array of bytes23 into a tightly packed bytes representation. + * @param _input The array of bytes23 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes23[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -701,6 +1140,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 23, 0); } + /** + * @notice Encodes an array of bytes24 into a tightly packed bytes representation. + * @param _input The array of bytes24 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes24[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -709,6 +1153,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 24, 0); } + /** + * @notice Encodes an array of bytes25 into a tightly packed bytes representation. + * @param _input The array of bytes25 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes25[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -717,6 +1166,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 25, 0); } + /** + * @notice Encodes an array of bytes26 into a tightly packed bytes representation. + * @param _input The array of bytes26 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes26[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -725,6 +1179,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 26, 0); } + /** + * @notice Encodes an array of bytes27 into a tightly packed bytes representation. + * @param _input The array of bytes27 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes27[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -733,6 +1192,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 27, 0); } + /** + * @notice Encodes an array of bytes28 into a tightly packed bytes representation. + * @param _input The array of bytes28 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes28[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -741,6 +1205,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 28, 0); } + /** + * @notice Encodes an array of bytes29 into a tightly packed bytes representation. + * @param _input The array of bytes29 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes29[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -749,6 +1218,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 29, 0); } + /** + * @notice Encodes an array of bytes30 into a tightly packed bytes representation. + * @param _input The array of bytes30 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes30[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -757,6 +1231,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 30, 0); } + /** + * @notice Encodes an array of bytes31 into a tightly packed bytes representation. + * @param _input The array of bytes31 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes31[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -765,6 +1244,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 31, 0); } + /** + * @notice Encodes an array of bytes32 into a tightly packed bytes representation. + * @param _input The array of bytes32 values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bytes32[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -773,6 +1257,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 32, 0); } + /** + * @notice Encodes an array of bool into a tightly packed bytes representation. + * @param _input The array of bool values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(bool[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { @@ -781,6 +1270,11 @@ library EncodeArray { return TightCoder.encode(_genericArray, 1, 248); } + /** + * @notice Encodes an array of address into a tightly packed bytes representation. + * @param _input The array of address values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(address[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly { diff --git a/packages/store/ts/codegen/tightcoder/renderDecodeSlice.ts b/packages/store/ts/codegen/tightcoder/renderDecodeSlice.ts index 8eb4ac44f5..3c3056a95b 100644 --- a/packages/store/ts/codegen/tightcoder/renderDecodeSlice.ts +++ b/packages/store/ts/codegen/tightcoder/renderDecodeSlice.ts @@ -7,6 +7,12 @@ export function renderDecodeSlice() { ${renderedSolidityHeader} import { TightCoder } from "./TightCoder.sol"; import { Slice } from "../Slice.sol"; + + /** + * @title DecodeSlice Library + * @notice A library for decoding slices of data into specific data types. + * @dev This library provides functions for decoding slices into arrays of basic uint types. + */ library DecodeSlice { ${staticAbiTypes .map((staticAbiType) => diff --git a/packages/store/ts/codegen/tightcoder/renderEncodeArray.ts b/packages/store/ts/codegen/tightcoder/renderEncodeArray.ts index b27f1e21d2..f9315b0c70 100644 --- a/packages/store/ts/codegen/tightcoder/renderEncodeArray.ts +++ b/packages/store/ts/codegen/tightcoder/renderEncodeArray.ts @@ -6,6 +6,11 @@ export function renderEncodeArray() { return ` ${renderedSolidityHeader} import { TightCoder } from "./TightCoder.sol"; + + /** + * @title EncodeArray + * @dev This library provides utilities for encoding arrays into tightly packed bytes representations. + */ library EncodeArray { ${staticAbiTypes .map((staticAbiType) => diff --git a/packages/store/ts/codegen/tightcoder/renderFunctions.ts b/packages/store/ts/codegen/tightcoder/renderFunctions.ts index 00cd98a450..7b8b591e54 100644 --- a/packages/store/ts/codegen/tightcoder/renderFunctions.ts +++ b/packages/store/ts/codegen/tightcoder/renderFunctions.ts @@ -2,6 +2,12 @@ import { getLeftPaddingBits } from "@latticexyz/common/codegen"; export function renderTightCoderDecode(element: { internalTypeId: string; staticByteLength: number }) { return ` + /** + * @notice Decodes a slice into an array of ${element.internalTypeId}. + * @dev Uses TightCoder for initial decoding, and then assembly for memory conversion. + * @param _input The slice to decode. + * @return _output The decoded array of ${element.internalTypeId}. + */ function decodeArray_${element.internalTypeId}( Slice _input ) internal pure returns ( @@ -21,6 +27,12 @@ export function renderTightCoderDecode(element: { internalTypeId: string; static export function renderTightCoderEncode(element: { internalTypeId: string; staticByteLength: number }) { return ` + + /** + * @notice Encodes an array of ${element.internalTypeId} into a tightly packed bytes representation. + * @param _input The array of ${element.internalTypeId} values to be encoded. + * @return The resulting tightly packed bytes representation of the input array. + */ function encode(${element.internalTypeId}[] memory _input) internal pure returns (bytes memory) { bytes32[] memory _genericArray; assembly {