From f33f57eb18d562dfa36b833096f5bb4213253a45 Mon Sep 17 00:00:00 2001 From: Kevin Ingersoll <kingersoll@gmail.com> Date: Thu, 21 Mar 2024 11:04:18 +0000 Subject: [PATCH] small docs tweaks --- docs/pages/store/reference/misc.mdx | 2 +- .../src/typescript/dynamicAbiTypes.ts | 2 +- packages/store/src/EncodedLengths.sol | 36 +++++++++---------- packages/store/src/constants.sol | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/pages/store/reference/misc.mdx b/docs/pages/store/reference/misc.mdx index 65e118ae93..4f887c8baa 100644 --- a/docs/pages/store/reference/misc.mdx +++ b/docs/pages/store/reference/misc.mdx @@ -2476,7 +2476,7 @@ uint256 constant MAX_STATIC_FIELDS = 28; #### MAX_DYNAMIC_FIELDS -_Represents the maximum number of dynamic fields that can be packed in a EncodedLengths._ +_Represents the maximum number of dynamic fields that can be packed in EncodedLengths._ ```solidity uint256 constant MAX_DYNAMIC_FIELDS = 5; diff --git a/packages/schema-type/src/typescript/dynamicAbiTypes.ts b/packages/schema-type/src/typescript/dynamicAbiTypes.ts index b1f687f5df..5c54a14fab 100644 --- a/packages/schema-type/src/typescript/dynamicAbiTypes.ts +++ b/packages/schema-type/src/typescript/dynamicAbiTypes.ts @@ -2,7 +2,7 @@ import { Hex } from "viem"; import { DynamicAbiType, dynamicAbiTypes } from "./schemaAbiTypes"; import { LiteralToBroad } from "./utils"; -// Variable-length ABI types, where their lengths are encoded by a EncodedLengths within the record +// Variable-length ABI types, where their lengths are encoded by EncodedLengths within the record export type DynamicPrimitiveType = | readonly number[] diff --git a/packages/store/src/EncodedLengths.sol b/packages/store/src/EncodedLengths.sol index 24bc9e89f3..5a0090ad68 100644 --- a/packages/store/src/EncodedLengths.sol +++ b/packages/store/src/EncodedLengths.sol @@ -32,13 +32,13 @@ uint256 constant MAX_VAL = type(uint40).max; * @title EncodedLengths Library * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) * @notice Static functions for handling EncodedLengths type. - * @dev Provides utility functions to pack values into a EncodedLengths. + * @dev Provides utility functions to pack values into EncodedLengths. * The caller must ensure that the value arguments are <= MAX_VAL. */ library EncodedLengthsLib { /** - * @notice Packs a single value into a EncodedLengths. - * @dev Encodes the given value 'a' into the structure of a EncodedLengths. The encoded lengths's accumulator + * @notice Packs a single value into EncodedLengths. + * @dev Encodes the given value 'a' into the structure of EncodedLengths. The encoded lengths's accumulator * will be set to 'a', and the first value slot of the EncodedLengths will also be set to 'a'. * @param a The length of the first dynamic field's data. * @return The resulting EncodedLengths containing the encoded value. @@ -53,8 +53,8 @@ library EncodedLengthsLib { } /** - * @notice Packs two values into a EncodedLengths. - * @dev Encodes the given values 'a'-'b' into the structure of a EncodedLengths. + * @notice Packs two values into EncodedLengths. + * @dev Encodes the given values 'a'-'b' into the structure of EncodedLengths. * @param a The length of the first dynamic field's data. * @param b The length of the second dynamic field's data. * @return The resulting EncodedLengths containing the encoded values. @@ -70,8 +70,8 @@ library EncodedLengthsLib { } /** - * @notice Packs three values into a EncodedLengths. - * @dev Encodes the given values 'a'-'c' into the structure of a EncodedLengths. + * @notice Packs three values into EncodedLengths. + * @dev Encodes the given values 'a'-'c' into the structure of EncodedLengths. * @param a The length of the first dynamic field's data. * @param b The length of the second dynamic field's data. * @param c The length of the third dynamic field's data. @@ -89,8 +89,8 @@ library EncodedLengthsLib { } /** - * @notice Packs four values into a EncodedLengths. - * @dev Encodes the given values 'a'-'d' into the structure of a EncodedLengths. + * @notice Packs four values into EncodedLengths. + * @dev Encodes the given values 'a'-'d' into the structure of EncodedLengths. * @param a The length of the first dynamic field's data. * @param b The length of the second dynamic field's data. * @param c The length of the third dynamic field's data. @@ -110,8 +110,8 @@ library EncodedLengthsLib { } /** - * @notice Packs five values into a EncodedLengths. - * @dev Encodes the given values 'a'-'e' into the structure of a EncodedLengths. + * @notice Packs five values into EncodedLengths. + * @dev Encodes the given values 'a'-'e' into the structure of EncodedLengths. * @param a The length of the first dynamic field's data. * @param b The length of the second dynamic field's data. * @param c The length of the third dynamic field's data. @@ -136,13 +136,13 @@ library EncodedLengthsLib { /** * @title EncodedLengths Instance Library * @author MUD (https://mud.dev) by Lattice (https://lattice.xyz) - * @notice Instance functions for handling a EncodedLengths. - * @dev Offers decoding, extracting, and setting functionalities for a EncodedLengths. + * @notice Instance functions for handling EncodedLengths. + * @dev Offers decoding, extracting, and setting functionalities for EncodedLengths. */ library EncodedLengthsInstance { /** - * @notice Decode the accumulated counter from a EncodedLengths. - * @dev Extracts the right-most 7 bytes of a EncodedLengths. + * @notice Decode the accumulated counter from EncodedLengths. + * @dev Extracts the right-most 7 bytes of EncodedLengths. * @param encodedLengths The encoded lengths to decode. * @return The accumulated value from the EncodedLengths. */ @@ -151,7 +151,7 @@ library EncodedLengthsInstance { } /** - * @notice Decode the dynamic field size at a specific index from a EncodedLengths. + * @notice Decode the dynamic field size at a specific index from EncodedLengths. * @dev Extracts value right-to-left, with 5 bytes per dynamic field after the right-most 7 bytes. * @param encodedLengths The encoded lengths to decode. * @param index The index to retrieve. @@ -164,7 +164,7 @@ library EncodedLengthsInstance { } /** - * @notice Set a counter at a specific index in a EncodedLengths. + * @notice Set a counter at a specific index in EncodedLengths. * @dev Updates a value at a specific index and updates the accumulator field. * @param encodedLengths The encoded lengths to modify. * @param index The index to set. @@ -214,7 +214,7 @@ library EncodedLengthsInstance { } /** - * @notice Unwrap a EncodedLengths to its raw bytes32 representation. + * @notice Unwrap EncodedLengths to its raw bytes32 representation. * @param encodedLengths The encoded lengths to unwrap. * @return The raw bytes32 value of the EncodedLengths. */ diff --git a/packages/store/src/constants.sol b/packages/store/src/constants.sol index 25fd45d800..518dc152e0 100644 --- a/packages/store/src/constants.sol +++ b/packages/store/src/constants.sol @@ -22,7 +22,7 @@ uint256 constant MAX_TOTAL_FIELDS = 28; /// @dev Represents the maximum number of static fields in a FieldLayout. uint256 constant MAX_STATIC_FIELDS = 28; -/// @dev Represents the maximum number of dynamic fields that can be packed in a EncodedLengths. +/// @dev Represents the maximum number of dynamic fields that can be packed in EncodedLengths. uint256 constant MAX_DYNAMIC_FIELDS = 5; /**