This is inspired by MakerDAO
Dai Stablecoin System
. A Stablecoin backed by XDC and utilizes the potential of the XDC Network.
DAI crypto is crypto-collateralized because it’s backed by XDC. The ratio in which DAI converts to XDC varies, though it’s usually hovering around 1.5 XDC to 1 DAI.
Allow users interact with the system to
- Open Vaults (formerly CDPs collateralized debt positions)
- Borrow DAI by locking XDC as collateral
- Payback DAI and unlock collateral
- Ubuntu 20.04
- nixos
- dapptools
- mcd
-
install python
sudo apt install python3-pip
-
install nixos
curl -L https://nixos.org/nix/install | sh . "$HOME/.nix-profile/etc/profile.d/nix.sh"
-
install dapp tool
curl https://dapp.tools/install | sh
-
install mcd
sudo curl https://raw.githubusercontent.com/makerdao/mcd-cli/master/install.sh | sh
- Import deployer account
rm ~/keys/deployer/*
export ETH_KEYSTORE=~/keys/deployer
export ETH_PASSWORD=/dev/null
ethsign import
cd ds-weth
dapp --use solc:0.5.17 build
source ../xdc-scripts/apothem.setup-env.sh
dapp create WXDC
cd dss
export xdcPrice=0.02
export PIP=$(dapp create DSValue)
seth send $PIP 'poke(bytes32)' $(seth --to-uint256 "$(seth --to-wei $xdcPrice ETH)")
- Configure
WXDC
andPIP
toapothem.json
- Configure environment variables in
./xdc-scripts/apothem.setup-env.sh
- Deploy dss
cd dss-deploy-scripts export PATH="$PATH:/nix/var/nix/profiles/default/bin" nix-shell --pure source ../xdc-scripts/apothem.setup-env.sh dss-deploy apothem
Configure environment variables in ./xdc-scripts/apothem.setup-env.sh
Example:
export SETH_CHAIN=
export ETH_KEYSTORE=~/keys/deployer
export ETH_PASSWORD=/dev/null
export ETH_FROM=0xB568aa07085319B731369FeAF4a7da29F2C4c341
export ETH_RPC_URL=https://erpc.apothem.network/
export ETH_GAS=40000000
cd xdc-scripts
source apothem.setup-env.sh
bash open-vault.sh
cd xdc-scripts
source apothem.setup-env.sh
bash pay-back.sh
All contracts are deployed to Apothem testnet and XDC mainnet at deployed-contracts.md
- https://github.com/makerdao/awesome-makerdao
- https://github.com/makerdao/dss-deploy-scripts
- https://github.com/makerdao/developerguides
MIT License