Silo Facet
The Silo Facet handles Depositing, Withdrawing, and transferring Deposits (whitelisted assets in the Silo).
Stems keep track of when the Deposit was created. When the Deposit was created determines how much Grown Stalk per BDV the Deposit has.
Call Functions
Deposits ERC20 token into internal Farmer balances.
Parameter | Type | Description |
---|---|---|
|
| Address of the token to Deposit. |
|
| Amount of the token to be Deposited. |
|
| The balance to transfer the token from; see |
Return value | Type | Description |
---|---|---|
|
| Amount of the token Deposited. |
|
| BDV of the Deposit. |
|
| Stem of the Deposit. |
Withdraws a single Deposit.
Parameter | Type | Description |
---|---|---|
|
| Address of ERC20 being Withdrawn. |
|
| Stem of the Deposit to Withdraw. |
|
| Tokens to be Withdrawn. |
|
| The balance to transfer the token to; see |
Withdraws multiple Deposits.
Parameter | Type | Description |
---|---|---|
|
| Address of ERC20 being Withdrawn. |
|
| Stems of the Deposits to Withdraw. |
|
| Array of token amounts to Withdraw from corresponding |
|
| The balance to transfer the token to; see |
Transfers single Farmer's Deposit.
Parameter | Type | Description |
---|---|---|
|
| Source of Deposit. |
|
| Destination of Deposit. |
|
| Address of Deposited ERC20 being transferred. |
|
| Stem of Deposit to Transfer. |
|
| Amount of tokens to transfer. |
Return Value | Type | Description |
---|---|---|
|
| BDV now owned by |
Transfers multiple Farmer Deposits.
Parameter | Type | Description |
---|---|---|
|
| Source of Deposit. |
|
| Destination of Deposit. |
|
| Address of ERC20 being transferred. |
|
| Stems of Deposits to transfer. |
|
| Array of token amounts to transfer based on corresponding |
Return Value | Type | Description |
---|---|---|
|
| Array of BDVs of each Deposit transferred. |
Transfer a single Deposit, conforming to the ERC1155 standard.
Parameter | Type | Description |
---|---|---|
|
| Source of Deposit. |
|
| Destination of Deposit. |
|
| ID of Deposit to transfer. |
|
| Amount of ERC1155 to transfer. |
Transfer a single Deposit, conforming to the ERC1155 standard.
Parameter | Type | Description |
---|---|---|
|
| Source of Deposit. |
|
| Destination of Deposit. |
|
| Array of IDs of Deposits to transfer. |
|
| Array of amounts of ERC1155 to transfer, corresponding to |
Yield Distribution
Claim Grown Stalk for an account for a particular whitelisted asset.
Parameter | Type | Description |
---|---|---|
|
| Address to Mow for. |
|
| Address of ERC20 Deposit to Mow for. |
Mow for multiple whitelisted assets for an account.
Parameter | Type | Description |
---|---|---|
|
| Address to Mow for. |
|
| Array of addresses of ERC20 Deposits to Mow for. |
Claim Earned Beans and their associated Stalk and Plantable Seeds for msg.sender
.
Return Value | Type | Description |
---|---|---|
|
| Amount of Earned Beans given. |
|
| Stem of the new Deposit. |
Claims rewards from a Flood (Season of Plenty) for msg.sender
.
View Functions
Utilities
Get the last Season in which account
updated their Silo.
Return Type | Description |
---|---|
| Last Season |
Silo Totals
Returns the total supply of Stalk. Does NOT include Grown Stalk.
Return Type | Description |
---|---|
| Total supply of Stalk. |
Returns the total supply of Roots.
Return Type | Description |
---|---|
| The total supply of Roots. |
Returns the total supply of Earned Beans.
Return Type | Description |
---|---|
| Total supply of Earned Beans. |
Silo Account Balances
Returns the balance of Stalk for a particular Farmer. Does NOT include Grown Stalk; does include Earned Stalk.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the Stalk balance for. |
Return Type | Description |
---|---|
| Stalk balance of |
Returns the balance of Roots for a particular Farmer.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the Roots balance for. |
Return Type | Description |
---|---|
| Roots balance of |
Returns the balance of Grown Stalk for account
. Grown Stalk is earned each Season from BDV and must be Mown to add it to a user's Stalk balance.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the Grown Stalk balance for. |
Return Type | Description |
---|---|
| Grown Stalk balance of |
Returns the balance of Grown Stalk for a single deposit of token
in stem
for account
.
Parameter | Type | Description |
---|---|---|
|
| Farmer that owns the Deposit to get the Grown Stalk balance for. |
|
| ERC20 token address of the Deposit. |
|
| Stem of the Deposit. |
Return Value | Type | Description |
---|---|---|
|
| Grown Stalk for Deposit. |
Returns the balance of Earned Beans for a Farmer.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the Earned Bean balance for. |
Return Value | Type | Description |
---|---|---|
|
| Earned Bean balance of |
Return the account
balance of Earned Stalk, the Stalk associated with Earned Beans.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the Earned Stalk balance for. |
Return Type | Description |
---|---|
| Earned Stalk balance of |
Return the balance of Deposited BDV of a whitelisted asset for a given Farmer.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the Deposited BDV balance for. |
|
| Whitelisted asset to get the balance of Deposited BDV for. |
Return Value | Type | Description |
---|---|---|
|
| Balance of Deposited BDV given |
Return the Stem at the time that a Farmer last Mowed a particular whitelisted asset.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the last Mowed Stem for. |
|
| Whitelisted asset to get the last Mowed Stem for. |
Return Value | Description | |
---|---|---|
|
| Last Mowed Stem for |
Return the Mow Status struct of token
for a given account
.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the Mow Status of. |
|
| Token to get the Mow Status of |
Type |
---|
|
Season of Plenty (Flood)
Returns the last Season that a Season of Plenty started.
Return Value | Description |
---|---|
| The last Season it started Flooding. |
Returns the Farmer's balance of unclaimed 3CRV earned from the Season of Plenty.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get the unclaimed 3CRV balance for. |
Return Value | Type | Description |
---|---|---|
|
| Unclaimed 3CRV balance of |
Returns the account
balance of Roots the last time it was Raining during a Silo update.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get "Rain Roots" balance for. |
Return Value | Description |
---|---|
| Root balance last time it was Raining for |
Returns the account
Season of Plenty related state variables.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get SOP related state variables for. |
Return Value | Type | Description |
---|---|---|
|
| Struct containing SOP related state variables. |
Stems
Returns the "stemTip", or cumulative Grown Stalk Per BDV of a given Deposited asset since whitelist, for a given whitelisted token.
Parameter | Type | Description |
---|---|---|
|
| ERC20 token to get the Stem tip for. |
Return Value | Type | Description |
---|---|---|
|
| Returns the Stem tip for |
Get the Stem associated with a particular Deposit (via its token and Season). Kept for legacy reasons.
Parameter | Type | Description |
---|---|---|
|
| ERC20 token of the Deposit. |
|
| Season of the Deposit. |
Return Value | Type | Description |
---|---|---|
|
| Stem of the Deposit. |
Gets the Seeds per token for legacy whitelisted assets. Calling with an non-legacy token will return 0, even after the token is whitelisted. Kept for legacy reasons.
Parameter | Type | Description |
---|---|---|
|
| Legacy token to get the Seeds for. |
Return Type | Description |
---|---|
| Seeds for the legacy token. |
Returns the Season in which Beanstalk initialized Silo V3, i.e., the Season in which Stems were initialized.
Return Type | Description |
---|---|
| Season in which Stems were initialized. |
Returns whether or not a Farmer needs to migrate to Silo V3.
Parameter | Type | Description |
---|---|---|
|
| Farmer to check if migration is needed for. |
Return Type | Description |
---|---|
| Whether or not |
Returns if Earned Beans from the previous gm
call are still vesting. Vesting Earned Beans cannot be received via plant
until the Vesting Period is over, and will be forfeited if a Farmer Withdraws during the Vesting Period.
Return Type | Description |
---|---|
| Whether or not Earned Beans from the previous |
Getters
Find the amount and BDV of token
that a Farmer has Deposited in a given Stem.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get Deposit data for. |
|
| ERC20 token of the Deposit. |
|
| Stem of the Deposit. |
Return Value | Description |
---|---|
| Number of tokens in the Deposit. |
| BDV of the Deposit. |
Get the total amount of token
currently Deposited in the Silo across all Farmers.
Parameter | Type | Description |
---|---|---|
|
| Whitelisted token address. |
Return Type | Description |
---|---|
| Total number of |
Get the total BDV of token
currently Deposited in the Silo across all Farmers.
Parameter | Type | Description |
---|---|---|
|
| Whitelisted token address. |
Return Type | Description |
---|---|
| Total BDV of |
Get the Storage.SiloSettings
for a whitelisted token.
Parameter | Type | Description |
---|---|---|
|
| Whitelisted token address. |
Return Type | Description |
---|---|
| Struct with Silo variables for |
Returns the total BDV of a number of tokens on the Deposit Whitelist.
Parameter | Type | Description |
---|---|---|
|
| The whitelisted token address. |
|
| The number of tokens. |
Type |
---|
|
ERC-1155
Gets the amount of tokens in a Deposit type for a given Farmer.
Parameter | Type | Description |
---|---|---|
|
| Farmer to get Deposit amount for. |
|
| Deposit ID corresponding to |
Return Type | Description |
---|---|
| Amount of tokens in a Deposit type for |
Gets an array of amounts corresponding to Deposits.
Parameter | Type | Description |
---|---|---|
|
| List of Farmers. |
|
| List of Deposit IDs corresponding to |
Return Type | Description |
---|---|
| Array of amounts corresponding to the list of Deposits. |
Gets the Deposit ID given an whitelisted token address and Stem.
Parameter | Type | Description |
---|---|---|
|
| Whitelisted token address. |
|
| Stem of the Deposit. |
Return Type | Description |
---|---|
| Deposit ID of |
Events
Emitted when the deposit associated with the Earned Beans of account
are Planted.
Parameter | Type | Description |
---|---|---|
|
| Farmer that Planted their Earned Beans. |
|
| The amount of Earned Beans claimed. |
Emitted when 3CRV paid to account
during a Flood is claimed.
Parameter | Type | Description |
---|---|---|
|
| Farmer that claimed the assets. |
|
| The amount of 3CRV claimed by |
Emitted when account
gains or loses Stalk.
Parameter | Type | Description |
---|---|---|
|
| The Farmer whose Stalk balance changed. |
|
| The change in Stalk. |
|
| The change in Roots. |
Emitted when account
adds a single Deposit to the Silo. There is no AddDeposits
event because there is currently no operation in which Beanstalk creates multiple Deposits in different Stems.
Parameter | Type | Description |
---|---|---|
|
| The Farmer that added a Deposit to Beanstalk. |
|
| Whitelisted token address. |
|
| The Stem of the Deposit. |
|
| Token amount of the Deposit. |
|
| The BDV associated with |
Emitted when account
removes a single Deposit from the Silo. Occurs during Withdraw and Convert.
Parameter | Type | Description |
---|---|---|
|
| The Farmer whose Deposit was removed. |
|
| Whitelisted token address. |
|
| The Stem of the Deposit. |
|
| The token amount of the Deposit. |
|
| The BDV associated with the Deposit. |
Emitted when account
removes multiple Deposits from the Silo. Occurs during Withdraw and Convert.
Parameter | Type | Description |
---|---|---|
|
| The Farmer whose Deposit was removed. |
|
| Whitelisted token address. |
|
| Stems of the Deposits. |
|
| The token amounts of the Deposits, corresponding to |
|
| Sum of |
|
| The BDVs associated with the Deposits, corresponding to |
ERC-1155 event. Emitted when a Deposit is created, removed, or transferred.
Parameter | Type | Description |
---|---|---|
|
| The address that performed the operation. |
|
| The address the Deposit is being transferred from. |
|
| The address the Deposit is being transferred to. |
|
| The Deposit ID of the Deposit. |
|
| The amount of the Deposit. |
ERC-1155 event. Emitted when multiple deposits are withdrawn or transferred.
Parameter | Type | Description |
---|---|---|
|
| The address that performed the operation. |
|
| The address the Deposit is being transferred from. |
|
| The address the Deposit is being transferred to. |
|
| The Deposit IDs of the Deposits. |
|
| The amounts of the Deposits. |
Legacy event. This event is kept for backwards compatibility in order for the ABI to generate properly.
Parameter | Type | Description |
---|---|---|
|
| Farmer that claimed the Withdrawals. |
|
| Whitelisted token address. |
|
| Seasons of claimed Withdrawn assets. |
|
| Amount of claimed asset. |
Legacy event. This event is kept for backwards compatibility in order for the ABI to generate properly.
Parameter | Type | Description |
---|---|---|
|
| Farmer that claimed the Withdrawal. |
|
| Whitelisted token address. |
|
| Seasons of claimed Withdrawn asset. |
|
| Amount of claimed asset. |
Last updated