Skip to content

PI-15: Beanstalk Shipments#175

Open
fr1jo wants to merge 321 commits intomasterfrom
frijo/release/PI-15
Open

PI-15: Beanstalk Shipments#175
fr1jo wants to merge 321 commits intomasterfrom
frijo/release/PI-15

Conversation

@fr1jo
Copy link
Contributor

@fr1jo fr1jo commented Jan 22, 2026

PI-15: Beanstalk Shipments

Summary

  • Deploy Beanstalk Shipments system to honor Pinto's commitment to repay Beanstalk holders (Silo, Field, Barn) after 1 billion supply
  • Initialize Beanstalk components with holder data captured at Pinto launch (block 276160746 on Arbitrum)
  • Upgrade Shipments (Pinto's distribution mechanism) to distribute 3% of newly issued Pinto to Beanstalk holders after the protocol exceeds 1 billion supply
  • Add Token Hook infrastructure to enable pre-transfer callbacks for internal Farm balance transfers
  • Whitelist the protocolUpdate function as a hook for the Beanstalk Silo Token, enabling Pinto to support internal balances

Links

  • PI-15 GitHub PR
  • [Safe Transaction](TBD - add after proposal)
  • [BaseScan Transaction](TBD - add after execution)

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:

  • Unripe Bean holders: BDV calculated 1:1 to the amount of urBean held
  • Unripe LP holders: BDV calculated using the BEAN:WSTETH pool exchange rate (the underlying pool of the Unripe token) at Pinto deployment

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:

Recipient Type Distribution Method
EOAs (Externally Owned Accounts) Automatic airdrop
Smart Wallets (EIP-4337) Automatic airdrop
Smart Contracts with cross-chain deployable addresses Automatic airdrop
Other Smart Contracts Manual claim required via L1 delegation

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

  • Fulfills Pinto's founding commitment to Beanstalk holders, maintaining protocol credibility
  • Gradual distribution (percentage of new supply) ensures sustainable payback over time
  • 3% allocation to payback routes balances obligation fulfillment with ongoing protocol needs

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:

  1. Deploy L1ContractMessenger - enables smart contracts to claim Beanstalk assets on Pinto
  2. Deploy SiloPayback (ERC-20), BarnPayback (ERC-1155), and ContractPaybackDistributor
  3. Mint Beanstalk Silo Tokens and Fertilizer Tokens based on holder snapshots
  4. Configure ContractPaybackDistributor to credit smart contracts with their entitled assets
  5. Verify all data is properly initialized

DiamondCut 1:

  • Add TempRepaymentFieldFacet to instantiate the Beanstalk Field (Field ID 1)
  • Engineering team verifies Field initialization

DiamondCut 2:

  • Remove TempRepaymentFieldFacet
  • Update Pinto distribution to include Beanstalk Shipments routes

Pinto 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

Facet New Upgraded FacetAddress Previous Deprecated FacetAddress
TokenHookFacet TBD - after deployment NEW - No previous address
ShipmentPlannerFacet TBD - after deployment NEW - No previous address
FieldFacet TBD - after deployment 0xae94197E16B31443fE1C333A32eDa30eb3c1A942
TokenFacet TBD - after deployment 0xd29e38e4a803Feac3503Fd7402181BbA79d3D3F0
TractorFacet TBD - after deployment 0xC8706ff2A0dA6B3367AA506dCBb608cCF96148DE
MarketplaceBatchFacet TBD - after deployment 0x40E42F3D568FAf47C539A7D2A61E24629819baD4
ClaimFacet TBD - after deployment 0xfc4499F812014BEBAF9686Ce0312a77ccA65137a
SiloFacet TBD - after deployment 0x8646649c0f80db8665358f4548AE0d1ecC3910a5
SeasonFacet TBD - after deployment 0x4AeEE50B11C3682605dCeCA1FeACd96349383cd2

External Contracts Deployed

Contract Address Description
SiloPayback TBD ERC20 token for Silo payback
BarnPayback TBD ERC-1155 Fertilizer for Barn payback
ContractPaybackDistributor TBD Holds assets for smart contract recipients
L1ContractMessenger TBD L1 messenger for smart contract claim delegation

default-juice and others added 30 commits August 27, 2025 12:07
🤖 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
pocikerim and others added 11 commits December 24, 2025 15:02
…olvedSourceIsBean and _enforceWithdrawalPlanAndTip
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 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>
@pocikerim pocikerim force-pushed the frijo/release/PI-15 branch from 7be5415 to e40de23 Compare January 26, 2026 10:08
fr1jo and others added 14 commits January 26, 2026 13:43
- 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
@fr1jo fr1jo changed the title Release PI-15: Beanstalk Shipments & Mow-Plant-Harvest Blueprint PI-15: Beanstalk Shipments Feb 5, 2026
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.

5 participants