Giter VIP home page Giter VIP logo

equidime's Introduction

EquiDime Protocol

The EquiDime Protocol is a decentralized stablecoin system designed to be minimal and maintain a 1 token = $1 peg. The system is overcollateralized, ensuring that the value of all collateral is always greater than the value of all issued stablecoins (EDC). Just MVP Protocol based on DAI token Protocol

Overview

The protocol consists of four main contracts:

  1. EquiDime.sol - The ERC20 token contract for EquiDime (EDC).
  2. CollateralActions.sol - Manages collateral deposits and redemptions.
  3. Liquidator.sol - Handles liquidation of undercollateralized positions.

Contracts

EquiDime.sol

The EquiDime contract defines the stablecoin (EDC). It includes functions to mint and burn tokens, which can only be called by the collateralActions contract.

CollateralActions.sol

The CollateralActions contract handles the depositing and redeeming of collateral. It ensures that only the collateralActions contract can call its functions, maintaining security and proper flow of operations.

Liquidator.sol

The Liquidator contract manages the liquidation process. It interacts with the CollateralActions contract to redeem collateral and with the EquiDime contract to burn the necessary amount of tokens.

Usage

Deposit Collateral and Mint EDC

Users can deposit collateral and mint EDC by calling the depositCollateralAndMintEDC function:

collateralActions.depositCollateralAndMintEDC(tokenCollateralAddress, amountCollateral);

Mint EDC

Users can mint additional EDC (if eligible) by calling the mintEDC function:

collateralActions.mintEDC(amount);

Burn EDC

Users can burn EDC by calling the burnEDC function:

collateralActions.burnEDC(amount);

Liquidate Under-collateralized Position

Liquidators can liquidate an under-collateralized position by calling the liquidate function:

collateralActions.liquidate(user, token, debtToCover);

Security

  • Only the collateralActions contract can call sensitive functions in CollateralActions and EquiDime.
  • Reentrancy guards are in place to prevent reentrancy attacks.
  • Proper checks are implemented to ensure that health factors and collateralization are maintained.

Contributing

You welcome dude! Fork the repository (Learn , play with it, miss things) and submit pull requests for any improvements or bug fixes.

License

This project is licensed under the MIT License.


This README provides a concise overview of the EquiDime Protocol, its components, usage.

Im using Foundry .cheak the book.

equidime's People

Contributors

0x7lm avatar binioosini 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.