E721Farm
Inherits: Farm, IERC721Receiver
Author: Sperax Foundation.
This contract contains the core logic for E721 farms.
State Variables
nftContract
depositToTokenId
Functions
onERC721Received
Function is called when user transfers the NFT to this farm.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| The address of the owner. |
|
| NFT Id generated by other protocol (e.g. Camelot or Uniswap). |
|
| The data should be the lockup flag (bool). |
Returns
Name | Type | Description |
---|---|---|
|
| bytes4 The onERC721Received selector. |
withdraw
Function to withdraw a deposit from the farm.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the deposit to be withdrawn. |
_getLiquidity
Function to get the liquidity. Must be defined by the farm.
This function should be overridden to add the respective logic.
Parameters
Name | Type | Description |
---|---|---|
|
| The nft tokenId. |
Returns
Name | Type | Description |
---|---|---|
|
| The liquidity of the nft position. |