{"id":13631983,"url":"https://github.com/yearn/yearn-vaults","last_synced_at":"2025-05-16T13:02:58.187Z","repository":{"id":37440496,"uuid":"301581531","full_name":"yearn/yearn-vaults","owner":"yearn","description":"Yearn Vault smart contracts","archived":false,"fork":false,"pushed_at":"2024-05-08T09:03:02.000Z","size":880,"stargazers_count":535,"open_issues_count":16,"forks_count":324,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-12T08:33:08.496Z","etag":null,"topics":["blockchain","defi","ethereum","ethereum-contract","vyper","yearn","yearn-finance"],"latest_commit_sha":null,"homepage":"https://yearn.finance/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yearn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-06T01:20:13.000Z","updated_at":"2025-04-08T12:09:19.000Z","dependencies_parsed_at":"2024-01-14T06:54:22.691Z","dependency_job_id":"82470093-af88-46a4-96f4-27e36f8fa88a","html_url":"https://github.com/yearn/yearn-vaults","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-vaults","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-vaults/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-vaults/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-vaults/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yearn","download_url":"https://codeload.github.com/yearn/yearn-vaults/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535826,"owners_count":22087398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","defi","ethereum","ethereum-contract","vyper","yearn","yearn-finance"],"created_at":"2024-08-01T22:02:47.156Z","updated_at":"2025-05-16T13:02:58.167Z","avatar_url":"https://github.com/yearn.png","language":"Python","funding_links":[],"categories":["Python","dApps directory"],"sub_categories":["Smart Contract Templates"],"readme":"# Yearn Vault Contracts\n\nPlease read and be familiar with the [Specification](SPECIFICATION.md).\n\nThis repository is the set of smart contracts that are used for the Yearn Vaults.\nIt contains the requirements, code, deployment scripts, and tests necessary for the\ncore protocol, including a inheritable template strategy for use with Solidity-based\nstrategies that interact with Yearn Vaults. These contracts are used to create a simple\nway to generate high risk-adjusted returns for depositors of various assets via best-\nin-class lending protocols, liquidity pools, and community-made yield farming strategies\non Ethereum.\n\n## Requirements\n\nTo run the project you need:\n\n- Python 3.8 local development environment and Node.js 10.x development environment for Ganache.\n- Brownie local environment setup. See instructions for how to install it\n  [here](https://eth-brownie.readthedocs.io/en/stable/install.html).\n- Local env variables for [Etherscan API](https://etherscan.io/apis) and\n  [Infura](https://infura.io/) (`ETHERSCAN_TOKEN`, `WEB3_INFURA_PROJECT_ID`).\n- Local Ganache environment installed with `npm install -g ganache-cli@6.12.1`.\n\n## Installation\n\nTo use the tools that this project provides, please pull the repository from GitHub\nand install its dependencies as follows.\nYou will need [yarn](https://yarnpkg.com/lang/en/docs/install/) installed.\nIt is recommended to use a Python virtual environment.\n\n```bash\ngit clone https://github.com/yearn/yearn-vaults\ncd yearn-vaults\nyarn install --lock-file\n```\n\nCompile the Smart Contracts:\n\n```bash\nbrownie compile # add `--size` to see contract compiled sizes\n```\n\n### Extended Instructions\n\nThe below guide covers installation on Mac, Linux, Windows, and Windows using the Windows Subsystem for Linux.\n\nAny command `in code blocks` is meant to be executed from a Mac/Linux terminal or Windows command prompt.\n\n0. _Note for Windows users:_ if you want to use the Windows Subsystem for Linux (WSL), go ahead and [install it now](https://docs.microsoft.com/en-us/windows/wsl/install-win10)\n   - After it's installed, launch your chosen Linux subsystem\n   - Follow the Linux instructions below from within your terminal, except for VSCode. Any VSCode installation happens in Windows, not the Linux subsystem.\n1. Install [VSCode](https://code.visualstudio.com/docs/setup/setup-overview)\n2. Install VSCode Extensions\n   - [Solidity](https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity)\n   - [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)\n   - [Vyper](https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-vyper)\n   - If you're using the WSL\n     - Wait to install Solidity \u0026 Vyper, you'll do this in a later step\n     - Install [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl)\n3. Install [Python 3.8](https://www.python.org/downloads/release/python-380/)\n   - Linux: Refer to your distro documentation\n   - [Mac installer](https://www.python.org/ftp/python/3.8.0/python-3.8.0-macosx10.9.pkg)\n   - [Windows installer](https://www.python.org/ftp/python/3.8.0/python-3.8.0-amd64.exe)\n4. [Setup Brownie](https://github.com/eth-brownie/brownie)\n   - `python3 -m pip install --user pipx`\n     - Note, if get you an error to the effect of python3 not being installed or recognized, run `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\n   - `python3 -m pipx ensurepath`\n   - `pipx install eth-brownie`\n     - If you're on Windows (pure Windows, not WSL), you'll need to install the [C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) before executing this\n5. Install Node.js 10.x\n   - Linux or Mac: via your [package manager](https://nodejs.org/en/download/package-manager/)\n   - Windows: [x64 installer](https://nodejs.org/dist/latest-v12.x/node-v12.13.0-x64.msi)\n   - Other [10.x downloads](https://nodejs.org/dist/latest-v12.x)\n6. Install [Ganache](https://github.com/trufflesuite/ganache-cli)\n   - `npm install -g ganache-cli@6.12.1`\n7. [Install Yarn](https://classic.yarnpkg.com/en/docs/install)\n8. [Install Black](https://pypi.org/project/black/)\n   - `python3 -m pip install black`\n9. Setup an account on [Etherscan](https://etherscan.io) and create an API key\n   - Set `ETHERSCAN_TOKEN` environment variable to this key's value\n     - Windows: `setx ETHERSCAN_TOKEN yourtokenvalue`\n     - Mac/Linux: `echo \"export ETHERSCAN_TOKEN=\\\"yourtokenvalue\\\"\" | sudo tee -a ~/.bash_profile`\n10. Setup an account on [Infura](https://infura.io) and create an API key\n    - Set `WEB3_INFURA_PROJECT_ID` environment variable to this key's value\n      - Windows: `setx WEB3_INFURA_PROJECT_ID yourtokenvalue`\n      - Mac/Linux: `echo \"export WEB3_INFURA_PROJECT_ID=\\\"yourtokenvalue\\\"\" | sudo tee -a ~/.bash_profile`\n11. Close \u0026 re-open your terminal before proceeding (to get the new environment variable values)\n12. If you don't have git yet, go [set it up](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/set-up-git)\n13. Pull the repository from GitHub and install its dependencies\n    - `git clone https://github.com/yearn/yearn-vaults`\n    - `cd yearn-vaults`\n    - `yarn install --lock-file`\n      - You may have to install with `--ignore-engines` (try this if you get an error)\n14. Compile the Smart Contracts:\n    - `brownie compile`\n15. `brownie test tests/functional/ -s -n auto` \\* If everything worked, you'll see something like the following:\n    ![Console](https://i.imgur.com/wGSmCrY.png)\n16. Launch VSCode\n    - If you're in Windows using WSL, type `code .` to launch VSCode\n      - At this point install [Solidity Compiler](https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity) - be sure to _Install in WSL_\n      - Install [Vyper](https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-vyper) as well on WSL\n    - Open one of the .sol files, right click the code and click _Soldity: Change Workspace compiler version (Remote)_, Change to 0.6.12\n      - Alternatively, go to File -\u003e Preferences -\u003e Settings\n      - If you’re using WSL, go to the Remote [WSL] tab\n      - Otherwise choose the Workspace tab\n        - Search for _Solidity_ and copy and paste _v0.6.12+commit.27d51765_ into the _Solidity: Compile Using Remote Version_ textbox\n    - Set Black as the linter.\n      - You'll see a toast notification the bottom right asking about linting, choose _black_\n      - If you don't see this, just go to _File_ -\u003e _Preferences_ -\u003e _Settings_\n        - If you're using WSL, go to the _Remote [WSL]_ tab.\n        - Otherwise choose the _Workspace_ tab\n        - Search for _python formatting provider_ and choose _black_.\n        - Search for _format on save_ and check the box\n17. Lastly, you'll want to add .vscode to to your global .gitignore\n    - Use a terminal on Mac / Linux, use Git Bash on Windows\n    - `touch ~/.gitignore_global`\n    - use your favorite editor and add `.vscode/` to the ignore file\n      - Using vi:\n        - `vi ~/.gitignore_global`\n        - copy `.vscode/` and hit `p` in vi\n        - type `:x` and hit enter\n    - `git config --global core.excludesfile ~/.gitignore_global`\n18. Congratulations! You're all set up.\n    - Use `git pull` to stay up to date with any changes made to the source code\n\n## Tests\n\nIf you're not familiar with brownie, see the [quickstart](https://eth-brownie.readthedocs.io/en/stable/quickstart.html).\n\nThe fastest way to run the tests is:\n\n```bash\nbrownie test tests/functional/ -n auto\n```\n\nRun tests with coverage and gas profiling:\n\n```bash\nbrownie test tests/functional/ --coverage --gas -n auto\n```\n\nA brief explanation of flags:\n\n- `-s` - provides iterative display of the tests being executed\n- `-n auto` - parallelize the tests, letting brownie choose the degree of parallelization\n- `--gas` - generates a gas profile report\n- `--coverage` - generates a test coverage report\n\n## Formatting\n\nCheck linter rules for `*.json` and `*.sol` files:\n\n```bash\nyarn lint:check\n```\n\nFix linter errors for `*.json` and `*.sol` files:\n\n```bash\nyarn lint:fix\n```\n\nCheck linter rules for `*.py` files:\n\n```bash\nblack . --check\n```\n\nFix linter errors for `*.py` files:\n\n```bash\nblack .\n```\n\n## Security\n\nFor security concerns, please visit [Bug Bounty](https://github.com/yearn/yearn-vaults/security/policy).\n\n## Documentation\n\nYou can read more about Yearn Finance on our documentation [webpage](https://docs.yearn.finance).\n\n## Discussion\n\nFor questions not covered in the docs, please visit [our Discord server](http://discord.yearn.finance).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-vaults","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyearn%2Fyearn-vaults","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-vaults/lists"}