Conceptually Tractor is similar to Farm with additional functionality. Farm contains just multisig functionaluty to execute a bunch of delegate calls to Beanstalk. Tractor offers the same functionality, and allows to make calls on behalf of another user, i.e. adds authentification to those calls.
FarmFacet uses modifier withEth
to not refund ETH in the middle of the batch:
https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/df2dd129a878d16d4adc75049179ac0029d9a96b/protocol/contracts/libraries/Token/LibEth.sol#L14-L22
https://github.com/Cyfrin/2024-05-beanstalk-the-finale/blob/df2dd129a878d16d4adc75049179ac0029d9a96b/protocol/contracts/beanstalk/farm/FarmFacet.sol#L53-L62
Problem is that such modifier is missing in TractorFacet.tractor()
. It means Eth will be refunded in the middle of the batch, so problems arise when batch contains multiple functions using ETH balance.
Functions containing refund logic work incorrectly. They refund ETH immediately as such function is executed, instead of making it in the end of a batch.
Tractor module works incorrectly with following functions:
DepotFacet.advancedPipe()
DepotFacet.etherPipe()
TokenFacet.wrapEth()
Manual Review
Add modifier FarmFacet.withEth
to function TractorFacet.tractor()
.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.