Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document authorizeOrder_calldata_baseOffset more #59

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

MrToph
Copy link
Collaborator

@MrToph MrToph commented Mar 5, 2024

  • better reflect that authorizeOrder_calldata_baseOffset is relative to OrderFulfilled_offer_length_baseOffset. Matches the memory layout comment above it nicely.
  • removed part of a comment that was irrelevant?

@MrToph MrToph mentioned this pull request Mar 5, 2024
@0age 0age merged commit 602e1e4 into main Mar 5, 2024
4 checks passed
@0age 0age deleted the info-document-authorizeOrder_calldata_baseOffset branch March 5, 2024 17:14
uint256 constant authorizeOrder_calldata_baseOffset = 0x80; // 0x200 - 0x180
uint256 constant authorizeOrder_calldata_baseOffset = OrderFulfilled_offer_length_baseOffset - 0x180;
Copy link
Collaborator

@Saw-mon-and-Natalie Saw-mon-and-Natalie Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be nicer. But I think in general in this file, the authors have been just inling the final value and added comments on how that final value was derived.

cc: @0age

Comment on lines 336 to +337
* Note that the padded calldata selector will be at minimum at the
* 0x80 memory slot if no total original additional recipients were provided
* 0x80 memory slot.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should not be removed as it refers to the pointer to the padded call data selector and not just the base offset amount calculated here authorizeOrder_calldata_baseOffset.

This pointer will be at:

authorizeOrder_calldata_baseOffset + 0x20 * totalOriginalAdditionalRecipients

This note just warns that we would not enter the [0x00 - 0x80) region of the memory which is used by the compiler.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps can be made more elaborate.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hashing and event data memory region starts from 0x80 onwards.

Copy link
Collaborator Author

@MrToph MrToph Mar 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get it now, yes, of course we need to talk about absolute memory locations here. Makes sense, let's add it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants