The Depot Facet wraps Pipeline's pipe
functions to facilitate the loading of non-Ether assets in Pipeline.
Pipe a PipeCall
through Pipeline.
Pipe multiple PipeCalls
through Pipeline. Does not support sending Ether in the call.
Pipe multiple AdvancedPipeCalls
through Pipeline.
Pipe a PipeCall
through Pipeline with an Ether value.
Return the return value of a PipeCall
without executing it.
None.
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
p
PipeCall
PipeCall
to pipe through Pipeline.
result
bytes
PipeCall
return value.
pipes
PipeCall[]
List of PipeCalls
to pipe through Pipeline.
results
bytes[]
List of return values from each PipeCall
.
pipes
AdvancedPipeCall[]
List of AdvancedPipeCalls
to pipe through Pipeline.
value
uint256
results
bytes[]
List of return values from each AdvancedPipeCall
.
p
PipeCall
PipeCall
to pipe through Pipeline.
value
uint256
Ether value to send in Pipecall
.
result
bytes
PipeCall
return value.
p
PipeCall
PipeCall
to execute with a staticcall.
result
bytes
PipeCall
return value.
The Farm allows Farmers to call multiple functions in a single transaction and use assets between different functions in a composable manner, without those assets every leaving Beanstalk (thanks to Internal Balances). Internal Balances allow the farm
function to use the output of a function in the next function call.
The Farm also provides composable Beanstalk-native interfaces for other DeFi protocols. This allows Farmers to call supported external protocols through the farm
function and leverage Internal Balances. The current protocols that the Farm supports are:
WETH -> wrapping and unwrapping; and
Curve -> swapping and adding/removing liquidity.
Pipeline -> performing an arbitrary series of actions in the EVM in a single transaction.
The Farm creates an interface to transfer ERC-20 tokens between Internal and External Balances, as well as between Farmers through the transferToken
function.
The Farm consists of 5 facets:
The Token Support Facet handles permits for ERC-20 and ERC-721 tokens and transfers for ERC-721 and ERC-1155 tokens.
permitERC20
is a wrapper function for permit of ERC20Permit token.
Execute an ERC-721 token transfer.
Execute a permit for an ERC-721 token.
Execute an ERC-1155 token transfer of a single ID.
Execute an ERC-1155 token transfer of multiple IDs.
None.
None.
The Curve Facet handles swapping in, adding liquidity to, and removing liquidity from Curve pools without assets leaving Beanstalk.
Swaps a token for another token in a Curve base, meta, plain or crypto pool. Slippage is tolerated on the amount out. It also verifies that the pool exists in the Curve Factory. This function does not support underlying tokens.
The stable pair Curve Factory can be found at: 0xB9fC157394Af804a3578134A6585C0dc9cc990d4
The non-stable Curve factory can be found at: 0x0959158b6040D32d04c301A72CBFD6b39E21c9AE
Swaps an underlying token for another underlying token in a Curve metapool. In a Curve metapool, one of the tokens is an LP token of another pool. Underlying tokens include the non-LP token in the pool as well as the tokens in the pool that the LP token belongs to. For example, in the BEAN:3CRV metapool, the underlying tokens are Bean, USDC, Tether and Dai.
Slippage is tolerated on the amount out. This function verifies that the pool exists in the Curve Factory.
Adds tokens into a liquidity pool on Curve in exchange for LP tokens.
Removes liquidity from a pool on Curve in exchange for equal amounts of all tokens in the liquidity pool. The Farmer burns their LP tokens in the process.
Removes liquidity from a pool on Curve in exchange for an unequal amounts of tokens in the liquidity pool. The Farmer burns LP tokens in the process.
Removes liquidity from a pool on Curve in exchange for an amount of one token in the liquidity pool. The Farmer burns LP tokens in the process.
None.
None.
The Farm Facet allows Farmers to perform multiple Beanstalk functions calls in a single transaction using farm
calls.
Loops through the list of encoded selectors in data
and performs a delegateCall
on each of them.
Execute multiple AdvancedFarmCalls.
None.
None.
The Token Facet handles the transfers of assets outside the Silo.
Transfers an asset from a Farmer's Internal and/or External Balance to a Farmer's Internal or External Balance.
WIP
Wraps Ether into WETH.
Wraps Ether into WETH.
Wraps Ether into WETH.
Wraps Ether into WETH.
Wraps Ether into WETH.
Wraps Ether into WETH.
Wraps Ether into WETH.
Wraps Ether into WETH.
Wraps Ether into WETH.
Wraps Ether into WETH.
Unwraps WETH into Ether.
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
Return Value | Type | Description |
---|
Parameter | Type | Description |
---|
Return Value | Type | Description |
---|
Parameter | Type | Description |
---|
Return Value | Type | Description |
---|
Parameter | Type | Description |
---|
Return Value | Type | Description |
---|
Parameter | Type | Description |
---|
Return Value | Type | Description |
---|
Parameter | Type | Description |
---|
Return Value | Type | Description |
---|
Parameter | Type | Description |
---|
Return Value | Type | Description |
---|
Parameter | Type | Description |
---|
Return Value | Type | Description |
---|
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|
token
IERC20Permit
Token to permit.
owner
address
Owner of the token.
spender
address
Address to permit to spend the token.
value
uint256
Token amount to permit.
deadline
uint256
Expiration of signature (Unix time)
v
uint8
Recovery ID.
r
bytes32
ECDSA signature output.
s
bytes32
ECDSA signature output.
token
IERC721
Token address of the ERC-721.
to
address
Address being transferred to.
id
uint256
ID of ERC-721 token to transfer.
token
IERC4494
Token address to permit.
spender
address
Address to permit to spend the token.
tokenId
uint256
ID of token
to permit.
deadline
uint256
Expiration of signature (Unix time).
sig
bytes
A valid secp256k1
or EIP-2098 signature from owner of the tokenId
.
token
IERC1155
Token address of the ERC-1155.
to
address
Address being transferred to.
id
uint256
ID of the ERC-1155 token.
value
uint256
Number of the ERC-1155 tokens at id
to transfer.
token
IERC1155
Token address of the ERC-1155.
to
address
Address being transferred to.
ids
uint256[]
Array of IDs of the ERC-155 token.
values
uint256[]
Array of amounts of ERC-1155s at id
to transfer.
pool
address
The address of the pool to exchange in. The pool must be registered in one of the Curve Factories.
registry
address
The Curve Registry to query pool
data from.
fromToken
address
The token to swap from.
toToken
address
The token to swap to.
amountIn
uint256
The amount to swap from.
minAmountOut
uint256
The minimum amount to receive from the swap.
fromMode
From
Specifies what balance to receive the tokens from (see Internal Balances).
toMode
To
Specifies what balance to send the tokens to (see Internal Balances).
pool
address
The address of the pool to exchange in. The pool must be registered in one of the Curve Factories.
fromToken
address
The underlying token to swap from.
toToken
address
The underlying token to swap to.
amountIn
uint256
The amount to swap from.
minAmountOut
uint256
The minimum amount to receive from the swap.
fromMode
From
Specifies what balance to receive the tokens from (see Internal Balances).
toMode
To
Specifies what balance to send the tokens to (see Internal Balances).
pool
address
The address of the pool to exchange in. The pool must be registered in one of the Curve Factories.
registry
address
The Curve Registry to query pool
data from.
amounts
uint256[]
The amount of each token to add.
minAmountOut
uint256
The minimum amount to receive from the swap.
fromMode
From
Specifies what balance to receive the tokens from (see Internal Balances).
toMode
To
Specifies what balance to send the tokens to (see Internal Balances).
pool
address
The address of the pool to exchange in. The pool must be registered in one of the Curve Factories.
registry
address
The Curve Registry to query pool
data from.
amountIn
uint256
The amount of LP to remove.
minAmountsOut
uint256[]
The minimum amount to receive in each of the tokens.
fromMode
From
Specifies what balance to receive the tokens from (see Internal Balances).
toMode
To
Specifies what balance to sent the tokens to (see Internal Balances).
pool
address
The address of the pool to exchange in. The pool must be registered in one of the Curve Factories.
registry
address
The Curve Registry to query pool
data from.
amountsOut
uint256[]
The amount of each token to receive.
maxAmountIn
uint256
The max amount of LP tokens to burn.
fromMode
From
Specifies what balance to receive the tokens from (see Internal Balances).
toMode
To
Specifies what balance to send the tokens to (see Internal Balances).
pool
address
The address of the pool to exchange in. The pool must be registered in one of the Curve Factories.
registry
address
The Curve Registry to query pool
data from.
toToken
address
The token to receive in exchange for burning LP tokens.
amountIn
uint256
The amount of LP tokens to burn.
minAmountOut
uint256
The minimum amount of the token to receive.
fromMode
From
Specifies what balance to receive the tokens from (see Internal Balances).
toMode
To
Specifies what balance to send the tokens to (see Internal Balances).
data
bytes[]
The encoded function data for each of the calls.
results
bytes[]
The return data from each of the calls.
data
AdvancedFarmCall[]
The encoded function data for each of the calls to make to this contract.
results
bytes[]
The results from each of the calls passed in via data
.
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| WIP |
|
| The token to be transferred. |
|
| The recipient of the transferred tokens (can be |
|
| The amount of tokens to be transferred. |
|
|
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of Ether to wrap into WETH. Must be |
|
|
|
| The amount of WETH to unwrap into Ether. |
|
|
Specifies what balance to receive the tokens from (see ).
Specifies what balance to send the tokens to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to send the WETH to (see ).
Specifies what balance to receive the WETH from (see ).