Git Product home page Git Product logo

protocol-core's Introduction

Protocol Core

Deployment address

Base Georli

Contract Name Addresses
Vault Contract 0xE2386C5eF4deC9d5815C60168e36c7153ba00D0C
Currency Contract (xNGN) 0xee2bDAE7896910c49BeA25106B9f8e9f4B671c82
Feed Contract 0x970066EE55DF2134D1b52451afb49034AE5Fa29a

Base Sepolia

Contract Name Addresses
Vault Contract 0x3d35807343CbF4fDb16E42297F2214f62848D032
Currency Contract (xNGN) 0xB8747e5cce01AA5a51021989BA11aE33097db485
Feed Contract 0xFBD26B871D55ba56B7a780eF1fF243Db7A3E81f4
Rate Contract 0x00A0BcB0e2099f4a0564c26e24eBfA866D3235D6

To install libraries needed, run:

forge install

To run tests, run:

forge test -vvv --gas-report

To run slither, run:

slither .

To start a local node, run:

anvil

To run deploy the deploy script, (be sure to have the parameters in ./deployConfigs/*.json/ needed for your script populated and also have an anvil instance running), run:

forge script script/deploy.s.sol:DeployScript --fork-url http://localhost:8545 --broadcast

Deploy Config

Meaning of parameters of the deploy configs

  • baseRate: The base rate of the protocol, should be the per second rate, e.g 1.5% would be ((uint256(1.5e18) / uint256(100)) / uint256(365 days), i.e 475646879.
  • collaterals: collateral types
    • collateralAddress: contract address of the given collateral on the given chain.
    • collateralRate: The collateral rate of the given collateral on the given chain, calculated same as baseRate.
    • liquidationThreshold: liquidation threshold of the given collateral, denominated in wad, where 1e18 == 100% and 0.5e18 == 50%.
    • liquidationBonus: liquidation bonus of the given collateral, denominated same as liquidationThreshold.
    • debtCeiling: debt ceiling of the currency for the given collateral.
    • collateralFloorPerPosition: minimum amount of collateral allowed to borrow against.

protocol-core's People

Contributors

amadimichael avatar meisterjustice avatar njokuscript avatar umesiqueen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

protocol-core's Issues

P

page

[Adapter Module]: Implement Collateral Token Adapter

Description

Create a token adapter contract that facilitates the movement of collateral tokens in and out of the system. The adapter should interact directly with the Vault Engine Contracts to manage collateral balances on vaults.

Tasks

  • Design the collateral token adapter contract interface
  • Implement method for depositing and locking collateral tokens within the adapter. The locked collateral should be represented in the Vault module
  • Implement method for withdrawing locked collateral tokens from the adapter
  • Integrate the adapter with the Vault Module Contracts. The adapter should call the Vault module to create a representation of the collateral tokens and also remove the representation as needed.
  • Write tests to ensure the functionality of the collateral token adapter

NB: This has previously been implemented here: https://github.com/Descent-Collective/protocol-core/blob/module/adapter/contracts/adapter.sol#L13

[Vault Module]: Refactor vault contract to only manage vault state

Description

Currently, the vault contract stores users' funds and interacts directly with the token contracts. We want to make sure that the vault is not making any external calls.

  • Vault should only be responsible for managing vault state(balances, collateralization ratio)
  • Introduce Vault IDs when creating vaults
  • Abstract out Liquidation function from Vault module

[Adapter Module]: Implement Metastable Token Adapter

Description

Create a token adapter contract that facilitates the burning and minting of metastable tokens. The adapter should interact directly with the Vault Contracts to manage metastable balances.

Tasks

  • Design the metastable token adapter contract interface
  • Implement functions for minting and burning of metastable tokens as well as representing the balance on the vault contracts
  • Integrate the adapter with the Vault Contracts
  • Write tests to ensure the functionality of the metastable token adapter

NB: This was previously implemented here: https://github.com/Descent-Collective/protocol-core/blob/module/adapter/contracts/adapter.sol#L89

[Adapter Module]: Implement Token Adapter Factory

Description

Create a factory contract that allows for the creation and management of multiple token adapters. The factory should enable the addition of new token adapters as needed.

Tasks

  • Design the token adapter factory contract interface
  • Implement functions for creating and registering new token adapters
  • Maintain a registry of available token adapters
  • Provide a mechanism for retrieving the appropriate token adapter based on the token type
  • Write tests to ensure the functionality of the token adapter factory

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.