Git Product home page Git Product logo

contracts's Introduction

Raft: Smart Contracts

Raft is an immutable, decentralized lending protocol that allows people to take out stablecoin loans against capital-efficient collateral.

R is the first Ethereum USD stablecoin solely backed by stETH (Lido Staked Ether). R provides the most capital-efficient way to borrow using your stETH. R aims to be the stablecoin of choice within the decentralized ecosystem, with deep liquidity across many trading pairs and a stable peg.

This repository contains the Raft smart contracts written in Solidity. To learn more about Raft, please visit our website and docs.

Getting Started

Prerequisites

To build and test the Raft smart contracts, you will need the following:

Installation

Clone the repository with its submodules, set up Foundry, and install the dependencies via Yarn:

yarn install

Testing

To run the tests, run the following command:

forge test

Static Analysis

To run the Slither static analysis tool, run the following command:

slither .

Contracts

Core Contracts

Contract Description
PositionManager The entry point for managing positions. It also handles the logic for borrowing R tokens and repayment of the debt, as well as liquidations and redemptions.
RToken An ERC-20 token designed to retain a value of 1 USD. R can be minted and burnt only by PositionManager.
ERC20Indexable Rebase token which is used as the debt token implementation.
SplitLiquidationCollateral Used by PositionManager to calculate how liquidated collateral should be split between the liquidator and the protocol.
PriceFeed Retrieves asset prices from a primary oracle, using a secondary oracle as a fallback when the primary is unavailable or compromised
ChainlinkPriceOracleWstETH Chainlink oracle integration contract.
TellorPriceOracleWstETH Tellor oracle integration contract.

Periphery Contracts

Contract Description
PositionManagerStETH Allows managing positions with ETH or stETH collateral. Responsible for wrapping/unwrapping ETH and stETH into/from wstETH. It has to be whitelisted by a user in PositionManager.
OneStepLeverage Facilitates opening, closing, or adjusting leverage on wstETH positions with a single transaction, employing flash mint to streamline the process and reduce transaction complexity.
OneStepLeverageStETH Extends the functionality of OneStepLeverage to allow using ETH and stETH.
FlashMintLiquidator Facilitates the liquidation of undercollateralized positions in a single transaction, employing flash loans to streamline the process.
ParaSwapAMM ParaSwap integration contract. Can be used by OneStepLeverage, OneStepLeverageStETH and FlashMintLiquidator.
BalancerAMM Balancer integration contract. Can be used by OneStepLeverage, OneStepLeverageStETH and FlashMintLiquidator.

contracts's People

Contributors

mijovic avatar stefanvitor avatar iamvukasin avatar yuval-weiss avatar eltociear avatar

Forkers

all0x0contest

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.