Conversation
… the end, fix distribution tests
…lized-internal-hook-system
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…rg/protocol into generalized-internal-hook-system
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…rg/protocol into generalized-internal-hook-system
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…rg/protocol into generalized-internal-hook-system
…olvedSourceIsBean and _enforceWithdrawalPlanAndTip
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…nd fix minTwaDeltaB naming
…ot indexes directly
…g minHarvestAmount in struct
…' into pocikerim/mow-plant-harvest
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
7be5415 to
e40de23
Compare
…, referral system, and token hooks
- Add authorization check: caller must own the plots being combined - Cancel any existing pod listings before deleting combined plots - Remove permissionless access comment from natspec This prevents orphaned marketplace listings when plots are combined and ensures only the plot owner can trigger the combine operation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add vm.prank(farmers[0]) before combinePlots calls - Add test_combinePlotsUnauthorized to verify auth check Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Since caller must own the plots, derive account from LibTractor._user() instead of requiring it as a parameter. - Remove account parameter from combinePlots function signature - Update IMockFBeanstalk interface - Update tests to use new signature - Update error message to "Field: Plot not owned by caller" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
fix(field): require caller ownership and cancel listings on combinePlots
Add contract claimability analysis script
update L1 contract messenger and deployer addresses
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.
PI-15: Beanstalk Shipments
Summary
protocolUpdatefunction as a hook for the Beanstalk Silo Token, enabling Pinto to support internal balancesLinks
Problem
When Pinto launched, the protocol committed to honoring the obligations held by Beanstalk farmers (Silo deposits, Field pods, and Barn fertilizer). Specifically, after reaching 1 billion supply, Pinto would begin distributing 3% of newly minted Pinto to these obligations. Pinto currently does not have a mechanism to honor this commitment.
Solution
Beanstalk Shipments Overview
Deploy a comprehensive payback system that recreates Beanstalk Silo, Field, and Barn assets on Pinto. All assets are based on holder balances at the time of Pinto deployment (block 276160746 on Arbitrum). Once Pinto exceeds 1 billion supply, 3% of all newly minted Pinto will be distributed to these recreated assets.
Silo
Unripe holders receive a Beanstalk Silo ERC20 token representing their claim to Pinto yield. Tokens are credited 1:1 to Unripe BDV, calculated as if Beanstalk was fully recapitalized:
When Pinto is distributed to the Silo, farmers receive a share proportional to their percentage ownership of Beanstalk Silo Tokens.
Field
The Beanstalk Pod Line is recreated on Pinto as a new Field (Field ID 1). Beanstalk Pod holders receive all Plots they owned, with identical Place in Line and amounts.
Distribution follows the same FIFO mechanism as the existing Pinto Field: Pods are harvestable based on their Place in Line.
Barn
Fertilizer holders receive an ERC-1155 Fertilizer Token equal to their Beanstalk Fertilizer balance at Pinto launch.
Asset Distribution
Assets are distributed based on the recipient address type:
Smart Contracts that may be susceptible to frontrun deployments must submit a claim transaction on L1 to delegate an address to receive their assets on L2.
Token Hook System
Certain ERC20s execute additional logic ("hooks") during transfers. The Beanstalk Silo Token includes a hook that claims yield to the sender upon transfer. However, Farm-to-Farm transfers do not trigger standard ERC20 transfers (tokens remain within Pinto), so this hook would not execute, causing potential yield loss.
To support the Beanstalk Silo Token in the Farm system, a permissioned hook system is implemented. Farm-to-Farm transfers call an external function to replicate standard ERC20 transfer behavior.
Economic Rationale
Technical Rationale
While a permissionless hook system would support all ERC20s, the permissioned approach is necessary to prevent system exploitation.
Previously, shipment distribution logic was deployed in an external contract. This upgrade moves it into a facet to reduce developer overhead and minimize external deployments.
Appendix
Deployment Execution
The Beanstalk Shipments upgrade requires multiple transactions to fully execute:
Pre-DiamondCut Setup:
L1ContractMessenger- enables smart contracts to claim Beanstalk assets on PintoSiloPayback(ERC-20),BarnPayback(ERC-1155), andContractPaybackDistributorContractPaybackDistributorto credit smart contracts with their entitled assetsDiamondCut 1:
TempRepaymentFieldFacetto instantiate the Beanstalk Field (Field ID 1)DiamondCut 2:
TempRepaymentFieldFacetPinto does not need to be paused during deployment.
Risk Assumptions
The Pinto engineering team assumes that Pinto supply will not exceed 1 billion while the Beanstalk Shipments deployment is in progress.
Contract Changes
External Contracts Deployed