Blockwell

Dai Stablecoin

ERC20

This contract is an ERC20 token.

Name Dai Stablecoin
Symbol DAI
Decimals 18
Total Supply 588,365,354 DAI

About link

Dai (DAI) is a cryptocurrency token and operates on the Ethereum platform. Dai has a current supply of 896,270,295.683 with 895,797,028.231 in circulation. The last known price of Dai is $1.01 USD and is down -0.22% over the last 24 hours. It is currently trading on 309 active market(s) with $52,562,040.551 traded over the last 24 hours. More information can be found at http://www.makerdao.com/.

Stats

Public Functions 11
Event Types 3
Code Size 7,965 bytes

Approval Event

Parameters help
src
address help
guy
address help
wad
uint help

LogNote Event

Parameters help
sig
bytes4 help
usr
address help
arg1
bytes32 help
arg2
bytes32 help
data
bytes help

Transfer Event

Parameters help
src
address help
dst
address help
wad
uint help

Functions Expand All Collapse All

rely keyboard_arrow_up

Parameters help

Name Type
guy
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function rely(address guy) external note auth { wards[guy] = 1; }

deny keyboard_arrow_up

Parameters help

Name Type
guy
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function deny(address guy) external note auth { wards[guy] = 0; }

transfer keyboard_arrow_up

Parameters help

Name Type
dst
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transfer(address dst, uint wad) external returns (bool) {
        return transferFrom(msg.sender, dst, wad);
    }

transferFrom keyboard_arrow_up

Parameters help

Name Type
src
address help
dst
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transferFrom(address src, address dst, uint wad)
        public returns (bool)
    {
        require(balanceOf[src] >= wad, "Dai/insufficient-balance");
        if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {
            require(allowance[src][msg.sender] >= wad, "Dai/insufficient-allowance");
            allowance[src][msg.sender] = sub(allowance[src][msg.sender], wad);
        }
        balanceOf[src] = sub(balanceOf[src], wad);
        balanceOf[dst] = add(balanceOf[dst], wad);
        emit Transfer(src, dst, wad);
        return true;
    }

mint keyboard_arrow_up

Parameters help

Name Type
usr
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function mint(address usr, uint wad) external auth {
        balanceOf[usr] = add(balanceOf[usr], wad);
        totalSupply    = add(totalSupply, wad);
        emit Transfer(address(0), usr, wad);
    }

burn keyboard_arrow_up

Parameters help

Name Type
usr
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function burn(address usr, uint wad) external {
        require(balanceOf[usr] >= wad, "Dai/insufficient-balance");
        if (usr != msg.sender && allowance[usr][msg.sender] != uint(-1)) {
            require(allowance[usr][msg.sender] >= wad, "Dai/insufficient-allowance");
            allowance[usr][msg.sender] = sub(allowance[usr][msg.sender], wad);
        }
        balanceOf[usr] = sub(balanceOf[usr], wad);
        totalSupply    = sub(totalSupply, wad);
        emit Transfer(usr, address(0), wad);
    }

approve keyboard_arrow_up

Parameters help

Name Type
usr
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function approve(address usr, uint wad) external returns (bool) {
        allowance[msg.sender][usr] = wad;
        emit Approval(msg.sender, usr, wad);
        return true;
    }

push keyboard_arrow_up

Parameters help

Name Type
usr
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function push(address usr, uint wad) external {
        transferFrom(msg.sender, usr, wad);
    }

pull keyboard_arrow_up

Parameters help

Name Type
usr
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function pull(address usr, uint wad) external {
        transferFrom(usr, msg.sender, wad);
    }

move keyboard_arrow_up

Parameters help

Name Type
src
address help
dst
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
    function move(address src, address dst, uint wad) external {
        transferFrom(src, dst, wad);
    }

permit keyboard_arrow_up

Parameters help

Name Type
holder
address help
spender
address help
nonce
uint256 help
expiry
uint256 help
allowed
bool help
v
uint8 help
r
bytes32 help
s
bytes32 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function permit(address holder, address spender, uint256 nonce, uint256 expiry,
                    bool allowed, uint8 v, bytes32 r, bytes32 s) external
    {
        bytes32 digest =
            keccak256(abi.encodePacked(
                "\x19\x01",
                DOMAIN_SEPARATOR,
                keccak256(abi.encode(PERMIT_TYPEHASH,
                                     holder,
                                     spender,
                                     nonce,
                                     expiry,
                                     allowed))
        ));

        require(holder != address(0), "Dai/invalid-address-0");
        require(holder == ecrecover(digest, v, r, s), "Dai/invalid-permit");
        require(expiry == 0 || now <= expiry, "Dai/permit-expired");
        require(nonce == nonces[holder]++, "Dai/invalid-nonce");
        uint wad = allowed ? uint(-1) : 0;
        allowance[holder][spender] = wad;
        emit Approval(holder, spender, wad);
    }