Farmer
A collection of smart contracts to aid in my deep dive into becoming a farmer.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
About The Project
A collection of farming contracts which will be used to optimize yield.
Built With
Getting Started
To get a local copy up and running follow these simple steps.
Prerequisites
You just need to have npm to use this project.
- npm
npm install npm@latest -g
You will also need a few .env
variables for things to work properly:
INFURA_API_KEY
: used for deployment and mainnet forking.TEST_ACCOUNT
: private key of a test account you will use to deploy the contracts for testing/mainnet.WHALE_TEST_ADDRESS
: public address of an account (preferably someone with a good amount of funds) which you can test off a fork.MINI_CHEF_V2_ADDRESS
:0x0769fd68dFb93167989C6f7254cd0D766Fb2841F
(on Polygon at least)
Installation
- Clone the repo
git clone https://github.com/0xdavinchee/farmer.git
- Install NPM packages
yarn install
Usage
- To use this without a frontend, you will to know how to interact with contracts using the hardhat console: https://ethereum.stackexchange.com/questions/93657/how-to-interact-with-the-functions-of-my-smart-contract-in-hardhat.
- You also have the option of deploying and then verifying the contract and interacting with it through etherscan/polygonscan/etc.
- To run tests, you will have to do this on a fork of mainnet as I don't believe any of the testnets have farms. The forking config is already set up in
hardhat.config.ts
. The variables you will change infarmer-tests.test.ts
are:chainId
,pid
,independentAddress
,dependentAddress
,independentTokenInfo
,dependentTokenInfo
,rewardTokenA
andrewardTokenB
. This will allow you to test the SushiFarmer contract on other chains, with other farms and different reward types. Use the commandyarn test --network localhost
.
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Contact
0xdavinchee - @0xdavinchee - 0xdavinchee@gmail.com
Project Link: https://github.com/0xdavinchee/farmer