{"id":13795173,"url":"https://github.com/makerdao/dss-deploy-scripts","last_synced_at":"2025-04-30T14:19:54.942Z","repository":{"id":34440211,"uuid":"164875340","full_name":"makerdao/dss-deploy-scripts","owner":"makerdao","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-11T23:48:55.000Z","size":695,"stargazers_count":49,"open_issues_count":7,"forks_count":61,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-30T16:51:09.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makerdao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-01-09T14:12:39.000Z","updated_at":"2024-09-27T22:51:42.000Z","dependencies_parsed_at":"2024-01-07T06:23:16.792Z","dependency_job_id":"d3514e41-2b7c-44e4-8bc8-51bcac9124f0","html_url":"https://github.com/makerdao/dss-deploy-scripts","commit_stats":null,"previous_names":[],"tags_count":76,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss-deploy-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss-deploy-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss-deploy-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss-deploy-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makerdao","download_url":"https://codeload.github.com/makerdao/dss-deploy-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249517935,"owners_count":21284861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T23:00:52.944Z","updated_at":"2025-04-18T16:31:01.650Z","avatar_url":"https://github.com/makerdao.png","language":"Shell","funding_links":[],"categories":["Projects","Projects Using Seth"],"sub_categories":["DappTools"],"readme":"# DSS deployment scripts\n\n![Build Status](https://github.com/makerdao/dss-deploy-scripts/actions/workflows/.github/workflows/tests.yaml/badge.svg?branch=master)\n\nA set of scripts that deploy [dss](http://github.com/makerdao/dss) to an\nEthereum chain of your choosing.\n\n## Description\n\nThis repo is composed of two steps:\n\n* Bash [scripts](/scripts) to modify the state of the base system\n\nAt the end of the first step, the addresses of deployed contracts are written to\nan `out/addresses.json` file. The scripts read those addresses and use `seth`\nand `dapp` to modify the deployment, using the values in `out/config.json`.\n\n## Installing\n\nThe only way to install everything necessary to deploy is Nix. Run\n\n```shell\nnix-shell --pure\n```\n\nto drop into a Bash shell with all dependency installed.\n\n### Ethereum node\n\nYou'll also need an Ethereum RPC node to connect to. Depending on your usecase, this\ncould be a local node (e.g. `dapp testnet`) or a remote one.\n\n## Configuration\n\nThere are 2 main pieces of configuration necessary for a deployment:\n\n* Ethereum account configuration\n* Chain configuration\n\n#### Account configuration\n\n`seth` relies on the presence of environment variables to know which Ethereum account to\nuse, which RPC server to talk to, etc.\n\nIf you're using `nix-shell`, these variables are set automatically for you in\n[shell.nix](./shell.nix).\n\nBut you can also configure the below variables manually:\n\n- `ETH_FROM`: address of deployment account\n- `ETH_PASSWORD`: path of account password file\n- `ETH_KEYSTORE`: keystore path\n- `ETH_RPC_URL`: URL of the RPC node\n\n### Chain configuration\n\nSome networks have a default config file at `config/\u003cNETWORK\u003e.json`, which will be used if non custom config values are set.\nA config file can be passed via param with flag `-f` allowing to execute the script in any network (e.g. `dss-deploy testchain -f \u003cCONFIG_FILE_PATH\u003e`).\nAs other option, custom config values can be loaded as an environment variable called `DDS_CONFIG_VALUES`.\nFile passed by parameter overwrites the environment variable.\n\nBelow is the expected structure of such a config file:\n\n```json\n{\n  \"description\": \"\",\n  \"omniaFromAddr\": \"\u003cAddress being used by Omnia Service (only for testchain)\u003e\",\n  \"omniaAmount\": \"\u003cAmount in ETH to be sent to Omnia Address (only for testchain)\u003e\",\n  \"pauseDelay\": \"\u003cDelay of Pause contract in seconds\u003e\",\n  \"vat_line\": \"\u003cGeneral debt ceiling in DAI unit\u003e\",\n  \"vow_wait\": \"\u003cFlop delay in seconds\u003e\",\n  \"vow_sump\": \"\u003cFlop fixed bid size in DAI unit\u003e\",\n  \"vow_dump\": \"\u003cFlop initial lot size in MKR unit\u003e\",\n  \"vow_bump\": \"\u003cFlap fixed lot size in DAI unit\u003e\",\n  \"vow_hump\": \"\u003cFlap Surplus buffer in DAI unit\u003e\",\n  \"cat_box\": \"\u003cMax total DAI needed to cover all debt plus penalty fees on active Flip auctions in DAI unit\u003e\",\n  \"dog_hole\": \"\u003cMax total DAI needed to cover all debt plus penalty fees on active Clip auctions in DAI unit\u003e\",\n  \"jug_base\": \"\u003cBase component of stability fee in percentage per year (e.g. 2.5)\u003e\",\n  \"pot_dsr\": \"\u003cDai Savings Rate in percentage per year (e.g. 2.5)\u003e\",\n  \"cure_wait\": \"\u003cCure cooldown period in seconds\u003e\",\n  \"end_wait\": \"\u003cGlobal Settlement cooldown period in seconds\u003e\",\n  \"esm_pit\": \"\u003cPit address to send MKR to be burnt when ESM is fired\u003e\",\n  \"esm_min\": \"\u003cMinimum amount to trigger ESM in MKR unit\u003e\",\n  \"flap_beg\": \"\u003cMinimum bid increase in percentage (e.g. 5.5)\u003e\",\n  \"flap_ttl\": \"\u003cMax time between bids in seconds\u003e\",\n  \"flap_tau\": \"\u003cMax auction duration in seconds\u003e\",\n  \"flop_beg\": \"\u003cMinimum bid increase in percentage (e.g. 5.5)\u003e\",\n  \"flop_pad\": \"\u003cIncrease of lot size after `tick` in percentage (e.g. 50)\u003e\",\n  \"flop_ttl\": \"\u003cMax time between bids in seconds\u003e\",\n  \"flop_tau\": \"\u003cMax auction duration in seconds\u003e\",\n  \"flap_lid\": \"\u003cMax amount of DAI that can be put up for sale at the same time in DAI unit (e.g. 1000000)\u003e\",\n  \"flash_max\": \"\u003cMax DAI can be borrowed from flash loan module in DAI unit (e.g. 1000000)\u003e\",\n  \"import\": {\n    \"gov\": \"\u003cGOV token address (if there is an existing one to import)\u003e note: make sure to mint enough tokens for launch\",\n    \"authority\": \"\u003cAuthority address (if there is an existing one to import)\u003e note: make sure to launch MCD_ADMIN\",\n    \"proxyRegistry\": \"\u003cProxy Registry address (if there is an existing one to import)\u003e\",\n    \"faucet\": \"\u003cFaucet address (if there is an existing one to import)\u003e\"\n  },\n  \"tokens\": {\n    \"\u003cETH|COL\u003e\": {\n      \"import\": {\n        \"gem\": \"\u003cGem token address (if there is an existing one to import)\u003e\",\n        \"pip\": \"\u003cPrice feed address (if there is an existing one to import)\u003e\"\n      },\n      \"gemDeploy\": { // Only used if there is not a gem imported\n        \"src\": \"\u003cREPO/CONTRACT (e.g. dss-gem-joins/GemJoin2)\u003e\",\n        \"params\": [\u003cAny params to be passed to the constructor of the token in its native form (e.g. amounts in wei or strings in hex encoding)\u003e],\n        \"faucetSupply\": \"\u003cAmount of token to be transferred to the faucet\u003e\",\n        \"faucetAmount\": \"\u003cAmount of token to be obtained in each faucet gulp (only if a new faucet is deployed)\u003e\"\n      },\n      \"joinDeploy\": { // Mandatory always\n        \"src\": \"\u003cGemJoin/GemJoin2/GemJoinX\u003e\",\n        \"extraParams\": [\u003cAny extra params to be passed to the constructor of the join in its native form (e.g. amounts in wei or strings in hex encoding)\u003e]\n      },\n      \"pipDeploy\": { // Only used if there is not a pip imported\n        \"osmDelay\": \"\u003cTime in seconds for the OSM delay\u003e\",\n        \"type\": \"\u003cmedian|value\u003e\",\n        \"price\": \"\u003cInitial oracle price (only if type == \"value\")\u003e\",\n        \"signers\": [\n            \u003cSet of signer addreeses (only if type == \"median\")\u003e\n        ]\n      },\n      \"ilks\": {\n        \"A\": {\n          \"mat\": \"\u003cLiquidation ratio value in percentage (e.g. 150)\u003e\",\n          \"line\": \"\u003cDebt ceiling value in DAI unit (won't be used if autoLine is \u003e 0)\u003e\",\n          \"autoLine\": \"\u003cMax debt ceiling value in DAI unit (for DssAutoLine IAM)\u003e\",\n          \"autoLineGap\": \"\u003cValue to set the ceiling over the current ilk debt in DAI unit (for DssAutoLine IAM)\u003e\",\n          \"autoLineTtl\": \"\u003cTime between debt ceiling increments (for DssAutoLine IAM)\u003e\",\n          \"dust\": \"\u003cMin amount of debt a CDP can hold in DAI unit\u003e\"\n          \"duty\": \"\u003cCollateral component of stability fee in percentage per year (e.g. 2.5)\u003e\",\n          \"flipDeploy\": {\n            \"chop\": \"\u003cLiquidation penalty value in percentage (e.g. 12.5)\u003e\",\n            \"dunk\": \"\u003cLiquidation Quantity in DAI Unit\u003e\",\n            \"beg\": \"\u003cMinimum bid increase in percentage (e.g. 5.5)\u003e\",\n            \"ttl\": \"\u003cMax time between bids in seconds\u003e\",\n            \"tau\": \"\u003cMax auction duration in seconds\u003e\"\n          },\n          \"clipDeploy\": { // Will be used only if there isn't a flipDeploy\n            \"chop\": \"\u003cLiquidation penalty value in percentage (e.g. 12.5)\u003e\",\n            \"hole\": \"\u003cMax DAI needed to cover debt+fees of active auctions per ilk (e.g. 100,000 DAI)\u003e\",\n            \"chip\": \"\u003cPercentage of due to suck from vow to incentivize keepers (e.g. 2%)\u003e\",\n            \"tip\": \"\u003cFlat fee to suck from vow to incentivize keepers (e.g. 100 DAI)\u003e\",\n            \"buf\": \"\u003cMultiplicative factor to increase starting price (e.g. 125%)\u003e\",\n            \"tail\": \"\u003cTime elapsed before auction reset in seconds\u003e\",\n            \"cusp\": \"\u003cPercentage taken for the new price before auction reset (e.g. 30%)\u003e\",\n            \"calc\": {\n              \"type\": \"LinearDecrease/StairstepExponentialDecrease/ExponentialDecrease\",\n              \"tau\":  \"\u003cTime after auction start when the price reaches zero in seconds (LinearDecrease)\u003e\",\n              \"step\": \"\u003cLength of time between price drops in seconds (StairstepExponentialDecrease)\u003e\",\n              \"cut\":  \"\u003cPercentage to be taken as new price per step (e.g. 99%, which is 1% drop) (StairstepExponentialDecrease/ExponentialDecrease)\u003e\"\n            },\n            \"cm_tolerance\": \"\u003cPercentage of previous price which a drop would enable anyone to be able to circuit break the liquidator via ClipperMom (e.g. 50%)\u003e\"\n          }\n        }\n      }\n    }\n  }\n}\n```\nNOTE: Make sure to mint enough (threshold is 80,000 MKR) tokens for launch if you are providing it in `config.gov`:\n```\n    sethSend \"$MCD_GOV\" 'mint(address,uint256)' \"$ETH_FROM\" \"$(seth --to-uint256 \"$(seth --to-wei 1000000 ETH)\")\"\n```\nNOTE: Make sure to `launch` MCD_ADMIN if you are providing it in `config.authority`.\n```\n    # lock enough MKR (80,000 MKR threshold)\n    sethSend \"$MCD_GOV\" \"approve(address,uint256)\" \"$MCD_ADM\" \"$(seth --to-uint256 \"$(seth --to-wei 80000 ETH)\")\"\n    sethSend \"$MCD_ADM\" \"lock(uint256)\" \"$(seth --to-uint256 \"$(seth --to-wei 80000 ETH)\")\"\n    sethSend \"$MCD_ADM\" \"vote(address[])\" \"[0x0000000000000000000000000000000000000000]\"\n    sethSend \"$MCD_ADM\" \"launch()\"\n```\n\n## Default config files\n\nCurrently, there are default config files for 3 networks:\n\n- a local testchain (e.g. `dapp testnet`)\n- Goerli\n- Mainnet\n\n### Deploy on local testchain with default config file\n\n`dss-deploy testchain`\n\nIt is possible to pass a value to define a testing scenario via `-c` flag (e.g. `dss-deploy testchain -c crash-bite`)\n\nThe only case currently available is:\n\n- `crash-bite`\n\n### Deploy on Goerli with default config file\n\n`dss-deploy goerli`\n\n### Deploy on Mainnet with default config file\n\n`dss-deploy main`\n\n### Deploy on any network passing a custom config file\n\n`dss-deploy \u003cNETWORK\u003e -f \u003cCONFIG_FILE_PATH\u003e`\n\n### Output\n\nSuccessful deployments save their output to the following files:\n\n- `out/addresses.json`: addresses of all deployed contracts\n- `out/config.json`: copy of the configuration file used for the deployment\n- `out/abi/`: JSON representation of the ABIs of all deployed contracts\n- `out/bin/`: .bin and .bin-runtime files of all deployed contracts\n- `out/meta/`: meta.json files of all deployed contracts\n- `out/dss-\u003cNETWORK\u003e.log`: output log of deployment\n\n### Helper scripts\n\nThe `auth-checker` script loads the addresses from `out/addresses.json` and the config file from `out/config.json` and verifies that the deployed authorizations match what is expected.\n\n## Nix\n\nTo enable full reproducibility of our deployments, we use Nix.\n\nThis command will drop you in a shell with all dependencies and environment\nvariables definend:\n\n```shell\nnix-shell --pure\n```\n\nYou can even run deploy scripts without having to clone this repo:\n\n```shell\nnix run -f https://github.com/makerdao/dss-deploy-scripts/tarball/master -c dss-deploy testchain\n```\n\nDependencies are managed through a central repository referenced in\n[`nix/pkgs.nix`](nix/pkgs.nix) and the main Nix expression to build this\nrepo is in [`default.nix`](default.nix).\n\n## Smart Contract Dependencies\n\nTo update smart contract dependencies use `dapp2nix`:\n\n```shell\nnix-shell --pure\ndapp2nix help\ndapp2nix list\ndapp2nix up vote-proxy \u003cCOMMIT_HASH\u003e\n```\n\nTo clone smart contract dependencies into working directory run:\n\n```shell\ndapp2nix clone-recursive contracts\n```\n\n## Additional Documentation\n\n- `dss-deploy` [source code](https://github.com/makerdao/dss-deploy)\n- `dss` is documented in the [wiki](https://github.com/makerdao/dss/wiki) and in [DEVELOPING.md](https://github.com/makerdao/dss/blob/master/DEVELOPING.md)\n\n## TODO\n\n- More cases to test scenarios for testchain script\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fdss-deploy-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakerdao%2Fdss-deploy-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fdss-deploy-scripts/lists"}