dapp
- ethereum smart contract development framework to assist with building and testing smart contractsseth
- command-line interface to interact with ethereum networkshevm
- Haskell EVM implementation optimized to run solidity testsseth
and dapp
.GemJoin
Adapter.ilk
) to the Maker Protocol requires the addition of the following contracts, if they don’t already exist. GemJoin
adapter is the interface between the collateral token contract and the core accounting contract (Vat
). Its purpose is to abstract away all the particular features of a specific token, hence standardizing the token behavior before being debited in the Maker Protocol. It's similar to WETH, but rather than conforming ETH to an ERC20 standard, a GemJoin
adapter conforms XYZ token to Maker's internal balance standard (gem
). Each collateral has its own GemJoin
Adapter.GemJoin
Adapter.Flipper
contract is where collateral is sent when it is out for auction. Collateral is sourced from Vaults that are liquidated after they become undercollateralized. The sameFlipper
implementation is used for all collateral types.Median
contract maintains a whitelist of oracle price feeds authorized to post USD price updates for collateral supported in the Maker Protocol. The OSM
contract ensures that new collateral price values are delayed by a specific amount of time. The Oracle Team will handle the deployment of the Median
and OSM
, and, once configured, will share its addresses with the Smart Contract team to be called in the DssSpell
.ilk
) to the Maker Protocol requires an upgrade to different repositories in the dss
ecosystem, which are responsible for recreating Maker Protocol instances to be rigorously tested before mainnet inclusion. The two repos that are of most interest to you:dss-gem-joins
—This repository holds all GemJoin Adapters, apart from the original GemJoin held in dss, which are used with collateral tokens that need extra functionality or constraints. dss-gem-joins
also holds all collateral token contracts.dss-deploy-scripts
—This repository contains a set of scripts that deploy dss
to an Ethereum chain of your choosing. It reads the GemJoin
Adapters, and the token contracts from dss-gem-joins
. This contract is used to deploy fresh instances of the Maker Protocol on local testchains and public testnets. For pre-deployed systems, such as the latest version on Kovan and Mainnet, system upgrades are commissioned through Spells and will be described in the Deploy Contracts in section three. dss-proxy-actions
and dss-deploy-scripts
should be made after the Greenlight Governance Poll. Additionally, a confirmation of a successful Executive vote (i.e. cast
) should be appended as a comment before it is accepted as a new addition and merged into master
.ETH-B
): Then there is no need to develop a new adapter. It only requires adding the new ilk
to dss-deploy-scripts
; therefore, go directly to step 10d.BAT
is reccommended. Take care to capture the target token’s defining features.dss-deploy-scripts
. This is the moment that you want to deploy this token to kovan. You do this now so that if there are any changes you need to make to the token, you don’t have to go through the hassle of updating the dependency tree again. Since you deploy everything to kovan, you will need to acquire some kETH (kovan ETH) to deploy contracts and send transaction on kovan. You can ask for some kETH in the #dev channel on the makerdao rocket.chat server: https://chat.makerdao.com/channel/dev. To deploy this new token, try:dss-gem-joins
.GemJoin
adapter. Following this rubric, create a PR of your token addition in dss-gem-joins
. Go to Step 5. GemJoin
that addresses the needs of the new collateral tokendss-gem-joins
. Ensure that it gets mergeddss-proxy-actions
.dapp upgrade dss-gem-joins && git push
ETH-A
): dss-gem-joins
testchain-medians
.MedianTOKENUSD
(e.g. MedianCOMPUSD
) with a new wat
variable to this file.ETH-A
): < name >dss-deploy-scripts
.nix run -f https://github.com/icetan/dapp2nix/tarball/master -c dapp2nix up dss-gem-joins
nix run -f https://github.com/icetan/dapp2nix/tarball/master -c dapp2nix up dss-proxy-actions
nix run -f https://github.com/icetan/dapp2nix/tarball/master -c dapp2nix up testchain-medians
nix run -f https://github.com/icetan/dapp2nix/tarball/master -c dapp2nix dup
ETH-B
), you will not need to make a new deploy ilk script, and you can go straight to the last sub-step, which is to update the environment config files.deploy-ilk-token
and add it to this directory. dss-deploy-scripts
will pull the token contract and GemJoin
adapter from dss-gem-joins
, use the latest auction contract (Flipper
), use an OSM, configure all authorizations, deploy all contracts, and enable the collateral type in a fresh instance of the Maker Protocol.GemJoin
. Remember, your new collateral is going to use a previous adapter or the one you madechmod +x deploy-ilk-token
kovan.json
file, under gem
, you can use the token address we got from the kovan deploy earlier.pip
that’s needed from the Oracle team. This contract usually undergoes extensive testing before we get it. For now, we can make a PR, but put it in draft form until we get that pip
address.dss-deploy-scripts
:ETH-A
): TOKEN-X
collateral typehat
, which is then trusted to execute these functions and make changes to the live protocol. plotting
a plan
and then the actual execution after the delay by casting
the spell, which introduces the desired changes to the live Protocol.SpellAction
contract is defined which contains the main execute function and a DssSpell
contract contains a description of the spell and orchestrates the execution of one or more spell actions through the GSM.BAL
: seth send 0x630D82Cbf82089B09F71f8d3aAaff2EBA6f47B15 'transfer(address,uint256)' 0x57aAeAE905376a4B1899bA81364b4cE2519CBfB3 50000000000000000000000000000
gulp
amount should be.Vat
, ilk
, gem
, and any other constructor values are set correctly.BAL
with standard GemJoin
:BAL
: dapp --use solc:0.5.12 build && dapp create GemJoin 0xbA987bDB501d131f766fEe8180Da5d81b34b69d9 $(seth --to-bytes32 "$(seth --from-ascii "BAL-A")") 0x630D82Cbf82089B09F71f8d3aAaff2EBA6f47B15
Vat
, Cat
, and ilk
values are set correctly.newFlip()
in the FlipFab
contract to deploy a generic Flipper contract. You can find the MCD_FLIP_FAB
address in the changelog along with the arguments Vat
and Cat
. You can get the bytes32 of the ilk from the command below, but replace BAL-A
with your token.BAL-A
: TX=$(seth send 0x7c890e1e492FDDA9096353D155eE1B26C1656a62 'newFlip(address,address,bytes32)(address)' 0xbA987bDB501d131f766fEe8180Da5d81b34b69d9 0xdDb5F7A3A5558b9a6a1f3382BD75E2268d1c6958 $(seth --to-bytes32 "$(seth --from-ascii "BAL-A")") --async) && seth receipt $TX logs | jq -r '.[0].address'
seth send
doesn’t return the new Flipper address. You can find this address by chasing it down in the transaction hash that was returned. Simply go to https://ethtx.info/kovan/<tx hash>.OSM
and will share its address with the Smart Contract team to be called in the DssSpell
.OSM
.Mom
contracts allow governance to execute certain time-sensitive actions without having to pass through a delay.OSMMom
contract allows governance to stop an erroneous oracle price update instantly, and the FlipperMom
contract allows governance to instantly stop vaults of a collateral type from being liquidated under unfavorable conditions.GemJoin
and Flipper
contracts, the deployer address (ETH_FROM
) is given authorization, which needs to be revoked with a follow-up deny
transaction. TOKEN-X
../template
directory to add the new collateral type with values from https://github.com/makerdao/dss-deploy-scripts/tree/master/config, and then replace the contents of the src/Kovan-DssSpell.sol
contract with it. It is important that the template is exactly followed and no changes are made since it was created after many iterations. Reviews would be conducted against it line by line and they would fail if any changes are introduced to the template.poke()
the OSM yourself by using the TOKEN_PIP address: seth send $TOKEN_PIP 'poke()'
. Feel free to do this twice, but you must wait an hour between each poke()
. Once you’ve poked, you can run this script to see if there is a price in the OSM: https://gist.github.com/godsflaw/3dd9171237a88caa948fc5879431d0ce​currentPrice
and nextPrice
populated. If you don’t, you should reach out to the Oracles team to ensure they are indeed providing a price.gulp()
on the faucet. This section tells the faucet how many tokens should be handed out for a gulp()
. Once gulp()
is called it cannot be called from the same address again, so be generous. For testing later, this MUST be more than the DAI dust value with collateralization ratio applied. Target 5x the dust value..sethrc
file with the correct network, gas limit, and signing keys. You can also add the Etherscan API key to the file to .sethrc for automatic etherescan contract verification, ETHERSCAN_API_KEY=XXXXXYYYYYZZZZ.