Blockwell

Aragon Network Token

ERC20

This contract is an ERC20 token.

Name Aragon Network Token
Symbol ANT
Decimals 18
Total Supply 40,073,107 ANT

About link description

Aragon (ANT) is a cryptocurrency and operates on the Ethereum platform. Aragon has a current supply of 39,609,523.80952381 with 39,609,522.80952381 in circulation. The last known price of Aragon is 3.48887304 USD and is up 2.19 over the last 24 hours. It is currently trading on 71 active market(s) with $10,981,243.60 traded over the last 24 hours. More information can be found at https://aragon.org/.

Stats

Public Functions 10
Event Types 4
Code Size 8,452 bytes

Library Use

Uses SafeMath for uint256.

Events (4) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

AuthorizationUsed Event

Parameters help
authorizer
address help
nonce
bytes32 help

ChangeMinter Event

Parameters help
minter
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

EIP712DOMAIN_HASH Constant

bytes32 help
0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f

NAME_HASH Constant

bytes32 help
0x711a8013284a3c0046af6c0d6ed33e8bbc2c7a11d615cf4fdc8b1ac753bda618

VERSION_HASH Constant

bytes32 help
0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6

PERMIT_TYPEHASH Constant

bytes32 help
0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9

TRANSFER_WITH_AUTHORIZATION_TYPEHASH Constant

bytes32 help
0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267

name Constant

string help
Aragon Network Token

symbol Constant

string help
ANT

decimals Constant

uint8 help
18

minter Variable

address help

totalSupply Variable

uint256 help

balanceOf Variable

mapping(address => uint256) help

nonces Variable

mapping(address => uint256) help

allowance Variable

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

authorizationState Variable

mapping(address => mapping(bytes32 => bool)) help
Internal Variable

Functions Expand All Collapse All

getChainId keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help pure
Source Code
function getChainId() public pure returns (uint256 chainId) {
  assembly {
    chainId := chainid()
  }
}

getDomainSeparator keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function getDomainSeparator() public view returns (bytes32) {
  return
    keccak256(
      abi.encode(
        EIP712DOMAIN_HASH,
        NAME_HASH,
        VERSION_HASH,
        getChainId(),
        address(this)
      )
    );
}

mint keyboard_arrow_up

Parameters help

Name Type
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function mint(address to, uint256 value) external onlyMinter returns (bool) {
  _mint(to, value);
  return true;
}

changeMinter keyboard_arrow_up

Parameters help

Name Type
newMinter
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function changeMinter(address newMinter) external onlyMinter {
  _changeMinter(newMinter);
}

burn keyboard_arrow_up

Parameters help

Name Type
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 value) external returns (bool) {
  _burn(msg.sender, value);
  return true;
}

Parameters help

Name Type
spender
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address spender, uint256 value) external returns (bool) {
  _approve(msg.sender, spender, value);
  return true;
}

Parameters help

Name Type
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transfer(address to, uint256 value) external returns (bool) {
  _transfer(msg.sender, to, value);
  return true;
}

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferFrom(
  address from,
  address to,
  uint256 value
) external returns (bool) {
  uint256 fromAllowance = allowance[from][msg.sender];
  if (fromAllowance != uint256(-1)) {
    // Allowance is implicitly checked with SafeMath's underflow protection
    allowance[from][msg.sender] = fromAllowance.sub(value);
  }
  _transfer(from, to, value);
  return true;
}

permit keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
value
uint256 help
deadline
uint256 help
v
uint8 help
r
bytes32 help
s
bytes32 help

Properties

Visibility help public
Mutability help transaction
Source Code
function permit(
  address owner,
  address spender,
  uint256 value,
  uint256 deadline,
  uint8 v,
  bytes32 r,
  bytes32 s
) external {
  require(deadline >= block.timestamp, "ANTV2:AUTH_EXPIRED");

  bytes32 encodeData = keccak256(
    abi.encode(
      PERMIT_TYPEHASH,
      owner,
      spender,
      value,
      nonces[owner]++,
      deadline
    )
  );
  _validateSignedData(owner, encodeData, v, r, s);

  _approve(owner, spender, value);
}

transferWithAuthorization keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help
validAfter
uint256 help
validBefore
uint256 help
nonce
bytes32 help
v
uint8 help
r
bytes32 help
s
bytes32 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferWithAuthorization(
  address from,
  address to,
  uint256 value,
  uint256 validAfter,
  uint256 validBefore,
  bytes32 nonce,
  uint8 v,
  bytes32 r,
  bytes32 s
) external {
  require(block.timestamp > validAfter, "ANTV2:AUTH_NOT_YET_VALID");
  require(block.timestamp < validBefore, "ANTV2:AUTH_EXPIRED");
  require(!authorizationState[from][nonce], "ANTV2:AUTH_ALREADY_USED");

  bytes32 encodeData = keccak256(
    abi.encode(
      TRANSFER_WITH_AUTHORIZATION_TYPEHASH,
      from,
      to,
      value,
      validAfter,
      validBefore,
      nonce
    )
  );
  _validateSignedData(from, encodeData, v, r, s);

  authorizationState[from][nonce] = true;
  emit AuthorizationUsed(from, nonce);

  _transfer(from, to, value);
}

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 ANTv2._validateSignedData keyboard_arrow_up

Parameters help

Name Type
signer
address help
encodeData
bytes32 help
v
uint8 help
r
bytes32 help
s
bytes32 help

Properties

Visibility help internal
Mutability help view
Source Code
function _validateSignedData(
  address signer,
  bytes32 encodeData,
  uint8 v,
  bytes32 r,
  bytes32 s
) internal view {
  bytes32 digest = keccak256(
    abi.encodePacked("\x19\x01", getDomainSeparator(), encodeData)
  );
  address recoveredAddress = ecrecover(digest, v, r, s);
  // Explicitly disallow authorizations for address(0) as ecrecover returns address(0) on malformed messages
  require(
    recoveredAddress != address(0) && recoveredAddress == signer,
    "ANTV2:INVALID_SIGNATURE"
  );
}

internal ANTv2._changeMinter keyboard_arrow_up

Parameters help

Name Type
newMinter
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _changeMinter(address newMinter) internal {
  minter = newMinter;
  emit ChangeMinter(newMinter);
}

internal ANTv2._mint keyboard_arrow_up

Parameters help

Name Type
to
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _mint(address to, uint256 value) internal {
  totalSupply = totalSupply.add(value);
  balanceOf[to] = balanceOf[to].add(value);
  emit Transfer(address(0), to, value);
}

internal ANTv2._burn keyboard_arrow_up

Parameters help

Name Type
from
address help
value
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _burn(address from, uint256 value) internal {
  // Balance is implicitly checked with SafeMath's underflow protection
  balanceOf[from] = balanceOf[from].sub(value);
  totalSupply = totalSupply.sub(value);
  emit Transfer(from, address(0), value);
}

internal ANTv2._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
value
uint256 help

Properties

Visibility help private
Mutability help transaction
Source Code
function _approve(
  address owner,
  address spender,
  uint256 value
) private {
  allowance[owner][spender] = value;
  emit Approval(owner, spender, value);
}

internal ANTv2._transfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help private
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address from,
  address to,
  uint256 value
) private {
  require(
    to != address(this) && to != address(0),
    "ANTV2:RECEIVER_IS_TOKEN_OR_ZERO"
  );

  // Balance is implicitly checked with SafeMath's underflow protection
  balanceOf[from] = balanceOf[from].sub(value);
  balanceOf[to] = balanceOf[to].add(value);
  emit Transfer(from, to, value);
}