Blockwell

Graph Token

ERC20

This contract is an ERC20 token.

Name Graph Token
Symbol GRT
Decimals 18
Total Supply 10,146,397,265 GRT

About link description

The Graph (GRT) is a cryptocurrency and operates on the Ethereum platform. The Graph has a current supply of 10,000,000,000 with 2,897,903,422 in circulation. The last known price of The Graph is 0.59945062 USD and is down -0.71 over the last 24 hours. It is currently trading on 132 active market(s) with $55,185,580.90 traded over the last 24 hours. More information can be found at https://thegraph.com.

Stats

Public Functions 21
Event Types 6
Code Size 33,336 bytes

Library Use

Uses SafeMath for uint256.

Events (6) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

MinterAdded Event

Parameters help
account
address help

MinterRemoved Event

Parameters help
account
address help

NewOwnership Event

Parameters help
from
address help
to
address help

NewPendingOwnership Event

Parameters help
from
address help
to
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

DOMAIN_TYPE_HASH Constant

bytes32 help
the result of calling keccak256 with "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract,bytes32 salt)"

DOMAIN_NAME_HASH Constant

bytes32 help

DOMAIN_VERSION_HASH Constant

bytes32 help

DOMAIN_SALT Constant

bytes32 help
0x51f3d585afe6dfeb2af01bba0889a36c1db03beec88c6a4d0c53817069026afa

PERMIT_TYPEHASH Constant

bytes32 help
the result of calling keccak256 with "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"

governor Variable

address help

pendingGovernor Variable

address help

nonces Variable

mapping(address => uint256) help

DOMAIN_SEPARATOR Variable

bytes32 help
Internal Variable

_minters Variable

mapping(address => bool) help
Internal Variable

_balances Variable

mapping(address => uint256) help
Internal Variable

_allowances Variable

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

_totalSupply Variable

uint256 help
Internal Variable

_name Variable

string help
Internal Variable

_symbol Variable

string help
Internal Variable

_decimals Variable

uint8 help
Internal Variable

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function name() public view returns (string memory) {
  return _name;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() public view returns (string memory) {
  return _symbol;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function decimals() public view returns (uint8) {
  return _decimals;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function totalSupply() public view override returns (uint256) {
  return _totalSupply;
}

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address account) public view override returns (uint256) {
  return _balances[account];
}

Parameters help

Name Type
recipient
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transfer(address recipient, uint256 amount)
  public
  virtual
  override
  returns (bool)
{
  _transfer(_msgSender(), recipient, amount);
  return true;
}

Parameters help

Name Type
owner
address help
spender
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address owner, address spender)
  public
  view
  virtual
  override
  returns (uint256)
{
  return _allowances[owner][spender];
}

Parameters help

Name Type
spender
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address spender, uint256 amount)
  public
  virtual
  override
  returns (bool)
{
  _approve(_msgSender(), spender, amount);
  return true;
}

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferFrom(
  address sender,
  address recipient,
  uint256 amount
) public virtual override returns (bool) {
  _transfer(sender, recipient, amount);
  _approve(
    sender,
    _msgSender(),
    _allowances[sender][_msgSender()].sub(
      amount,
      "ERC20: transfer amount exceeds allowance"
    )
  );
  return true;
}

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function increaseAllowance(address spender, uint256 addedValue)
  public
  virtual
  returns (bool)
{
  _approve(
    _msgSender(),
    spender,
    _allowances[_msgSender()][spender].add(addedValue)
  );
  return true;
}

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
  public
  virtual
  returns (bool)
{
  _approve(
    _msgSender(),
    spender,
    _allowances[_msgSender()][spender].sub(
      subtractedValue,
      "ERC20: decreased allowance below zero"
    )
  );
  return true;
}

burn keyboard_arrow_up

Parameters help

Name Type
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function burn(uint256 amount) public virtual {
  _burn(_msgSender(), amount);
}

