Giter Site home page Giter Site logo

kittyfi's Introduction

First Flight #?: KittyFi

Contest Details

Prize Pool

  • High - 100xp

  • Medium - 20xp

  • Low - 2xp

  • Starts:

  • Ends:

Stats

  • nSLOC: 224
  • Complexity Score: 203

Disclaimer

This code was created for Codehawks as a first flight. It is made with bugs and flaws on purpose. Don't use any part of this code without reviewing it and audit it.

About

KittyFi, a EUR pegged stablecoin based protocol which proactively maintains the user's deposited collateral to earn yield on it via Aave protocol.
With KittyFi, the collateral deposited by user will not just remain in there for backing the KittyCoin but will earn yield on it via Aave protocol.
By utilizing the interest earned on collateral, the protocol will reduce the risk of user getting liquidated by equally allocating the interest earned on collateral to every user in the pool.

KittyCoin

The stable coin of KittyFi protocol which is pegged to EUR and can be minted by supplying collateral and minting via KittyPool.

KittyPool

This smart contract is assigned the role to allow user to deposit collateral and mint KittyCoin from it. The KittyPool contract routes the call to the respective vault for deposit and withdrawal fo collateral which is created for every collateral token used in protocol.
The user is required to main overcollateralization in order to prevent liquidation of their pawsition (I mean position (meows, purrss)).
The pool also handles liquidations, the user gets some percentage reward on the collateral liquidated from the user's vault.

KittyVault

Every collateral token have their own vault deployed via KittyPool contract. The vault is responsible for maintaining the collateral deposited by user and supply it to Aave protocol to earn yield on it. The KittyVault when queried with the amount of collateral present in it or collateral of user, then it will return the interest earned total collateral.

Actors

  • User - Performing deposit and withdrawal of collateral along with minting and burning of KittyCoin
  • Meowntainer - Responsible for performing executions to supply and withdraw collateral from Aave protocol on KittyVault

Getting Started

Requirements

  • git
    • You'll know you did it right if you can run git --version and you see a response like git version x.x.x
  • foundry
    • You'll know you did it right if you can run forge --version and you see a response like forge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)

Installation

  1. Clone the repository and compile contracts
git clone https://github.com/cyfrin/
cd
make

Build

make build

Test

make test

Note

As custom errors are used in require statements, therefore don't forgot to use --via-ir flag in command

Audit Scope Details

  • Commit Hash:
  • In Scope:
src/KittyCoin.sol
src/KittyPool.sol
src/KittyVault.sol

Compatibilities

  • Solc Version: 0.8.26
  • Chain(s) to deploy contract to:
    • Ethereum
    • Polygon
    • Avalanche
  • Tokens that can be used as collateral: All tokens avaiable for lending on Aave pool on respective chains except for Fee on Transfer tokens and Rebasing tokens.

Known Issues and Assumptions

  • Trusted roles - Meowntainer (You trust your cat, then you have to trust Meowntainer, purrrr)
  • The vaults array used in KittyPool will not have a length more than 20, that means that are at most 20 collateral tokens that will be used in protocol.

kittyfi's People

Contributors

shikhar229169 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.