Blockwell

BandToken

ERC20

This contract is an ERC20 token.

Name BandToken
Symbol BAND
Decimals 18
Total Supply 100,000,000 BAND

About link description

Band Protocol (BAND) is a cryptocurrency and operates on the Ethereum platform. Band Protocol has a current supply of 100,000,000 with 35,191,821 in circulation. The last known price of Band Protocol is 5.29920599 USD and is down -4.04 over the last 24 hours. It is currently trading on 127 active market(s) with $35,097,219.73 traded over the last 24 hours. More information can be found at https://bandprotocol.com/.

Stats

Public Functions 16
Event Types 4
Code Size 18,312 bytes

Events (4) 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

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

votingPowerChangeNonce Variable

uint256 help

votingPowerChangeCount Variable

mapping(address => uint256) help

_balances Variable

mapping(address => uint256) help
Internal Variable

_allowed Variable

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

_totalSupply Variable

uint256 help
Internal Variable

_minters Variable

Roles.Role help
Internal Variable

_votingPower Variable

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

Functions Expand All Collapse All

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.has(account);
}

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null
Source Code
function addMinter(address account) public onlyMinter {
  _addMinter(account);
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
owner
address help

Properties

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

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
  returns (uint256)
{
  return _allowed[owner][spender];
}

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) public returns (bool) {
  _transfer(msg.sender, to, value);
  return true;
}

Parameters help

Name Type
spender
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address spender, uint256 value) public returns (bool) {
  require(spender != address(0));

  _allowed[msg.sender][spender] = value;
  emit Approval(msg.sender, spender, 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
) public returns (bool) {
  _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
  _transfer(from, to, value);
  emit Approval(from, msg.sender, _allowed[from][msg.sender]);
  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
  returns (bool)
{
  require(spender != address(0));

  _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
  emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
  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
  returns (bool)
{
  require(spender != address(0));

  _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(
    subtractedValue
  );
  emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
  return true;
}

Parameters help

Name Type
to
address help
value
uint256 help
sig
bytes4 help
data
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferAndCall(
  address to,
  uint256 value,
  bytes4 sig,
  bytes memory data
) public returns (bool) {
  require(to != address(this));
  _transfer(msg.sender, to, value);
  (bool success, ) = to.call(
    abi.encodePacked(sig, uint256(msg.sender), value, data)
  );
  require(success);
  return true;
}

Parameters help

Name Type
to
address help
value
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 value) public onlyMinter returns (bool) {
  _mint(to, value);
  return true;
}

Parameters help

Name Type
from
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyMinter checks for the following:
null

Requirements help

Source Code
function burn(address from, uint256 value) public onlyMinter returns (bool) {
  _burn(from, value);
  return true;
}

Parameters help

Name Type
owner
address help
index
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function historicalVotingPowerAtIndex(address owner, uint256 index)
  public
  view
  returns (uint256)
{
  require(index <= votingPowerChangeCount[owner]);
  return _votingPower[owner][index] & ((1 << 192) - 1); // Lower 192 bits
}

Parameters help

Name Type
owner
address help
nonce
uint256 help

Properties

Visibility help public
Mutability help view
Source Code
function historicalVotingPowerAtNonce(address owner, uint256 nonce)
  public
  view
  returns (uint256)
{
  require(nonce <= votingPowerChangeNonce && nonce < (1 << 64));
  uint256 start = 0;
  uint256 end = votingPowerChangeCount[owner];
  while (start < end) {
    uint256 mid = start.add(end).add(1).div(2); /// Use (start+end+1)/2 to prevent infinite loop.
    if ((_votingPower[owner][mid] >> 192) > nonce) {
      /// Upper 64-bit nonce
      /// If midTime > nonce, this mid can't possibly be the answer.
      end = mid.sub(1);
    } else {
      /// Otherwise, search on the greater side, but still keep mid as a possible option.
      start = mid;
    }
  }
  return historicalVotingPowerAtIndex(owner, start);
}

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 ERC20._transfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address from,
  address to,
  uint256 value
) internal {
  require(to != address(0));

  _balances[from] = _balances[from].sub(value);
  _balances[to] = _balances[to].add(value);
  emit Transfer(from, to, value);
}

internal ERC20._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mint(address account, uint256 value) internal {
  require(account != address(0));

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

internal ERC20._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burn(address account, uint256 value) internal {
  require(account != address(0));

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

internal ERC20._burnFrom keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burnFrom(address account, uint256 value) internal {
  _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
  _burn(account, value);
  emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}

internal MinterRole.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _addMinter(msg.sender);
}

internal MinterRole._addMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _addMinter(address account) internal {
  _minters.add(account);
  emit MinterAdded(account);
}

internal MinterRole._removeMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _removeMinter(address account) internal {
  _minters.remove(account);
  emit MinterRemoved(account);
}

internal SnapshotToken._transfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _transfer(
  address from,
  address to,
  uint256 value
) internal {
  super._transfer(from, to, value);
  votingPowerChangeNonce = votingPowerChangeNonce.add(1);
  _changeVotingPower(from);
  _changeVotingPower(to);
}

internal SnapshotToken._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _mint(address account, uint256 amount) internal {
  super._mint(account, amount);
  votingPowerChangeNonce = votingPowerChangeNonce.add(1);
  _changeVotingPower(account);
}

internal SnapshotToken._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _burn(address account, uint256 amount) internal {
  super._burn(account, amount);
  votingPowerChangeNonce = votingPowerChangeNonce.add(1);
  _changeVotingPower(account);
}

internal SnapshotToken._changeVotingPower keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _changeVotingPower(address account) internal {
  uint256 currentIndex = votingPowerChangeCount[account];
  uint256 newPower = balanceOf(account);
  require(newPower < (1 << 192));
  require(votingPowerChangeNonce < (1 << 64));
  currentIndex = currentIndex.add(1);
  votingPowerChangeCount[account] = currentIndex;
  _votingPower[account][currentIndex] =
    (votingPowerChangeNonce << 192) |
    newPower;
}

internal ERC20._transfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address from,
  address to,
  uint256 value
) internal {
  require(to != address(0));

  _balances[from] = _balances[from].sub(value);
  _balances[to] = _balances[to].add(value);
  emit Transfer(from, to, value);
}

internal ERC20._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mint(address account, uint256 value) internal {
  require(account != address(0));

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

internal ERC20._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burn(address account, uint256 value) internal {
  require(account != address(0));

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

internal ERC20._burnFrom keyboard_arrow_up

Parameters help

Name Type
account
address help
value
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burnFrom(address account, uint256 value) internal {
  _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
  _burn(account, value);
  emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}

internal MinterRole.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _addMinter(msg.sender);
}

internal MinterRole._addMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _addMinter(address account) internal {
  _minters.add(account);
  emit MinterAdded(account);
}

internal MinterRole._removeMinter keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _removeMinter(address account) internal {
  _minters.remove(account);
  emit MinterRemoved(account);
}