Skip to content

BIP-X: Tractor (+ Junctions) - #727

Merged
funderbrker merged 621 commits into
secure-beanstalkfrom
tractor-generalized
Apr 24, 2024
Merged

BIP-X: Tractor (+ Junctions)#727
funderbrker merged 621 commits into
secure-beanstalkfrom
tractor-generalized

Conversation

@funderbrker

@funderbrker funderbrker commented Dec 19, 2023

Copy link
Copy Markdown
Contributor

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

funderbrker commented Mar 20, 2024

Copy link
Copy Markdown
Contributor Author

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

@Brean0 Brean0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

review I

Comment thread protocol/contracts/libraries/LibOperatorPasteInstr.sol Outdated
Comment thread protocol/contracts/C.sol
Comment thread protocol/contracts/beanstalk/farm/TractorFacet.sol Outdated
Comment thread protocol/contracts/libraries/LibFarm.sol
Comment thread protocol/contracts/libraries/LibTractor.sol Outdated
Comment thread protocol/contracts/libraries/LibTractor.sol
Comment thread protocol/contracts/libraries/LibTractor.sol
Comment thread protocol/contracts/libraries/LibFunction.sol Outdated
Comment thread protocol/contracts/libraries/LibTractor.sol
BLUEPRINT_TYPE_HASH,
blueprint.publisher,
keccak256(blueprint.data),
keccak256(abi.encodePacked(blueprint.operatorPasteInstrs)),

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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