FeedProjects
Developers
Settings
🎉 A new chapter begins: Boardroom has joined Agora
Learn more
protocol logo
Explore / Projects
Beanstalk DAO

Proposals

Members

Information

Create Proposal

Beanstalk DAO

ProposalsMembersInformation
Proposal
Back to Proposals
closedEnded 3 years ago · Snapshot (Offchain)

BIP-30: Generalized Pipeline and ERC-20 and ERC-721 Permit Support

By 0x47a4...Ad6888

Proposer

Beanstalk Farms

Proposer Wallet: 0xB77c0dBA1186483E9cc284a950564Fe886c12dB8

Summary

  • Implement a version of Clipboard in the farm function such that Farmers can copy return values from any function call into the function calldata of subsequent functions;
  • Wrap Pipeline functionality in Depot V2 such that Farmers can access Pipeline through the use of the farm function;
  • Add EIP-2612 permit support for ERC-20 tokens and EIP-4494 permit support ERC-721 tokens in Circulating balances; and
  • Reduce the base sunrise incentive reward.

Links

  • BIP-30 GitHub PR
  • GitHub Commit Hash: 9029875262f83cf394b0ed048704133e16e969d4
  • Pipeline Whitepaper
  • Safe Transaction

Problem

The farm function allows Farmers to perform a series of function calls in a single transaction defined by static calldata. Static calldata is limiting as on-chain outputs can change between transaction creation and settlement.

Currently, adding Pipeline functionality requires new Pipelines to be added to the Depot via Beanstalk governance, which results in very high development overhead for enabling Farmers to use other protocols through Beanstalk.

Farmers have to approve transfers of ERC-20 and ERC-721 tokens in their Circulating balance through a separate transaction, which creates a suboptimal user experience.

Beanstalk is currently overpaying for the sunrise incentive reward due to the high base incentive.

Proposed Solution

Clipboard

We propose upgrading the Farm Facet to support Clipboard functionality from Pipeline, allowing Farmers to copy return values from any function call into the function calldata of subsequent functions.

Specification

AdvancedFarmCall is a farm call that can use a version of Clipboard. With Clipboard, Farmers can copy return values stored as returnData from any AdvancedFarmCalls already executed and paste them into the callData of the next AdvancedFarmCall, in a customizable manner.

Each AdvancedPipeCall includes a version of Clipboard to encode:

  1. How many paste operations to perform;
  2. Which returnData from previous AdvancedFarmCalls to copy (i.e., returnDataIndex);
  3. Where to copy from within (2) (i.e., copyIndex); and
  4. Where to paste it in the callData of the next AdvancedFarmCall (i.e., pasteIndex).

Bytes are pasted 32 bytes at a time.

The only difference between the Clipboard implemented on the Farm and the one implemented in Pipeline is that the Farm version always uses padding in the second byte, whereas the Pipeline version includes a Use Ether Flag in the second byte, which specifies whether to include Ether in the Clipboard. Because the farm call already is able to include Ether, the second byte does not need to be used in the Farm version of Clipboard.

Depot V2

We propose adding new Depot Facet that wraps the standalone Pipeline contract, providing access to Pipeline from Beanstalk through the use of the farm function.

ERC-20 and ERC-721 Token Permits

We propose adding EIP-2612 support for ERC-20 tokens and EIP-4494 support for ERC-721 tokens from Circulating balances, which allows Farmers to perform approvals through permits without the need for a separate transaction.

Sunrise Incentive Adjustment

We propose reducing the base sunrise incentive from 100 Beans to 25 Beans such that the new formula for a_t is:

at-formula.png

Technical Rationale

Allowing Farmers to copy return values from any function call into the function calldata of subsequent functions significantly improves the composability supported by the farm function.

A new Depot that allows Farmers to access the standalone Pipeline contract from Beanstalk significantly reduces the development time necessary to enable Farmers to interact with new protocols via Beanstalk.

The ability for Farmers to approve transfers of ERC-20 and ERC-721 tokens in their Circulating balance without the need for a separate transaction reduces the friction of interacting with Beanstalk.

The majority of the transaction fee from sunrise calls is the priority fee. Until a more sophisticated update to the sunrise function has been audited, reducing the base reward is likely to reduce the Beans Beanstalk issues each month to pay for the sunrise call by up to 75%.

