BIP-X: Tractor (+ Junctions) - #727
Merged
Merged
Conversation
…eld-and-housekeeping
Contributor
Author
Status
|
…eanstalk into tractor-generalized
…Beanstalk into tractor-generalized
Brean0
reviewed
Mar 28, 2024
| BLUEPRINT_TYPE_HASH, | ||
| blueprint.publisher, | ||
| keccak256(blueprint.data), | ||
| keccak256(abi.encodePacked(blueprint.operatorPasteInstrs)), |
Contributor
There was a problem hiding this comment.
is there a reason that this uses abi.encodePacked vs the regular abi.encode?
Contributor
Author
There was a problem hiding this comment.
great question
it's an inline way for adhering to the eip712 spec
the correct way to pack a list of objects in eip712 is to
- encode each object
- concatenate all encoded data
- hash the concatenation
here each object is a bytes32 so it is already 'encoded', so the encodePacked directly concatenates them all without extraneous bytes. then they are hashed.
Contributor
Author
There was a problem hiding this comment.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tractor
Tractor is a system to give a third party operator permission to perform any Beanstalk action on behalf of the publisher.