-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Add RLP library #5680
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
Add RLP library #5680
Conversation
Co-authored-by: Hadrien Croubois <[email protected]>
Co-authored-by: Arr00 <[email protected]>
🦋 Changeset detectedLatest commit: 371595d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| // OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/ERC4626.sol) | ||
|
|
||
| pragma solidity ^0.8.20; | ||
| pragma solidity ^0.8.24; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're keeping it we should add it to the changelog. I did in 698221f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This imports memory, and memory needs 0.24 because it does mcopy
contracts/utils/RLP.sol
Outdated
| uint256 lengthLength = prefix - SHORT_OFFSET - SHORT_THRESHOLD; | ||
|
|
||
| require(itemLength > lengthLength, RLPInvalidDataRemainder(lengthLength, itemLength)); | ||
| require(bytes1(item.load(0)) != 0x00); // TODO: custom error for sanity checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe panic with RESOURCE_ERROR code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
|
The only thing left to discuss is the error to use in Once that's done I think the PR should be good. The main problem may be the coverage hit but we may be fine with that (?) |
|
Can't approve my own PR, but LGTM |
|
The |
Requires:
Memoryutility library #5189reverseBitsoperations to Bytes.sol #5724clz(bytes)andclz(uint256)functions #5725PR Checklist
npx changeset add)