Code Monkey home page Code Monkey logo

foundry-yearn-vaults's Introduction

YearnYield

YearnYield is a Foundry project that integrates with Yearn Vaults using VaultAPI interfaces and leverages their yield strategies. It allows users to deposit tokens into a vault and withdraw them after a specified deadline, while earning interest from the vault's strategy. A portion of the interest is sent to a treasury address as a fee.

Installation

To install the project, you need to have Foundry installed and configured on your machine. Then, clone this repository and run foundry build in the project directory.

Usage

To use the project, you need to deploy the YearnYield contract with the following parameters:

  • _stakingToken: The address of the ERC20 token that users can deposit and withdraw.
  • _yieldVault: The address of the Yearn Vault that implements the VaultAPI interface and has the same underlying token as _stakingToken.
  • _treasury: The address of the treasury that receives a 10% fee from the interest earned by the vault.

After deploying the contract, users can interact with it using the following functions:

  • deposit(uint256 amount, uint256 deadline): Allows a user to deposit amount of tokens into the vault and set a deadline (in seconds) for withdrawal. The user must approve the contract to spend their tokens before calling this function. The function returns the number of shares that the user receives from the vault.
  • withdraw(): Allows a user to withdraw their tokens and interest after the deadline has passed. The function transfers 90% of the interest and the original deposit to the user, and 10% of the interest to the treasury. The function also burns the user's shares from the vault.

License

This project is licensed under the MIT License - see the LICENSE file for details.

foundry-yearn-vaults's People

Contributors

akkii4 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.