Old MCD System Diagram

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/798fc395-d8fe-459f-9144-755ad69cba2c/Screen_Shot_2019-06-14_at_2.09.40_PM.png

Updated MCD System Diagram

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ab115086-faab-4768-b52c-43a029724bf0/MCD_System_2.0.png

Legend

Actions

Act - Public action

Act - Authorised action

Act - Governance action

Storage

var - Storage variable [type]

var - Storage variable updatable via governance [type]

Cat The Liquidator

The Cat is the system's liquidation agent: it decides when a position is unsafe and allows it to be seized and sent off to auction.


Bite - Trigger liquidation of an unsafe Vault


File - Gov config

wards(usr: address) - Auth [uint]


ilks(ilk: bytes32) - Collateral type [Ilk]


live - Cage flag [uint]

vat - Vat [address]

vow - Vow [address]

cat.sol


Dai Token

The Dai contract is the user facing ERC20 contract maintaining the accounting for external Dai balances. Most functions are standard for a token with changing supply, but it also notably features the ability to issue approvals for transfers based on signed messages.


Mint - Mint to an address


Burn - Burn at an address


Push - Transfer


Pull - Transfer From


Move - Transfer From


Approve - Allow pulls and moves


Permit - Approve by signature

name - Dai Stablecoin [string]

symbol - DAI [string]

version - 1 [string]

decimals - 18 [uint8]


totalSupply - Total Supply [uint]


balanceOf(usr: address) - User balance [uint]

allowance(src: address, dst: address) - Approvals [uint]

nonces(usr: address) - Permit nonce [uint]

dai.sol


DaiJoin Token adapter

The DaiJoin adapter allows users to withdraw their Dai from the system into a standard ERC20 token.


Join - Deposit tokens to the system


Exit - Remove tokens from the system

vat - Vat [address]

dai - Dai token contract [address]

join.sol


End Global settlement

The End coordinates the process of Global Settlement.


Cage - Freeze user-facing actions


Cage - Tag Ilk prices


Skim - Settle a Vault at the tagged price


Free - Remove collateral from a settled Vault


Thaw - Fix Dai supply after all Skims


Flow - Calculate final Ilk prices


Pack - Lock Dai ahead of Cash


Cash - Exchange packed Dai for collateral


File - Gov config

wards(usr: address) - Auth [uint]


vat - Vat [address]

cat - Cat [address]

vow - Vow [address]

spot - Spotter [address]


live - Cage flag [uint]

when - Time of cage [uint]

wait - Processing cooldown duration [uint]

debt - Outstanding Dai after processing [uint]


tag(ilk: bytes32) - Cage price [uint]

gap(ilk: bytes32) - Collateral shortfall [uint]

Art(ilk: bytes32) - Total debt per Ilk [uint]

fix(ilk: bytes32) - Final cash price [uint]


bag(usr: address) - Dai packed for cash [uint]

out(ilk: bytes32, usr: address) - Cash out [uint]

end.sol


ESM Emergency Shutdown Module