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

[nit] bytecode comment fixes #16

Merged
merged 2 commits into from
Jun 24, 2023
Merged

[nit] bytecode comment fixes #16

merged 2 commits into from
Jun 24, 2023

Conversation

zobront
Copy link
Contributor

@zobront zobront commented Jun 23, 2023

Some of the bytecode comments in ClonesWithImmutableArgs.sol appear to be incorrect.

Specifically:

  • when the extra data is copied into memory, it spans [cds, cds+extraData), not [cds, cds+0x37)
  • when preparing for the delegatecall, cds+extra is the argSize, not cds

// 61 extra | PUSH2 extra | extra cds 0 0 0 0 | [0, cds) = calldata, [cds, cds+0x37) = extraData
// 60 0x37 | PUSH1 0x37 | 0x37 extra 0 0 0 0 | [0, cds) = calldata // 0x37 (55) is runtime size - data
// 36 | CALLDATASIZE | cds 0x37 extra 0 0 0 0 | [0, cds) = calldata
// 39 | CODECOPY | 0 0 0 0 | [0, cds) = calldata, [cds, cds+extraData) = extraData
Copy link
Owner

Choose a reason for hiding this comment

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

[0, cds) = calldata, [cds, cds+extra) = extraData would be more accurate

cds+extra instead of cds+extraData

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@wighawag wighawag merged commit 32ae0a3 into wighawag:master Jun 24, 2023
1 check passed
@wighawag
Copy link
Owner

Thanks @zobront !

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.

2 participants