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

BIP-X: Tractor (+ Junctions) #727

Merged
merged 621 commits into from
Apr 24, 2024
Merged

Conversation

funderbrker
Copy link
Contributor

@funderbrker funderbrker commented Dec 19, 2023

Tractor

Tractor is a system to give a third party operator permission to perform any Beanstalk action on behalf of the publisher.

Space-Bean and others added 30 commits December 12, 2023 20:45
@funderbrker
Copy link
Contributor Author

funderbrker commented Mar 20, 2024

Status

  • Operational and tested. All tests pass.
  • The underlying branch has changed, causing conflicts. Should not affect logic though.
  • SDK being implemented here [WIP] Tractor SDK #791
  • Needs internal review & audit

Copy link
Contributor

@Brean0 Brean0 left a comment

Choose a reason for hiding this comment

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

review I

protocol/contracts/libraries/LibOperatorPasteInstr.sol Outdated Show resolved Hide resolved
protocol/contracts/C.sol Show resolved Hide resolved
protocol/contracts/beanstalk/farm/TractorFacet.sol Outdated Show resolved Hide resolved
protocol/contracts/libraries/LibFarm.sol Show resolved Hide resolved
protocol/contracts/libraries/LibTractor.sol Outdated Show resolved Hide resolved
protocol/contracts/libraries/LibTractor.sol Show resolved Hide resolved
protocol/contracts/libraries/LibTractor.sol Show resolved Hide resolved
protocol/contracts/libraries/LibFunction.sol Outdated Show resolved Hide resolved
protocol/contracts/libraries/LibTractor.sol Show resolved Hide resolved
BLUEPRINT_TYPE_HASH,
blueprint.publisher,
keccak256(blueprint.data),
keccak256(abi.encodePacked(blueprint.operatorPasteInstrs)),
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason that this uses abi.encodePacked vs the regular abi.encode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

  1. encode each object
  2. concatenate all encoded data
  3. 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@funderbrker funderbrker changed the base branch from bip39-seedGauge to secure-beanstalk April 24, 2024 01:47
@funderbrker funderbrker merged commit 3855036 into secure-beanstalk Apr 24, 2024
1 check failed
@funderbrker funderbrker deleted the tractor-generalized branch April 24, 2024 03:13
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.

10 participants