From b4ebaeeb1ecd8f894cfabcd5bc5882fdf5b3cfb4 Mon Sep 17 00:00:00 2001 From: 0age <0age@protonmail.com> Date: Mon, 4 Mar 2024 16:14:35 -0500 Subject: [PATCH 1/2] clarify a named constant --- src/core/lib/ConsiderationDecoder.sol | 7 +++++-- src/types/lib/ConsiderationConstants.sol | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/lib/ConsiderationDecoder.sol b/src/core/lib/ConsiderationDecoder.sol index 5655205..0c493b7 100644 --- a/src/core/lib/ConsiderationDecoder.sol +++ b/src/core/lib/ConsiderationDecoder.sol @@ -26,7 +26,7 @@ import { Common_identifier_offset, Common_token_offset, ConsiderationItem_recipient_offset, - ConsiderationItem_size_with_length, + ConsiderationItem_size_with_head_pointer, ConsiderationItem_size, CriteriaResolver_criteriaProof_offset, CriteriaResolver_fixed_segment_0, @@ -1117,7 +1117,10 @@ contract ConsiderationDecoder { mPtrLength, add( OneWord, - mul(newLength, ConsiderationItem_size_with_length) + mul( + newLength, + ConsiderationItem_size_with_head_pointer + ) ) ) ) diff --git a/src/types/lib/ConsiderationConstants.sol b/src/types/lib/ConsiderationConstants.sol index 3b6c312..0e0fce3 100644 --- a/src/types/lib/ConsiderationConstants.sol +++ b/src/types/lib/ConsiderationConstants.sol @@ -96,7 +96,7 @@ uint256 constant ReceivedItem_recipient_offset = 0x80; uint256 constant ReceivedItem_CommonParams_size = 0x60; uint256 constant ConsiderationItem_size = 0xc0; -uint256 constant ConsiderationItem_size_with_length = 0xe0; +uint256 constant ConsiderationItem_size_with_head_pointer = 0xe0; uint256 constant ConsiderationItem_recipient_offset = 0xa0; // Store the same constant in an abbreviated format for a line length fix. From 8dcbf00e94229e378e7970537c0c94495b2c1298 Mon Sep 17 00:00:00 2001 From: 0age <0age@protonmail.com> Date: Mon, 4 Mar 2024 16:18:34 -0500 Subject: [PATCH 2/2] fix some comments in FulfillmentApplier --- src/core/lib/FulfillmentApplier.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lib/FulfillmentApplier.sol b/src/core/lib/FulfillmentApplier.sol index 3e30733..405e230 100644 --- a/src/core/lib/FulfillmentApplier.sol +++ b/src/core/lib/FulfillmentApplier.sol @@ -326,7 +326,7 @@ contract FulfillmentApplier is FulfillmentApplicationErrors { // Create variable to track position in offerComponents head. let fulfillmentHeadPtr := offerComponents - // Get position one word past last element in head of array. + // Get position of the last element in head of array. let endPtr := add( offerComponents, shl(OneWordShift, mload(offerComponents)) @@ -589,7 +589,7 @@ contract FulfillmentApplier is FulfillmentApplicationErrors { // Track position in considerationComponents head. let fulfillmentHeadPtr := considerationComponents - // Get position one word past last element in head of array. + // Get position of the last element in head of array. let endPtr := add( considerationComponents,