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
The protocol consists of four main contracts:
EquiDime.sol
- The ERC20 token contract for EquiDime (EDC).CollateralActions.sol
- Manages collateral deposits and redemptions.Liquidator.sol
- Handles liquidation of undercollateralized positions.
The EquiDime
contract defines the stablecoin (EDC). It includes functions to mint and burn tokens, which can only be called by the collateralActions contract.
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.
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.
Users can deposit collateral and mint EDC by calling the depositCollateralAndMintEDC
function:
collateralActions.depositCollateralAndMintEDC(tokenCollateralAddress, amountCollateral);
Users can mint additional EDC (if eligible) by calling the mintEDC
function:
collateralActions.mintEDC(amount);
Users can burn EDC by calling the burnEDC
function:
collateralActions.burnEDC(amount);
Liquidators can liquidate an under-collateralized position by calling the liquidate
function:
collateralActions.liquidate(user, token, debtToCover);
- Only the collateralActions contract can call sensitive functions in
CollateralActions
andEquiDime
. - Reentrancy guards are in place to prevent reentrancy attacks.
- Proper checks are implemented to ensure that health factors and collateralization are maintained.
You welcome dude! Fork the repository (Learn , play with it, miss things) and submit pull requests for any improvements or bug fixes
.
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.