Daicontract is the user-facing ERC20 token 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
Pull- Transfer From
Move- Transfer From
Approve- Allow pulls and moves
Permit- Approve by signature
name- Dai Stablecoin
totalSupply- Total DAI Supply
balanceOf(usr: address)- User balance
allowance(src: address, dst: address)- Approvals
nonces(usr: address)- Permit nonce
wad- fixed point decimal with 18 decimals (for basic quantities, e.g. balances).
dai.solfunctions as a typical ERC20 token. These tokens have been already been heavily documented here and it is recommended to read through that documentation for the core functions of an ERC20 token.
transferFromin the DAI contract works in a slightly different form than the generic
transferFromfunction. The DAI contract allows for "unlimited approval". Should the user approve an address for the maximum uint256 value, then that address will have unlimited approval until told otherwise.
moveare aliases for
transferFromcalls in the form of
transferFrom(msg.sender, usr, amount),
transferFrom(usr, msg.sender, amount)&
transferFrom(src, dst, amount).
permitis a signature-based approval function. This allows for an end-user to sign a message which can then be relayed by another party to submit their approval. This can be useful for applications in which the end-user does not need to hold
allowedamount. This can then be submitted to
Permit()to update the user's approval.
approvalfor a specific amount be aware of this particular issue and use caution when authorizing other contracts to perform transfers on their behalf.
transferFromfunctionality: If the
src == msg.senderthe function does not require
approvalfirst and treats it as a normal