All Projects → yearn → Yearn Vaults

yearn / Yearn Vaults

Licence: agpl-3.0
Yearn Vault smart contracts

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Yearn Vaults

Angular Truffle Starter Dapp
Angular CLI + Truffle Starter Dapp; write, compile & deploy smart contracts on Ethereum blockchains
Stars: ✭ 174 (+31.82%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Yearn Protocol
Yearn smart contracts
Stars: ✭ 277 (+109.85%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Eth Vue
Featured in Awesome Vue [https://github.com/vuejs/awesome-vue], a curated list maintained by vuejs of awesome things related to the Vue.js framework, and Awesome List [https://awesomelists.net/150-Vue.js/3863-Open+Source/18749-DOkwufulueze-eth-vue], this Truffle Box provides everything you need to quickly build Ethereum dApps that have authentication features with vue, including configuration for easy deployment to the Ropsten Network. It's also Gravatar-enabled. Connecting to a running Ganache blockchain network from Truffle is also possible -- for fast development and testing purposes. Built on Truffle 5 and Vue 3, eth-vue uses vuex for state management, vuex-persist for local storage of app state, and vue-router for routing. Authentication functionalities are handled by Smart Contracts running on the Ethereum blockchain.
Stars: ✭ 171 (+29.55%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Ico Contracts
Ethereum smart contracts that have been used during successful ICOs
Stars: ✭ 160 (+21.21%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Stromdao Businessobject
Abstract BusinessObject for StromDAO Energy Blockchain. Abstraction layer between blockchain technology and business logic providing energy market related entities and use cases.
Stars: ✭ 10 (-92.42%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Ethlist
The Comprehensive Ethereum Reading List
Stars: ✭ 3,576 (+2609.09%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Ethereum Graph Debugger
Ethereum solidity graph plain debugger. To have the whole picture when debugging.
Stars: ✭ 177 (+34.09%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Trust Wallet Ios
📱 Trust - Ethereum Wallet and Web3 DApp Browser for iOS
Stars: ✭ 1,228 (+830.3%)
Mutual labels:  blockchain, ethereum, ethereum-contract
React Ethereum Dapp Example
A starter boilerplate for an Ethereum dapp using web3.js v1.0, truffle, react, and parity
Stars: ✭ 384 (+190.91%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Colonynetwork
Colony Network smart contracts
Stars: ✭ 351 (+165.91%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Smart Contracts Example
Simple example of token market. Based on blockchain technology using Ethereum platform.
Stars: ✭ 37 (-71.97%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Smart Contract Sanctuary
🐦🌴🌴🌴🦕 A home for ethereum smart contracts. 🏠
Stars: ✭ 99 (-25%)
Mutual labels:  blockchain, ethereum, ethereum-contract
Open Bounty
Enable communities to distribute funds to push their cause forward.
Stars: ✭ 121 (-8.33%)
Mutual labels:  blockchain, ethereum
Go Web3
Ethereum Go Client [obsolete]
Stars: ✭ 120 (-9.09%)
Mutual labels:  blockchain, ethereum
Chainabstractionlayer
Blockchain abstraction layer
Stars: ✭ 131 (-0.76%)
Mutual labels:  blockchain, ethereum
Awesome Dapps
A curated list of awesome decentralized applications / resources
Stars: ✭ 130 (-1.52%)
Mutual labels:  blockchain, ethereum
Stocklook
crypto currency library for trading & market making bots, account management, and data analysis
Stars: ✭ 119 (-9.85%)
Mutual labels:  blockchain, ethereum
Remix Ide
Documentation for Remix IDE
Stars: ✭ 1,768 (+1239.39%)
Mutual labels:  blockchain, ethereum
Hashed Timelock Contract Ethereum
Hashed Timelock Contracts for ETH, ERC20 and ERC721 on Ethereum
Stars: ✭ 128 (-3.03%)
Mutual labels:  blockchain, ethereum
Ethvtx
🌀🛰 ethereum-ready & framework-agnostic redux store configuration
Stars: ✭ 125 (-5.3%)
Mutual labels:  blockchain, ethereum

Yearn Vault Contracts

Please read and be familiar with the Specification.

This repository is the set of smart contracts that are used for the Yearn Vaults. It contains the requirements, code, deployment scripts, and tests necessary for the core protocol, including a inheritable template strategy for use with Solidity-based strategies that interact with Yearn Vaults. These contracts are used to create 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.

Requirements

To run the project you need:

  • Python 3.8 local development environment and Node.js 10.x development environment for Ganache.
  • Brownie local environment setup. See instructions for how to install it here.
  • Local env variables for Etherscan API and Infura (ETHERSCAN_TOKEN, WEB3_INFURA_PROJECT_ID).
  • Local Ganache environment installed with npm install -g [email protected].

Installation

To use the tools that this project provides, please pull the repository from GitHub and install its dependencies as follows. You will need yarn installed. It is recommended to use a Python virtual environment.

git clone https://github.com/iearn-finance/yearn-vaults
cd yearn-vaults
yarn install --lock-file

Compile the Smart Contracts:

brownie compile # add `--size` to see contract compiled sizes

Extended Instructions

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.

  1. Note for Windows users: if you want to use the Windows Subsystem for Linux (WSL), go ahead and install it now
    • After it's installed, launch your chosen Linux subsystem
    • Follow the Linux instructions below from within your terminal, except for VSCode. Any VSCode installation happens in Windows, not the Linux subsystem.
  2. Install VSCode
  3. Install VSCode Extensions
  4. Install Python 3.8
  5. Setup Brownie
    • python3 -m pip install --user pipx
      • 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
    • python3 -m pipx ensurepath
    • pipx install eth-brownie
      • If you're on Windows (pure Windows, not WSL), you'll need to install the C++ Build Tools before executing this
  6. Install Node.js 10.x
  7. Install Ganache
  8. Install Yarn
  9. Install Black
    • python3 -m pip install black
  10. Setup an account on Etherscan and create an API key
    • Set ETHERSCAN_TOKEN environment variable to this key's value
      • Windows: setx ETHERSCAN_TOKEN yourtokenvalue
      • Mac/Linux: echo "export ETHERSCAN_TOKEN=\"yourtokenvalue\"" | sudo tee -a ~/.bash_profile
  11. Setup an account on Infura and create an API key
    • Set WEB3_INFURA_PROJECT_ID environment variable to this key's value
      • Windows: setx WEB3_INFURA_PROJECT_ID yourtokenvalue
      • Mac/Linux: echo "export WEB3_INFURA_PROJECT_ID=\"yourtokenvalue\"" | sudo tee -a ~/.bash_profile
  12. Close & re-open your terminal before proceeding (to get the new environment variable values)
  13. If you don't have git yet, go set it up
  14. Pull the repository from GitHub and install its dependencies
    • git clone https://github.com/iearn-finance/yearn-vaults
    • cd yearn-vaults
    • yarn install --lock-file
      • You may have to install with --ignore-engines (try this if you get an error)
  15. Compile the Smart Contracts:
    • brownie compile
  16. brownie test tests/functional/ -s -n auto * If everything worked, you'll see something like the following: Console
  17. Launch VSCode
    • If you're in Windows using WSL, type code . to launch VSCode
    • Open one of the .sol files, right click the code and click Soldity: Change Workspace compiler version (Remote), Change to 0.6.12
      • Alternatively, go to File -> Preferences -> Settings
      • If you’re using WSL, go to the Remote [WSL] tab
      • Otherwise choose the Workspace tab
        • Search for Solidity and copy and paste v0.6.12+commit.27d51765 into the Solidity: Compile Using Remote Version textbox
    • Set Black as the linter.
      • You'll see a toast notification the bottom right asking about linting, choose black
      • If you don't see this, just go to File -> Preferences -> Settings
        • If you're using WSL, go to the Remote [WSL] tab.
        • Otherwise choose the Workspace tab
        • Search for python formatting provider and choose black.
        • Search for format on save and check the box
  18. Lastly, you'll want to add .vscode to to your global .gitignore
    • Use a terminal on Mac / Linux, use Git Bash on Windows
    • touch ~/.gitignore_global
    • use your favorite editor and add .vscode/ to the ignore file
      • Using vi:
        • vi ~/.gitignore_global
        • copy .vscode/ and hit p in vi
        • type :x and hit enter
    • git config --global core.excludesfile ~/.gitignore_global
  19. Congratulations! You're all set up.
    • Use git pull to stay up to date with any changes made to the source code

Tests

If you're not familiar with brownie, see the quickstart.

The fastest way to run the tests is:

brownie test tests/functional/ -n auto

Run tests with coverage and gas profiling:

brownie test tests/functional/ --coverage --gas -n auto

A brief explanation of flags:

  • -s - provides iterative display of the tests being executed
  • -n auto - parallelize the tests, letting brownie choose the degree of parallelization
  • --gas - generates a gas profile report
  • --coverage - generates a test coverage report

Formatting

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 .

Security

For security concerns, please visit Bug Bounty.

Documentation

You can read more about Yearn Finance on our documentation webpage.

Discussion

For questions not covered in the docs, please visit our Discord server.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].