Welcome to the Demeter Protocol's repository! We're thrilled that you're interested in contributing to our project. This document provides an overview of how you can get involved and make contributions. Please take a moment to read and understand these guidelines before you start contributing.
- Getting Started
- Code of Conduct
- How to Contribute
- Development Setup
- Pull Request Process
- Community
- License
Before you start contributing, make sure you have:
- A GitHub account. If you don't have one, you can sign up here.
- Familiarity with Demeter Protocol. You can learn more by visiting our website or checking out our documentation.
- Foundry. You can follow the steps mentioned here to install foundry.
As contributors of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, adding new protocols and other activities.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct.
Currently, Demeter protocol is only open for adding new protocols to our growing list of protocols which offers incentivized liquidity pools.
If you want to get in touch with the maintainers for any doubt or question, you can drop a message in #engineering-dev room in our official Discord.
To set up a development environment for Demeter Protocol, follow these steps:
-
Fork the Demeter-Protocol GitHub repository to your own GitHub account.
-
Clone your forked repository to your local machine:
git clone https://github.com/your-username/Demeter-Protocol.git
-
Install the necessary dependencies:
cd Demeter-Protocol forge install npm install -
Create a new branch for your work:
git checkout -b wip/protocol-name
-
Add a new folder under contracts for contracts and protocol's interface
mkdir contracts/protocol-name mkdir contracts/protocol-name/interfaces
-
Add the smart contracts:
touch contracts/protocol-name/ProtocolNameFarm.sol touch contracts/protocol-name/ProtocolNameFarm_Deployer.sol
-
Your Farm and FarmDeployer must extend Farm.sol and FarmDeployer.sol under
contracts. -
If the desired protocol is a fork of Uniswap V2/ returns ERC20 LP positions, you must follow the steps under
contracts/e20-farms. -
Add the logic you would like to add for deposits and withdrawals over Farm and then call the internal functions of Farm for consistency.
-
Farm deployers must collect fees, validate pool while creating a farm and must register the farm in the official FarmRegistry contract. Feel free to add/ remove any variables which are needed as per different protocols.
-
Write extensive tests in foundry under tests/protocol-name/ directory as:
tests/protocol-name/ProtocolNameFarm.t.sol tests/protocol-name/ProtocolNameFarm_Deployer.t.sol
-
Push your changes to your forked repository:
git push origin wip/protocol-name
-
Open a pull request on the original repository with a clear description of your changes. Our team will review your pull request and provide feedback.
Please follow these guidelines when submitting a pull request:
-
Keep your pull request focused on a single protocol.
-
Provide a clear and descriptive title for your pull request.
-
Include detailed information in the pull request's description, network, important smart contract addresses, documentation of the protocol you intend to add and the changes you have made in a readme.md file.
-
Add extensive code documentation as per Solidity standards
-
Ensure all tests pass successfully.
-
Be responsive to feedback and be prepared to make changes to your code if requested.
Join our community to stay updated and interact with other contributors and users:
By contributing to our protocol, you agree that your contributions will be licensed under the MIT LICENSE associated with the project.
Thank you for your interest in Demeter Protocol. We look forward to your contributions and appreciate your support in making our project even better!