Skip to content

Conversation

@default-juice
Copy link
Contributor

@default-juice default-juice commented Aug 31, 2025

PI-12: Beanstalk shipments

Summary

  • Implements the mechanism and infrastructure necessary for Pinto to honor Beanstalk's debt for the Field, Barn and Silo.
  • Deploys, distributes and initializes the repayment assets represented as:
  1. A new repayment field, replicating the Beanstalk Field
  2. An ERC-20 representing Unripe BDV which accrues yield in (SiloPayback.sol)
  3. An ERC-1155 representing Fertilizer that uses the same mechanism as Beanstalk Fertilizer (BarnPayback.sol)
    (All assets start to accrue 3% of new Pinto Supply after the 1 billion supply threshold is reached.)
  • Updates the ShipmentPlanner external contract to properly account for the newly created Payback contracts
  • Implements the contracts necessary for Beanstalk contract accounts to claim their repayment assets on Base. For a full guide on how to do this see here.
  • Adds a Generalized Token Hook System for transfers involving Internal Balances and whitelists the SiloPayback hook that keeps reward accounting for Unripe tokens intact. ( See Generalized Internal Token Hook System #138 )
  • Performs all the parsing, filtering, testing and initialization necessary to distribute all the assets to the correct accounts.

Links

Problem

Pinto honors Beanstalk’s debt by allocating 3% of all future supply issued beyond the first 1 billion to former Beanstalk participants, distributed proportionally based on their holdings at the time of a snapshot taken at Pinto’s deployment. To accomodate this, Pinto's core contracts will need to be upgraded. For more information on the repayment see the official documentation here.

Solution

  • Created SiloPayback , a contract acting both as an ERC20 token representation of Beanstalk BDV and as a staking contract that allows old silo holders to claim Pinto yield.
  • Created BarnPayback, an ERC1155 with the same implementation as the beanstalk fertilizer but with state also contained within it that allows for gradual repayment based on the id of each token identical to the Beanstalk Fertilizer
  • Created TempRepaymentFieldFacet, that will allow an EOA to initialize the state of the repayment field so that the PCM does not have to sign more than one transaction.
  • Modified the ShipmentPlanner to differentiate between silo and barn payback contracts and account for repayment of any component.
  • Added 2 new shipment routes to account for the silo and barn payback and refreshed old routes to call the new ShipmentPlanner
  • Added 2 new Recipients for silo and barn that send the newly minted Pinto to the corresponding contracts and also call external functions on them to update their state every time they receive yield.
  • Created the ContractPaybackDistributor that will custody the assets of the contract accounts until they are claimed directly or from the L1.
  • Created the L1ContractMessenger that will enable L1 beanstalk contract accounts that are unable to claim any other way to claim from Ethereum L1 by sending a cross chain message.
  • Created parsers for the data exports and scripts to distribute all the repayment assets to their recipients.
  • Created tasks to perform actions to deploy and initialize the shipments according to the initialization timeline.

Rationale

Add rationale

Contract Changes

The following Facets were upgraded with new functionality:

TempRepaymentFieldFacet (Added and later Removed)

Added: 0x046c76Aee5D109fBa8708ee58a50d76EEa1f98dC

TempRepaymentFieldFacet Function Changes

Name Selector Action Type New Functionality
REPAYMENT_FIELD_ID 0x31f2cd56 Add Read
REPAYMENT_FIELD_POPULATOR 0x49e40d6c Add Read
initializeReplaymentPlots 0x0b678c09 Add Write

SeasonFacet

Added: 0x046c76Aee5D109fBa8708ee58a50d76EEa1f98dC

SeasonFacet Function Changes

  • All selectors are replaced

default-juice and others added 30 commits July 31, 2025 14:54
default-juice and others added 23 commits September 29, 2025 13:13
🤖 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>
@fr1jo fr1jo changed the title PI-X: Beanstalk shipments PI-15: Beanstalk shipments Jan 20, 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