{"id":22238381,"url":"https://github.com/raft-fi/contracts","last_synced_at":"2025-07-27T23:30:59.280Z","repository":{"id":164177307,"uuid":"613329750","full_name":"raft-fi/contracts","owner":"raft-fi","description":"Smart contracts for the Raft protocol","archived":false,"fork":false,"pushed_at":"2023-10-17T13:43:23.000Z","size":8357,"stargazers_count":32,"open_issues_count":8,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-10-17T15:11:21.150Z","etag":null,"topics":["defi","ethereum","solidity","solidity-contracts","stablecoin","web3"],"latest_commit_sha":null,"homepage":"http://raft.fi/","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raft-fi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-13T11:10:42.000Z","updated_at":"2023-09-15T04:47:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"d792a42e-be1e-471c-b032-1ae1e4d9a33f","html_url":"https://github.com/raft-fi/contracts","commit_stats":null,"previous_names":[],"tags_count":5,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raft-fi%2Fcontracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raft-fi%2Fcontracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raft-fi%2Fcontracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raft-fi%2Fcontracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raft-fi","download_url":"https://codeload.github.com/raft-fi/contracts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227843544,"owners_count":17827988,"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":["defi","ethereum","solidity","solidity-contracts","stablecoin","web3"],"created_at":"2024-12-03T03:16:26.775Z","updated_at":"2024-12-03T03:16:30.256Z","avatar_url":"https://github.com/raft-fi.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raft: Smart Contracts\n\nRaft is an immutable, decentralized lending protocol that allows people to take out stablecoin loans against capital-efficient collateral.\n\nR 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.\n\nThis repository contains the Raft smart contracts written in Solidity. To learn more about Raft, please visit [our website](https://raft.fi) and [docs](https://docs.raft.fi).\n\n## Getting Started\n\n### Prerequisites\n\nTo build and test the Raft smart contracts, you will need the following:\n\n- [Solidity](https://docs.soliditylang.org/en/v0.8.19/installing-solidity.html)\n- [Foundry](https://github.com/foundry-rs/foundry)\n- [Node.js](https://nodejs.org/en/)\n- [Yarn](https://yarnpkg.com/)\n- [Slither](https://github.com/crytic/slither)\n\n### Installation\n\nClone the repository with its submodules, set up\n[Foundry](https://book.getfoundry.sh/getting-started/installation), and install the dependencies via Yarn:\n\n```bash\nyarn install\n```\n\n### Testing\n\nTo run the tests, run the following command:\n\n```bash\nforge test\n```\n\n### Static Analysis\n\nTo run the Slither static analysis tool, run the following command:\n\n```bash\nslither .\n```\n\n## Contracts\n\n### Core Contracts\n\n| **Contract**                                                                     | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`PositionManager`](contracts/PositionManager.sol)                               | The entry point for managing [positions](https://docs.raft.fi/how-it-works/position). It also handles the logic for [borrowing](https://docs.raft.fi/how-it-works/borrowing) R tokens and [repayment](https://docs.raft.fi/how-it-works/returning/repayment) of the debt, as well as [liquidations](https://docs.raft.fi/how-it-works/returning/liquidation) and [redemptions](https://docs.raft.fi/how-it-works/returning/redemption). |\n| [`RToken`](contracts/RToken.sol)                                                 | An ERC-20 token designed to [retain a value of 1 USD](https://docs.raft.fi/about-r). R can be minted and burnt only by `PositionManager`.                                                                                                                                                                                                                                                                                               |\n| [`ERC20Indexable`](contracts/ERC20Indexable.sol)                                 | Rebase token which is used as the debt token implementation.                                                                                                                                                                                                                                                                                                                                                                            |\n| [`SplitLiquidationCollateral`](contracts/SplitLiquidationCollateral.sol)         | Used by `PositionManager` to calculate how liquidated collateral should be split between the liquidator and the protocol.                                                                                                                                                                                                                                                                                                               |\n| [`PriceFeed`](contracts/PriceFeed.sol)                                           | Retrieves asset prices from a primary oracle, using a secondary oracle as a fallback when the primary is unavailable or compromised                                                                                                                                                                                                                                                                                                     |\n| [`ChainlinkPriceOracleWstETH`](contracts/Oracles/ChainlinkPriceOracleWstETH.sol) | Chainlink oracle integration contract.                                                                                                                                                                                                                                                                                                                                                                                                  |\n| [`TellorPriceOracleWstETH`](contracts/Oracles/TellorPriceOracleWstETH.sol)       | Tellor oracle integration contract.                                                                                                                                                                                                                                                                                                                                                                                                     |\n\n### Periphery Contracts\n\n| **Contract**                                                 | **Description**                                                                                                                                                                      |\n| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| [`PositionManagerStETH`](contracts/PositionManagerStETH.sol) | 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`. |\n| [`OneStepLeverage`](contracts/OneStepLeverage.sol)           | Facilitates opening, closing, or adjusting leverage on wstETH positions with a single transaction, employing flash mint to streamline the process and reduce transaction complexity. |\n| [`OneStepLeverageStETH`](contracts/OneStepLeverageStETH.sol) | Extends the functionality of `OneStepLeverage` to allow using ETH and stETH.                                                                                                         |\n| [`FlashMintLiquidator`](contracts/FlashMintLiquidator.sol)   | Facilitates the liquidation of undercollateralized positions in a single transaction, employing flash loans to streamline the process.                                               |\n| [`ParaSwapAMM`](contracts/AMMs/ParaSwapAMM.sol)              | ParaSwap integration contract. Can be used by `OneStepLeverage`, `OneStepLeverageStETH` and `FlashMintLiquidator`.                                                                   |\n| [`BalancerAMM`](contracts/AMMs/BalancerAMM.sol)              | Balancer integration contract. Can be used by `OneStepLeverage`, `OneStepLeverageStETH` and `FlashMintLiquidator`.                                                                   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraft-fi%2Fcontracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraft-fi%2Fcontracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraft-fi%2Fcontracts/lists"}