Skip to content

Commit

Permalink
small docs tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Mar 21, 2024
1 parent 906bb57 commit f33f57e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/pages/store/reference/misc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/schema-type/src/typescript/dynamicAbiTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
36 changes: 18 additions & 18 deletions packages/store/src/EncodedLengths.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
*/
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/store/src/constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down

0 comments on commit f33f57e

Please sign in to comment.