FarmingCenter
Algebra main farming contract
Developer note: Manages farmings and performs entry, exit and other actions.
Variables
contract IAlgebraLimitFarming limitFarming immutable
contract IAlgebraEternalFarming eternalFarming immutable
contract INonfungiblePositionManager nonfungiblePositionManager immutable
contract IFarmingCenterVault farmingCenterVault immutable
mapping(uint256 => struct FarmingCenter.Deposit) deposits
Developer note: deposits[tokenId] => Deposit
mapping(uint256 => struct FarmingCenter.L2Nft) l2Nfts
Functions
constructor
ERC721Permit, PeripheryPayments
constructor(contract IAlgebraLimitFarming,contract IAlgebraEternalFarming,contract INonfungiblePositionManager,contract IFarmingCenterVault)
public
onERC721Received
onERC721Received(address,address,uint256,bytes)
external
Upon receiving a Algebra ERC721, creates the token deposit setting owner to `from`.
Returns:
enterFarming
enterFarming(struct IIncentiveKey.IncentiveKey,uint256,uint256,bool)
external
Enters in incentive (time-limited or eternal farming) with NFT-position token
exitFarming
exitFarming(struct IIncentiveKey.IncentiveKey,uint256,bool)
external
Exits from incentive (time-limited or eternal farming) with NFT-position token
collect
collect(struct INonfungiblePositionManager.CollectParams)
external
Collects up to a maximum amount of fees owed to a specific position to the recipient
Returns:
collectRewards
collectRewards(struct IIncentiveKey.IncentiveKey,uint256)
external
Used to collect reward from eternal farming. Then reward can be claimed.
Returns:
claimReward
claimReward(contract IERC20Minimal,address,uint256,uint256)
external
Used to claim and send rewards from farming(s)
Returns:
connectVirtualPool
connectVirtualPool(contract IAlgebraPool,address)
external
Updates activeIncentive in AlgebraPool
withdrawToken
withdrawToken(uint256,address,bytes)
external
Withdraw Algebra NFT-position token
cross
cross(int24,bool)
external
increaseCumulative
increaseCumulative(uint32)
external
Returns:
virtualPoolAddresses
virtualPoolAddresses(address)
view external
Returns:
getApproved
getApproved(uint256)
view public
Returns: