Conversation
🤖 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>
…otocol into mow-plant-harvest-blueprint
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…otocol into mow-plant-harvest-blueprint
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…ast TokenHook references
🤖 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>
Generalized Internal Token Hook System
Add Shared Blueprint Components into Abstract `BlueprintBase`.
🤖 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>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Add tests for delegation griefing attack prevention
Add RPC error resilience for beanstalk shipments
When multiple converts occurred in the same block, the convert capacity tracking was double-counting usage because calculateConvertCapacityPenalty() returned cumulative values that applyStalkPenalty() added to storage again. Changes: - calculateConvertCapacityPenalty() now returns delta values instead of cumulative - calculatePerWellCapacity() now returns delta values and removes unused parameter - Added NatSpec documentation for pdCapacity return value - Added tests verifying sequential converts consume linear capacity Before fix: storage = old + (old + delta) = 2*old + delta After fix: storage = old + delta 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>
- Refactor deployPaybackContracts to deploy only (no initialization) - Add address cache utility to persist deployed addresses - Create separate initialization tasks: - initializeSiloPayback (Step 1.5) - initializeBarnPayback (Step 1.6) - initializeContractPaybackDistributor (Step 1.7) - Add 'deploy' and 'init' keywords to orchestrator - Add 100ms delay between chunks to avoid rate limiting - Update error messages to use consistent --start-chunk flag Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ization Frijo/separate payback initialization
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…talk contract account
…/protocol into frijo/release/PI-15
…or plot initialization
…from base network config
Changed variable names in the convert capacity call chain to better reflect that they now represent delta values (incremental amounts) rather than cumulative totals after the double-counting fix: - overallConvertCapacityUsed → overallCapacityDelta - inputTokenAmountUsed → inputTokenCapacityDelta - outputTokenAmountUsed → outputTokenCapacityDelta This addresses the naming confusion identified in code review where variables suggested cumulative semantics but actually contained deltas. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: frijo <fr1jo@users.noreply.github.com>
…ble-count Fix convert capacity double-counting bug
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