FaaS (Farm as a Service) is a smart contract-based project that allows users to create their own FarmingRewards contracts to distribute rewards to liquidity providers. This repository contains the Solidity contracts, tests, and necessary scripts for the FaaS system.
This project was built with hardhat.
- Create FarmingRewards contracts for distributing rewards to liquidity providers
- Permissioned FarmingRewards contracts for added security and control
- Fee collection for creating new FarmingRewards contracts
- Integration with ElkFinance's ecosystem
FaaS is composed of several components, including staking/farming contracts that reward liquidity providers, staking strategies that implement a universal interface to different kinds of staking tokens, staking/farming managers that make it easy for users to interact with different farms, and factory contracts that facilitate the creation of new farms.
- IStakingRewards -> StakingRewards, which comes in different flavors:
- StakingRewardsWithILP: support impermanent loss coverage payments for v2 LPs
- ElkSingeStakingRewards: the final contract for single staking
- ElkV2FarmingRewards: the final contract for farming with v2 LP
- ElkV3FarmingRewards: the final contract for farming with v3 LP
- IStakingStrategy -> StakingStrategy, which includes the following subcontracts:
- ERC20StakingStrategy: supports staking arbitrary ERC20 tokens
- ERC20StakingStrategy: supports staking arbitrary ERC20 tokens and deposit/withdrawal fees
- ERC721StakingStrategy: supports staking arbitrary ERC721 tokens
- ElkV2StakingStrategy: supports staking v2 LPs
- ElkV3StakingStrategy: supports staking v3 LPs
- Managers:
- IStakeManager -> StakeManager: manages single stake
- IElkV2FarmManager -> ElkV2FarmManager: manages v2 farms
- IElkV3FarmManager -> ElkV3FarmManager: manages v3 farms
- Factories:
- IStakeFactory -> StakeFactory: creates single stake
- IElkV2FarmFactory -> ElkV2FarmFactory: creates v2 farms
- IElkV3FarmFactory -> ElkV3FarmFactory: creates v3 farms
Follow these instructions to set up the FaaS repository on your local machine.
- Node.js and npm (Node Package Manager) installed on your system. You can download Node.js from https://nodejs.org/.
- Clone the repository to your local machine:
git clone https://github.com/elkfinance/faas- Navigate to the project folder:
cd faas- Install the project dependencies:
npm install- Run the tests:
npm run testThe FaaS system is comprised of two main contracts: "ElkFarmFactory" (located at ./contracts/ElkFarmFactory.sol) and "FarmingRewards" (located at ./contracts/FarmingRewards.sol). The ElkFarmFactory contract is the main contract that users interact with to create new FarmingRewards contracts. The FarmingRewards contract is the contract that distributes rewards to liquidity providers.
- Seth [email protected]
- Baal [email protected]
- Elijah [email protected]
- Snake [email protected]
- Real-Hansolo [email protected]
See included LICENSE.