Note that this page has not been updated to reflect the current state of Beanstalk, but is left here as a reference.
The Field is Beanstalk's credit facility. Beanstalk relies on a decentralized set of creditors to maintain Bean price stability.
Anytime Beanstalk is willing to issue debt, there is Soil in the Field. Soil represents the number of Beans that Beanstalk is currently willing to borrow.
Anytime there is Soil in the Field, Farmers can Sow Beans in exchange for Pods. Pods are stored in Plots and placed at the end of the Pod Line.
Pods become Harvestable on a First In, First Out (FIFO) basis when deltaB > 0
over the course of a Season. Assuming there are Unharvestable Pods and Unfertilized Beans, 1/3 of Bean mints turn Pods into Harvestable Pods, which can be Harvested (redeemed) for Beans via the harvest()
function. When a Plot is Harvested, it is deleted from storage.
Pods are implemented using 3 indices:
podIndex
-> The total number of Pods ever created.
harvestableIndex
-> The total number of Pods that ever became Harvestable.
harvestedIndex
-> The total number of Pods ever Harvested.
When Beans are Sown, a Plot is created at the current podIndex
with beans * (1 + weather)
. Pods and podIndex
are incremented by the number of Pods.
When Pods become Harvestable, harvestableIndex
is incremented by the number of newly Harvestable Pods. Plots are Harvestable if the index of a Plot is less than harvestableIndex
. Plots can be partially Harvested, in which case Beanstalk deletes the first part of the Plot and creates a new Plot at the harvestableIndex
. When a Plot is Harvested, the harvestedIndex
increases by the number of Harvested Pods.
Fundraisers allow Beanstalk to raise non-Bean stablecoins to pay for services on behalf of the protocol, such as audits. Fundraisers can be created through the createFundraiser()
function by Beanstalk or the owner of the contract.
Each Fundraiser requires:
The token address of the non-Bean token being raised;
The amount of tokens being raised; and
The address to send the tokens to upon completion of the Fundraiser.
Farmers fund()
Fundraisers by transferring the non-Bean stablecoin to Beanstalk and in exchange receive Pods at the current Weather at the end of the Pod Line. Funding is akin to Sowing, but instead of burning Beans, Beanstalk is raising a non-Bean stable coin.
Once all of the Funds have been raised, the tokens are transferred to the payee address stored in the Fundraiser.
You can find links to past BIPs that created Fundraisers here.
Note that this page has not been updated to reflect the current state of Beanstalk, but is left here as a reference.
The Fundraiser Facet dandles the creation, funding, and completion of Fundraisers.
Fund a Fundraiser in exchange for Pods.
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Creates a Fundraiser. Can only be called by the owner of Beanstalk.
Returns the remaining number of tokens to raise.
Returns the total amount of tokens raised so far.
Returns the address of the token that can be sent to the Fundraiser.
Returns the Fundraiser struct.
Returns the number of Fundraisers.
Emitted when a Fundraiser is created.
Emitted when a Farmer calls fund
.
Emitted when a Fundraiser is fully funded.
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
id
uint32
The Fundraiser ID.
amount
uint256
Amount of fundraisers[id].token
to provide.
mode
From
Balance to spend tokens from; see LibTransfer.From
.
uint256
The number of Pods received.
payee
address
The address to which funds are delivered at the end of the Fundraiser.
token
address
The address of the token that can be sent to the Fundraiser in exchange for Pods.
amount
uint256
The amount of token
that is being raised.
id
uint32
The Fundraiser ID.
uint256
The remaining number of tokens to raise.
id
uint32
The Fundraiser ID.
uint256
The total amount of tokens raised so far.
id
uint32
The Fundraiser ID.
address
The address of the token that can be sent to the Fundraiser.
id
uint32
The Fundraiser ID.
Fundraiser
Returns the Fundraiser struct in App Storage.
uint32
The number of Fundraisers.
id
uint32
The Fundraiser ID.
fundraiser
address
The address to which funds are delivered.
token
address
The address of the token that can be sent to the Fundraiser in exchange for Pods.
amount
uint256
The amount of token
that is being raised.
account
address
The address of the Farmer.
id
uint32
The Fundraiser ID.
amount
uint256
The amount of token
that account
provided.
id
uint32
The Fundraiser ID.
Note that this page has not been updated to reflect the current state of Beanstalk, but is left here as a reference.
The Field Facet is where Beans are Sown.
Sow Beans in exchange for Pods.
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Sow Beans in exchange for Pods. Use at least minSoil
.
Harvest Pods from the Field.
Returns the total number of Pods ever minted.
Returns the index below which Pods are Harvestable.
Returns the number of outstanding Pods. Includes Pods that are currently Harvestable but have not yet been Harvested.
Returns the number of Pods that have ever been Harvested.
Returns the number of Pods that are currently Harvestable but have not yet been Harvested.
Returns the number of Pods that are not yet Harvestable.
Returns the number of Pods remaining in a Plot.
Returns the total available Soil.
Returns the current yield (aka "Temperature") offered by Beanstalk when burning Beans in exchange for Pods.
Returns the current Temperature, the interest rate offered by Beanstalk in exchange for Sowing Beans.
Returns the Maximum Temperature that Beanstalk is willing to offer this Season.
Returns the remaining Pods that could be issued this Season.
Emitted from LibDibbler.sowNoSoil
when an account
creates a Plot. A Plot is a set of Pods created in from a single sow
or fund
call.
Emitted when account
claims the Beans associated with Harvestable Pods.
Emitted when a Pod Listing is Cancelled.
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Value | Description |
---|---|
Return Type | Description |
---|---|
Return Value | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
beans
uint256
The number of Beans to Sow.
minTemperature
uint256
The minimum Temperature at which to Sow.
mode
From
The balance to transfer Beans from; see LibTransfer.From
.
pods
uint256
The number of Pods received.
beans
uint256
The number of Beans to Sow.
minTemperature
uint256
The minimum Temperature at which to Sow.
minSoil
uint256
The minimum amount of Soil to use; reverts if there is less than this much Soil available upon execution.
mode
From
The balance to transfer Beans from; see LibTransfer.From
.
pods
uint256
The number of Pods received.
plots
uint256[]
List of Plot IDs to Harvest.
mode
To
The balance to transfer Beans to; see LibTransfer.To
.
uint256
The total number of Pods ever minted.
uint256
The index below which Pods are Harvestable.
uint256
The number of outstanding Pods.
uint256
The number of Pods that have ever been Harvested.
uint256
The number of Pods that are currently Harvestable but have not yet been Harvested.
uint256
The number of Pods that are not yet Harvestable.
account
address
The account that owns a Plot.
index
uint256
The ID of a Plot.
uint256
The number of Pods remaining in a Plot.
uint256
The total available Soil.
uint32
The current yield offered by Beanstalk when burning Beans in exchange for Pods.
uint256
The current Temperature.
uint256
The Maximum Temperature.
uint256
The remaining Pods that could be issued this Season.
account
address
The account that Sowed Beans for Pods.
index
uint256
The Place in Line of the Plot.
beans
uint256
The amount of Beans burnt to create the Plot.
pods
uint256
The amount of Pods associated with the created Plot.
account
address
The account that owns the plots
.
plots
uint256[]
The indices of Plots that were Harvested.
beans
uint256
The amount of Beans transferred to account
.
account
address
The account that created the Pod Listing.
index
uint256
The index of the Plot listed.