Yearn Protocol is a set of Ethereum Smart Contracts focused on creating a simple way to generate high risk-adjusted returns for depositors of various assets via best-in-class lending protocols, liquidity pools, and community-made yield farming strategies on Ethereum.
Before getting started with this repo, please read:
To run the project you need:
ETHERSCAN_TOKEN
, WEB3_INFURA_PROJECT_ID
).npm install -g ganache-cli@6.11
.To run the yearn protocol, pull the repository from GitHub and install its dependencies. You will need yarn installed.
git clone https://github.com/iearn-finance/yearn-protocol
cd yearn-protocol
yarn install --lock-file
Compile the Smart Contracts:
brownie compile
Note that you can run this project from Mac, Linux, Windows, or the Windows Subsystem for Linux.
The below guide covers installation on Mac, Linux, Windows, and Windows using the Windows Subsystem for Linux.
Any command in code blocks
is meant to be executed from a Mac/Linux terminal or Windows command prompt.
python3 -m pip install --user pipx
python --version
, if it returns back something like Python 3.8.x
then just replace python3
with python
for all python commands in these instructions.python3 -m pipx ensurepath
pipx install eth-brownie
npm install -g ganache-cli@6.11
python3 -m pip install black
ETHERSCAN_TOKEN
environment variable to this key's value
setx ETHERSCAN_TOKEN yourtokenvalue
echo "export ETHERSCAN_TOKEN=\"yourtokenvalue\"" | sudo tee -a ~/.bash_profile
WEB3_INFURA_PROJECT_ID
environment variable to this key's value
setx WEB3_INFURA_PROJECT_ID yourtokenvalue
echo "export WEB3_INFURA_PROJECT_ID=\"yourtokenvalue\"" | sudo tee -a ~/.bash_profile
git clone https://github.com/iearn-finance/yearn-protocol
cd yearn-protocol
yarn install --lock-file
--ignore-engines
brownie compile
brownie test -s
code .
to launch VSCode
touch ~/.gitignore_global
.vscode/
to the ignore filegit config --global core.excludesfile ~/.gitignore_global
git pull
to stay up to date with any changes made to the source code.git checkout master
. By default you'll be in develop
, which is where you can see the latest features getting ready for release.If you're not familiar with brownie, see the quickstart.
Tests are commented following the NumPy docstring style. [Draft Note from Shade: This is not true yet but I'm working on adding comments right now, so we'll have them around the time this readme is checked in.
Run tests:
[Draft Note from Shade: There's a PR waiting that will change this to brownie test -s -n auto, which will parallelize the tests, this note is my reminder to update the docs once that PR goes through.]
brownie test -s
Run tests with coverage:
brownie test -s --coverage
Check linter rules for *.json
and *.sol
files:
yarn lint:check
Fix linter errors for *.json
and *.sol
files:
yarn lint:fix
Check linter rules for *.py
files:
black . --check
Fix linter errors for *.py
files:
black .
For security concerns, please visit Bug Bounty.
You can read more about yearn finance on our documentation webpage.
For questions not covered in the docs, please visit our Discord server.