E721Farm
Was this helpful?
Was this helpful?
Inherits: Farm, IERC721Receiver
Author: Sperax Foundation.
This contract contains the core logic for E721 farms.
Function is called when user transfers the NFT to this farm.
Parameters
<none>
address
_from
address
The address of the owner.
_tokenId
uint256
NFT Id generated by other protocol (e.g. Camelot or Uniswap).
_data
bytes
The data should be the lockup flag (bool).
Returns
<none>
bytes4
bytes4 The onERC721Received selector.
Function to withdraw a deposit from the farm.
Parameters
_depositId
uint256
The id of the deposit to be withdrawn.
Function to get the liquidity. Must be defined by the farm.
This function should be overridden to add the respective logic.
Parameters
_tokenId
uint256
The nft tokenId.
Returns
<none>
uint256
The liquidity of the nft position.