The MKR Governance Token Implementation
- Contract Name: token.sol
- Type/Category: MKR Module
The MKR Module contains the MKR token, which is a deployed Ds-Token contract. It is an ERC20 token that provides a standard ERC20 token interface. It also contains logic for burning and authorized minting of MKR.
MKR Interactions with the Maker Protocol
guy- user address
wad- a quantity of tokens, usually as a fixed point integer with 10^18 decimal places.
dst- refers to the destination address.
mint- credit tokens at an address whilst simultaneously increasing totalSupply (requires auth).
burn- debit tokens at an address whilst simultaneously decreasing totalSupply (requires auth).
push- transfer an amount from msg.sender to a given address.
pull- transfer an amount from a given address to msg.sender (requires trust or approval).
move- transfer an amount from a given src address to a given dst address (requires trust or approval).
name- returns the name of the token - e.g. "MyToken".
symbol- token symbol.
decimals- returns the number of decimals the token uses - e.g.
8, means to divide the token amount by
100000000to get its user representation.
transfer- transfers _value amount of tokens to address _to, and MUST fire the Transfer event. This SHOULD throw if the message caller’s account balance does not have enough tokens to spend.
transferFrom- transfers _value amount of tokens from address _from to address _to, and MUST fire the Transfer event.
approve- allows _spender to withdraw from your account multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value.
totalSupply- returns the total token supply.
balanceOf- returns the account balance of another account with address _owner.
allowance- returns the amount which _spender is still allowed to withdraw from _owner.
Important note: there is a
transferFromauto approval when
src == msg.sender.
Along with MKR having a standard ERC20 token interface, it also has the addition of DSAuth-protected mint and burn functions; binary approval via MAX_UINT; as well as a push, pull and move aliases for transferFrom operations.
The MKR token has 3 methods of use within the Maker Protocol (reference Maker Protocol 101 Presentation):
- As a utility token: As Dai stability fees earned on Vaults accrue within the Maker Protocol, MKR holders can use MKR to vote to enable the Flapper auction house to sell Dai surplus for MKR. Once the auction is complete the Maker protocol burns the MKR.
- As a governance token: MKR is used by MKR holders to vote for the risk management and business logic of the Maker Protocol. Tokens are a simple representation of voting power.
- As a recapitalization resource: MKR can autonomously be minted by the Flopper auction house and sold for DAI, which is used to recap the Maker Protocol in times of insolvency.
- The MKR token is an ERC-20 token created using DSToken. A key difference to note between Dai and most other popular ERC20 tokens is that both these fields use
bytes32instead of the
MKR.stop- ES cannot be triggered. MKR in the chief can still vote, but cannot join or exit.