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 and operates on the Ethereum platform. Dai has a current supply of 5,493,645,892.859368 with 5,493,645,404.020224 in circulation. The last known price of Dai is 1.00038056 USD and is down -0.02 over the last 24 hours. It is currently trading on 393 active market(s) with $335,165,861.39 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

Events (3) keyboard_arrow_up

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

name Constant

string help
Dai Stablecoin

symbol Constant

string help
DAI

version Constant

string help
1

decimals Constant

uint8 help
18

PERMIT_TYPEHASH Constant

bytes32 help
0xea2aa0a1be11a07ed86d755c93467f4f82362b452371d1ba94d1715123511acb

totalSupply Variable

uint256 help

DOMAIN_SEPARATOR Variable

bytes32 help

wards Variable

mapping(address => uint) help

balanceOf Variable

mapping(address => uint) help

nonces Variable

mapping(address => uint) help

allowance Variable

mapping(address => mapping(address => uint)) help
Internal Variable

Functions Expand All Collapse All

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;
}

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;
}

Parameters help

Name Type
dst
address help
wad
uint help

Properties

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

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,
  uint256 wad
) public returns (bool) {
  require(balanceOf[src] >= wad, "Dai/insufficient-balance");
  if (src != msg.sender && allowance[src][msg.sender] != uint256(-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;
}

Parameters help

Name Type
usr
address help
wad
uint help

Properties

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

Parameters help

Name Type
usr
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(address usr, uint256 wad) external {
  require(balanceOf[usr] >= wad, "Dai/insufficient-balance");
  if (usr != msg.sender && allowance[usr][msg.sender] != uint256(-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);
}

Parameters help

Name Type
usr
address help
wad
uint help

Properties

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

Parameters help

Name Type
usr
address help
wad
uint help

Properties

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

Parameters help

Name Type
usr
address help
wad
uint help

Properties

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

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,
  uint256 wad
) external {
  transferFrom(src, dst, wad);
}

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");
  uint256 wad = allowed ? uint256(-1) : 0;
  allowance[holder][spender] = wad;
  emit Approval(holder, spender, wad);
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal Dai.add keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure

Requirements help

Source Code
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
  require((z = x + y) >= x);
}

internal Dai.sub keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure

Requirements help

Source Code
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
  require((z = x - y) <= x);
}