Economic Rationale

Improving the composability of, and reducing the number of separate transactions required to interact with, Beanstalk should improve the user experience and utility of Beanstalk and Beans.

Reducing unnecessary Bean issuance in the sunrise incentive reward can reduce sell pressure on Beans by 60,000 per month.

Contract Changes

The Δ symbol indicates that there is a proposed change in functionality.

FarmFacet

The following FarmFacet is being removed from Beanstalk:

  • 0x6039c602b730f44f418145454a2d954133cbd394

The following FarmFacet is being added to Beanstalk:

  • 0x855D37a6C3868Aa4e8F2e1a80965D08B3f10d292

FarmFacet Function Changes

NameSelectorActionTypeΔ
advancedFarm0x36bfafbdAddCall✓
farm0x300dd6cfReplaceCall✓

FarmFacet Event Changes

None.

DepotFacet

The following DepotFacet is being added to Beanstalk:

  • 0xD812fDfB45BC4D05884Eb270f7DdFaac71D60F78

DepotFacet Function Changes

NameSelectorActionTypeΔ
pipe0x08e1a0abAddCall✓
multiPipe0xcabec62bAddCall✓
advancedPipe0xb452c7aeAddCall✓
etherPipe0x6e47d07bAddCall✓
readPipe0xdd756c4fAddView✓

DepotFacet Event Changes

None.

TokenSupportFacet

The following TokenSupportFacet is being added to Beanstalk:

  • 0x5e15667Bf3EEeE15889F7A2D1BB423490afCb527

TokenSupportFacet Function Changes

NameSelectorActionTypeΔ
permitERC200xb442b398AddCall✓
transferERC7210x1aca6376AddCall✓
permitERC7210x4935ed43AddCall✓
transferERC11550x0a7e880cAddCall✓
batchTransferERC11550xa9412a59AddCall✓

TokenSupportFacet Event Changes

None.

SeasonFacet

The following SeasonFacet is being removed from Beanstalk:

  • 0x83d6e6b446613c9bfaebc64260962bc4f828a3ac

The following SeasonFacet is being added to Beanstalk:

  • 0x0cEFF1129091A0ffa97cC58d4D160F9676866a24

SeasonFacet Function Changes

NameSelectorActionTypeΔ
sunrise0xfc06d2a6ReplaceCall
paused0x5c975abbReplaceView
plentyPerRoot0xe60d7a83ReplaceView
poolDeltaB0x471bcdbeReplaceView
rain0x43def26eReplaceView
season0xc50b0fb0ReplaceView
seasonTime0xca7b7d7bReplaceView
time0x16ada547ReplaceView
totalDeltaB0x06c499d8ReplaceView
weather0x686b6159ReplaceView
yield0x28593984ReplaceView

SeasonFacet Event Changes

None.

Beans Minted

None.

Audit

The commit hash of this BIP is 9029875262f83cf394b0ed048704133e16e969d4.

Halborn has performed an audit of this BIP up until the commit hash that reduces the base sunrise incentive reward. You can view the Halborn audit report of this commit hash on Arweave here:

  • 12/01/22 BIP-30 Halborn Report

Effective

Effective immediately upon commit.

Continue Reading
Connect Wallet to Add Note
0
Votes 233
VoterCast PowerVote & Rationale
0x10bf...DCC0e4
2.636M

For

0xfb45...e7A1f7
1.955M

For

0x9F79...A5F2FE
1.825M

For

0x87C9...6ac29e
1.477M

For

0xC385...1eB20E
1.41M

For

SHOW MORE
VOTE POWER
0
Connect Wallet
Proposal Status
  • Thu December 01 2022, 08:00 pmVoting Period Starts
  • Thu December 08 2022, 08:00 pmEnd Voting Period
Current Results

1-For

37.397M

99.99%

2-Abstain

3,664.584

0.01%
DocumentationBrandingContact Us
Home
This Project is Currently Disabled

If you would like to enable it, please checkout below.

Boardroom Subscription

Sign up for an individual subscription (access all projects on the platform)

Subscribe
Enable Project

Enable the entire project for every user

Enable Project
Contact Us