This is a Solidity implementation of this beautiful paper from IOHK: https://eprint.iacr.org/2021/1069.pdf
We use WBTC as the Base Coin, DJED as the Stable Coin and SHEN as the Reserve Coin.
Because Bitcoin is not as volatile as other coins I moved the rmax to 700% and rmin to 300%
Clone this repo
git clone https://github.com/Kuly14/DJED.gitInstall dependencies
yarnCreate .env file and specify your Rinkeby Rpc Url, Mainnet Rpc Url and your Private key.
After installing dependencies run
yarn hardhat testTo run solidity-coverage
yarn hardhat coverageFirst we deploy Djed, Shen and the ICO. The script automatically mints shen for the ico. It will mint 10 000 000 tokens and the price is set to 4.5$ during the ico.
yarn hardhat --network mainnet deploy --tags firstAfter the ICO is over deploy the main controller that the users will interact with. If you deploy before the ICO is over the transfer_tx won't go through and you will have to do it manually.
yarn hardhat --network mainnet deploy --tags secondThis will deploy the controller, transfer the WBTC from the ICO and transfers ownership of the tokens to the controller. After this step the stable coin is live and can be freely traded.