Spell contract to deploy a new collateral type in the DSS system.
dss-deploy
source codedss
source code
- seth/dapp (https://dapp.tools/)
- Have a DSS instance running
- Export contract variables
export TOKEN=<TOKEN ADDR>
export PIP=<TOKEN/USD FEED ADDR>
export ILK="$(seth --to-bytes32 "$(seth --from-ascii "<COLLATERAL NAME>")")"
export MCD_VAT=<VAT ADDR>
export MCD_CAT=<CAT ADDR>
export MCD_JUG=<JUG ADDR>
export MCD_SPOT=<SPOTTER ADDR>
export MCD_PAUSE=<PAUSE ADDR>
export MCD_PAUSE_PROXY=<PAUSE PROXY ADDR>
export MCD_ADM=<CHIEF ADDR>
export MCD_END=<END ADDR>
- Deploy Adapter (e.g. GemJoin)
export JOIN=$(dapp create GemJoin "$MCD_VAT" "$ILK" "$TOKEN")
- Deploy Flip Auction and set permissions (e.g. Flipper)
-
export FLIP=$(dapp create Flipper "$MCD_VAT" "$ILK")
-
seth send "$FLIP" 'rely(address)' "$MCD_PAUSE_PROXY"
-
seth send "$FLIP" 'deny(address)' "$ETH_FROM"
- Export New Collateral Type variables
export LINE=<DEBT CEILING VALUE>
(e.g. 5M DAI"$(seth --to-uint256 $(echo "5000000"*10^45 | bc))"
)export MAT=<LIQUIDATION RATIO VALUE>
(e.g. 150%"$(seth --to-uint256 $(echo "150"*10^25 | bc))"
)export DUTY=<STABILITY FEE VALUE>
(e.g. 1% yearly"$(seth --to-uint256 1000000000315522921573372069)"
)export CHOP=<LIQUIDATION PENALTY VALUE>
(e.g. 10%"$(seth --to-uint256 $(echo "110"*10^25 | bc))"
)export LUMP=<LIQUIDATION QUANTITY VALUE>
(e.g. 1K DAI"$(seth --to-uint256 $(echo "1000"*10^18 | bc))"
)
- Deploy Spell
export SPELL=$(seth send --create out/DssAddIlkSpell.bin 'DssAddIlkSpell(bytes32,address,address[8] memory,uint256[5] memory)' $ILK $MCD_PAUSE ["${MCD_VAT#0x}","${MCD_CAT#0x}","${MCD_JUG#0x}","${MCD_SPOT#0x}","${MCD_END#0x}","${JOIN#0x}","${PIP#0x}","${FLIP#0x}"] ["$LINE","$MAT","$DUTY","$CHOP","$LUMP"])
- Create slate
seth send "$MCD_ADM" 'etch(address[] memory)' ["${SPELL#0x}"]
-
Wait for the Spell to be elected
-
Schedule Spell
seth send "$SPELL" 'schedule()'
-
Wait for Pause delay
-
Cast Spell
seth send "$SPELL" 'cast()'