Coder Social home page Coder Social logo

booyoun-kim / compound-protocol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from creamfi/compound-protocol

0.0 0.0 0.0 6.31 MB

The Compound On-Chain Protocol

Home Page: https://compound.finance/developers

License: BSD 3-Clause "New" or "Revised" License

Shell 0.34% JavaScript 21.96% TypeScript 24.22% Makefile 0.15% Dockerfile 0.03% Solidity 52.91% PEG.js 0.38%

compound-protocol's Introduction

CircleCI

Cream Finance

C.R.E.A.M. Finance is a blockchain agnostic, decentralized peer to peer lending platform based on a fork of Compound Finance.

C.R.E.A.M. bridges liquidity across underserved assets by providing algorithmic money markets to these underserved assets. Users can supply any supported assets and use these supplied assets as collateral to borrow any other supported assets. C.R.E.A.M. has launched on Ethereum and Binance Smart Chain.

Before getting started with this repo, please read the Compound protocol repo

Installation

git clone https://github.com/CreamFi/compound-protocol
cd compound-protocol
yarn install --lock-file # or `npm install`

Building

yarn compile

Testing

Jest contract tests are defined under the tests directory. To run the tests run:

yarn test

Branch

master - deployed on ethereum mainnet

bsc - deployed on binance smart chain

cream-v2 - (ironbank) deployed on ethereum mainnet

fantom_time_based - deployed on fantom opera

polygon - depolyed on polygon

arbitrum - deployed on arbitrum

avalanche - deployed on avalanche

Audits

C.R.E.A.M. Finance smart contracts have been audited by Trail of Bits. The audit report is available on Trail of Bits publications repo.

Change Logs

C.R.E.A.M. Finance forked from this commit 7561dcf5964527dbf2f3c7cd670775b3c6f7e378 of Compound Finance, Cream continues to add new features and submits pull requests back to Compound as appropriate. Below is a high level summary of the changes:

  • Add borrow cap feature, this feature is cherry picked from Compound Finance compound-finance#65

    • Add a borrow cap check in Comptroller's borrowAllowed hook, disallow further borrowing if an market's totalBorrows reaches its borrow cap
  • Add supply cap feature, implemented in Comptroller.sol, CCapableErc20.sol

    • Add a supply cap check in Comptroller's mintAllowed hook, disallow further minting (supplying) if an market's cash + totalBorrows reaches its supply cap
    • CCapableErc20 tracks cash by itself instead of using balanceOf of underlying token. This avoids direct transfering to cToken to manipulate cash.
    • Need to update cToken's implementation to enable this feature.
  • Add collateral cap feature, implemented in Comptroller.sol, CCollateralCapErc20.sol

    • Add a collateral cap to determine the maximum balance to be considered as collateral. If the cap is reached, users could still supply the asset but it can't be used as collateral.
    • The maximum borrow power of this kind of asset is roughly collateralCap * collateralFactor.
    • Need to update cToken's implementation to enable this feature.
  • Add CWrappedNative to replace old CEther

    • CWrappedNative could support both the native token and the wrapped native token.
    • Users could choose the native token or the wrapped native token when supplying / borrowing / redeeming / repaying.
  • Support earning sushi LP tokens. Implemented in CSLPDelegate.sol

    • CSLP deposit/withdraw sushi lp token to/from sushi MasterChef when doTransferIn/doTrasnferOut
    • Suppliers can use sushi LP tokens as collateral
    • Suppliers can claim sushi reward or borrow interest
  • Support claiming COMP earned from holding CTokens. Implemented in CCTokenDelegate.sol

    • CCToken collects Compound reward and supplier can use claimComp function to claim their reward

BSC

  • Update price oracle implementation to support BAND.
  • Support protocol to protocol borrowing without collateral, this gives whitelisted protocol borrows up to credit limit without collateral.
    • add credit limit in Comptroller.sol
    • When setup a credit limit, it also needs to specify the borrow markets.

IronBank

  • Support protocol to protocol borrowing without collateral, this gives whitelisted protocol borrows up to credit limit without collateral.
    • add credit limit in Comptroller.sol
    • remove repayBorrowBehalf, so that protocol can track their debt easily.
  • Patch as part of the update in the Alpha Homora v2 exploit, excluding stolen funds from interest calculation.
    • CToken.sol on cream-v2-no-interest branch
    • Apply on cyWETH, cyUSDC, cyUSDT, cyDAI

compound-protocol's People

Contributors

bun919tw avatar jeremyhd avatar hayesgm avatar jflatow avatar 0xyolo avatar stanleyding avatar stitetsati avatar 0age avatar antoncoding avatar coburncoburn avatar jchittoda avatar maxwolff avatar vlddm 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.