This repository serves as a playground to experiment with more fundamental changes to the vanilla DCHF protocol.
The code in this repository is experimental and not production-ready so please do not deploy any contract contained in this repository to mainnet.
The following experiments are made in this repository:
- Remove the Stability Pool. Instead, execute liquidations through external liquidators which need to repay the debt of a risky trove during a liquidation. In order to facilitate liquidations, a FlashMinter of DCHF has been created
contracts/Leverage/FlashMinterDCHF.sol
- Remove the Recovery Mode. A new variable LIMIT_CR is added in DfrancParameters
contracts/DfrancParameters.sol
If the TCR is below than LIMIT_CR just not new troves under LIMIT_CR can be opened, and also is not allowed debt increases or collateral withdrawals, just debt repayments or collateral top ups. - MCR (Minimum Collateral Ratio) has been replaced by two new variables to increase flexibility. These are LIQ_MCR (Minimum Liquidation CR) and BORROW_MCR (Minimum CR for Borrowing)
- Remove the staking pool. The fees collected go to the Fee Contract
contracts/FeeContract.sol
and this contract processes them by swapping DCHF for MON and burning it via sending them to the Burn Contractcontracts/BurnContract.sol
- DefaultPool and Gas Compensation have been deleted in this version.
- TroveManager and TroveManagerHelpers have been merged in TroveManager
contracts/TroveManager.sol
Do the following steps to deploy the whole infrastructure:
- Run
npm i
- Create a
secrets.js
from the templatesecrets.js.template
file. Add theRINKEBY_PRIVATE_KEY
, theRINKEBY_RPC_URL
and theETHERSCAN_API_KEY
for rinkeby deployment (todo: mainnet deployment) - In
deployment/deploymentParams/deploymentParams.rinkeby.js
(todo mainnet deployment) it's needed to replace the values between the lines 16-18 to the Deployer's wallet (accordingly to the private key set onsecrets.js
file). All the oracles addresses are correct and should not be changed. Also the valueGAS_PRICE
is set correctly and you risk getting stuck in the deployment if the value is changed. - Run
npx hardhat run deployment/deploymentScripts/rinkebyDeployment.js --network rinkeby
(todo mainnet deployment), to deploy the contracts. - You can check and verify the contracts by checking the output file in
deployment/output/rinkebyDeploymentOutput.json
.
The contract DfrancParameters.sol contains all the parameters from the system and should not be modified. However, the system is set to block redemptions in it's first 14 days. For testing purposes, it's recommended to change it for a lower value. You can find it on the line 15.