burnFrom keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function burnFrom(address account, uint256 amount) public virtual {
  uint256 decreasedAllowance = allowance(account, _msgSender()).sub(
    amount,
    "ERC20: burn amount exceeds allowance"
  );

  _approve(account, _msgSender(), decreasedAllowance);
  _burn(account, amount);
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
_newGovernor
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferOwnership(address _newGovernor) external onlyGovernor {
  require(_newGovernor != address(0), "Governor must be set");

  address oldPendingGovernor = pendingGovernor;
  pendingGovernor = _newGovernor;

  emit NewPendingOwnership(oldPendingGovernor, pendingGovernor);
}

acceptOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function acceptOwnership() external {
  require(
    pendingGovernor != address(0) && msg.sender == pendingGovernor,
    "Caller must be pending governor"
  );

  address oldGovernor = governor;
  address oldPendingGovernor = pendingGovernor;

  governor = pendingGovernor;
  pendingGovernor = address(0);

  emit NewOwnership(oldGovernor, governor);
  emit NewPendingOwnership(oldPendingGovernor, pendingGovernor);
}

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 {
  bytes32 digest = keccak256(
    abi.encodePacked(
      "\x19\x01",
      DOMAIN_SEPARATOR,
      keccak256(
        abi.encode(
          PERMIT_TYPEHASH,
          _owner,
          _spender,
          _value,
          nonces[_owner],
          _deadline
        )
      )
    )
  );
  nonces[_owner] = nonces[_owner].add(1);

  address recoveredAddress = ECDSA.recover(
    digest,
    abi.encodePacked(_r, _s, _v)
  );
  require(_owner == recoveredAddress, "GRT: invalid permit");
  require(
    _deadline == 0 || block.timestamp <= _deadline,
    "GRT: expired permit"
  );

  _approve(_owner, _spender, _value);
}

addMinter keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function addMinter(address _account) external onlyGovernor {
  _addMinter(_account);
}

removeMinter keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function removeMinter(address _account) external onlyGovernor {
  _removeMinter(_account);
}

renounceMinter keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function renounceMinter() external {
  _removeMinter(msg.sender);
}

mint keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null

Requirements help

Source Code
function mint(address _to, uint256 _amount) external onlyMinter {
  _mint(_to, _amount);
}

isMinter keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help view
Source Code
function isMinter(address _account) public view returns (bool) {
  return _minters[_account];
}

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 GraphToken._addMinter keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help private
Mutability help transaction
Source Code
function _addMinter(address _account) private {
  _minters[_account] = true;
  emit MinterAdded(_account);
}

internal GraphToken._removeMinter keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help private
Mutability help transaction
Source Code
function _removeMinter(address _account) private {
  _minters[_account] = false;
  emit MinterRemoved(_account);
}

internal GraphToken._getChainID keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help private
Mutability help pure
Source Code
function _getChainID() private pure returns (uint256) {
  uint256 id;
  assembly {
    id := chainid()
  }
  return id;
}

internal Governed._initialize keyboard_arrow_up

Parameters help

Name Type
_initGovernor
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _initialize(address _initGovernor) internal {
  governor = _initGovernor;
}

internal ERC20._transfer keyboard_arrow_up

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address sender,
  address recipient,
  uint256 amount
) internal virtual {
  require(sender != address(0), "ERC20: transfer from the zero address");
  require(recipient != address(0), "ERC20: transfer to the zero address");

  _beforeTokenTransfer(sender, recipient, amount);

  _balances[sender] = _balances[sender].sub(
    amount,
    "ERC20: transfer amount exceeds balance"
  );
  _balances[recipient] = _balances[recipient].add(amount);
  emit Transfer(sender, recipient, amount);
}

internal ERC20._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mint(address account, uint256 amount) internal virtual {
  require(account != address(0), "ERC20: mint to the zero address");

  _beforeTokenTransfer(address(0), account, amount);

  _totalSupply = _totalSupply.add(amount);
  _balances[account] = _balances[account].add(amount);
  emit Transfer(address(0), account, amount);
}

internal ERC20._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burn(address account, uint256 amount) internal virtual {
  require(account != address(0), "ERC20: burn from the zero address");

  _beforeTokenTransfer(account, address(0), amount);

  _balances[account] = _balances[account].sub(
    amount,
    "ERC20: burn amount exceeds balance"
  );
  _totalSupply = _totalSupply.sub(amount);
  emit Transfer(account, address(0), amount);
}

internal ERC20._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _approve(
  address owner,
  address spender,
  uint256 amount
) internal virtual {
  require(owner != address(0), "ERC20: approve from the zero address");
  require(spender != address(0), "ERC20: approve to the zero address");

  _allowances[owner][spender] = amount;
  emit Approval(owner, spender, amount);
}

internal ERC20._setupDecimals keyboard_arrow_up

Parameters help

Name Type
decimals_
uint8 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setupDecimals(uint8 decimals_) internal {
  _decimals = decimals_;
}

internal ERC20._beforeTokenTransfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _beforeTokenTransfer(
  address from,
  address to,
  uint256 amount
) internal virtual {}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal ERC20._transfer keyboard_arrow_up

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address sender,
  address recipient,
  uint256 amount
) internal virtual {
  require(sender != address(0), "ERC20: transfer from the zero address");
  require(recipient != address(0), "ERC20: transfer to the zero address");

  _beforeTokenTransfer(sender, recipient, amount);

  _balances[sender] = _balances[sender].sub(
    amount,
    "ERC20: transfer amount exceeds balance"
  );
  _balances[recipient] = _balances[recipient].add(amount);
  emit Transfer(sender, recipient, amount);
}

internal ERC20._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mint(address account, uint256 amount) internal virtual {
  require(account != address(0), "ERC20: mint to the zero address");

  _beforeTokenTransfer(address(0), account, amount);

  _totalSupply = _totalSupply.add(amount);
  _balances[account] = _balances[account].add(amount);
  emit Transfer(address(0), account, amount);
}

internal ERC20._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burn(address account, uint256 amount) internal virtual {
  require(account != address(0), "ERC20: burn from the zero address");

  _beforeTokenTransfer(account, address(0), amount);

  _balances[account] = _balances[account].sub(
    amount,
    "ERC20: burn amount exceeds balance"
  );
  _totalSupply = _totalSupply.sub(amount);
  emit Transfer(account, address(0), amount);
}

internal ERC20._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _approve(
  address owner,
  address spender,
  uint256 amount
) internal virtual {
  require(owner != address(0), "ERC20: approve from the zero address");
  require(spender != address(0), "ERC20: approve to the zero address");

  _allowances[owner][spender] = amount;
  emit Approval(owner, spender, amount);
}

internal ERC20._setupDecimals keyboard_arrow_up

Parameters help

Name Type
decimals_
uint8 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setupDecimals(uint8 decimals_) internal {
  _decimals = decimals_;
}

internal ERC20._beforeTokenTransfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _beforeTokenTransfer(
  address from,
  address to,
  uint256 amount
) internal virtual {}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}