-
High - 100xp
-
Medium - 20xp
-
Low - 2xp
-
Starts:
-
Ends:
- nSLOC: 224
- Complexity Score: 203
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.
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.
The stable coin of KittyFi protocol which is pegged to EUR and can be minted by supplying collateral and minting via 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.
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.
User
- Performing deposit and withdrawal of collateral along with minting and burning of KittyCoinMeowntainer
- Responsible for performing executions to supply and withdraw collateral from Aave protocol on KittyVault
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- foundry
- You'll know you did it right if you can run
forge --version
and you see a response likeforge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)
- You'll know you did it right if you can run
- Clone the repository and compile contracts
git clone https://github.com/cyfrin/
cd
make
make build
make test
As custom errors are used in require statements, therefore don't forgot to use --via-ir
flag in command
- Commit Hash:
- In Scope:
src/KittyCoin.sol
src/KittyPool.sol
src/KittyVault.sol
- 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.
- 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.