Blockwell

DRAGON

ERC20

This contract is an ERC20 token.

Name DRAGON
Symbol DRG
Decimals 8
Total Supply 442,695,970 DRG

About link

Dragon Coins (DRG) is a cryptocurrency and operates on the Ethereum platform. Dragon Coins has a current supply of 442,695,970.07088 with 348,657,484.0176098 in circulation. The last known price of Dragon Coins is 0.00288235 USD and is up 3.11 over the last 24 hours. It is currently trading on 2 active market(s) with $0.00 traded over the last 24 hours. More information can be found at https://drgtoken.io/.

Stats

Public Functions 14
Event Types 4
Code Size 6,042 bytes

Events (4) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

Approval Event

Parameters help
_owner
address help
spender
address help
value
uint help

Burn Event

Parameters help
from
address help
value
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

name Constant

string help
DRAGON

symbol Constant

string help
DRG

standard Variable

string help

decimals Variable

uint8 help

totalSupply Variable

uint256 help

owner Variable

address help

accountCount Variable

uint help

burner Variable

address help

burnerSet Variable

bool help

balanceOf Variable

mapping(address => uint256) help

accountIndex Variable

mapping(uint => address) help

allowance Variable

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

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
tokenHolder
address help

Properties

Visibility help public
Mutability help constant
Source Code
function balanceOf(address tokenHolder) constant returns (uint256) {
  return balanceOf[tokenHolder];
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _value) returns (bool ok) {
  if (balanceOf[msg.sender] < _value) throw;
  if (balanceOf[_to] + _value < balanceOf[_to]) throw;

  appendTokenHolders(_to);
  balanceOf[msg.sender] -= _value;
  balanceOf[_to] += _value;
  Transfer(msg.sender, _to, _value);
  burnCheck(_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
) returns (bool success) {
  if (balanceOf[_from] < _value) throw;
  if (balanceOf[_to] + _value < balanceOf[_to]) throw;
  if (_value > allowance[_from][msg.sender]) throw;
  appendTokenHolders(_to);
  balanceOf[_from] -= _value;
  balanceOf[_to] += _value;
  allowance[_from][msg.sender] -= _value;
  Transfer(_from, _to, _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) returns (bool success) {
  allowance[msg.sender][_spender] = _value;
  Approval(msg.sender, _spender, _value);
  return true;
}

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
function allowance(address _owner, address _spender)
  constant
  returns (uint256 remaining)
{
  return allowance[_owner][_spender];
}

changeOwnership keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function changeOwnership(address _owner) onlyOwner {
  owner = _owner;
}

setBurner keyboard_arrow_up

Parameters help

Name Type
_burner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setBurner(address _burner) onlyOwner {
  require(!burnerSet);
  burner = _burner;
  burnerSet = true;
}

burnDragons keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burnDragons(uint256 _amount) onlyBurner {
  burn(_amount);
}

getAccountCount keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function getAccountCount() constant returns (uint256) {
  return accountCount;
}

getAddress keyboard_arrow_up

Parameters help

Name Type
slot
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
function getAddress(uint256 slot) constant returns (address) {
  return accountIndex[slot];
}

approveAndCall keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
function approveAndCall(
  address _spender,
  uint256 _value,
  bytes _extraData
) returns (bool success) {
  tokenRecipient spender = tokenRecipient(_spender);
  if (approve(_spender, _value)) {
    spender.receiveApproval(msg.sender, _value, this, _extraData);
    return true;
  }
}

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 _value) returns (bool success) {
  if (balanceOf[msg.sender] < _value) throw;
  if (totalSupply - _value < 2100000000000000) throw;
  balanceOf[msg.sender] -= _value;
  totalSupply -= _value;
  Burn(msg.sender, _value);
  return true;
}

burnFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function burnFrom(address _from, uint256 _value) returns (bool success) {
  if (totalSupply - _value < 2100000000000000) throw;
  if (balanceOf[_from] < _value) throw;
  if (_value > allowance[_from][msg.sender]) throw;
  balanceOf[_from] -= _value;
  allowance[_from][msg.sender] -= _value;
  totalSupply -= _value;
  Burn(_from, _value);
  return true;
}

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 Dragon.burnCheck keyboard_arrow_up

Parameters help

Name Type
_tocheck
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function burnCheck(address _tocheck, uint256 amount) internal {
  if (_tocheck != burner) return;

  Burner burn = Burner(burner);
  burn.dragonHandler(amount);
}

internal Dragon.appendTokenHolders keyboard_arrow_up

Parameters help

Name Type
tokenHolder
address help

Properties

Visibility help private
Mutability help transaction
Source Code
function appendTokenHolders(address tokenHolder) private {
  if (balanceOf[tokenHolder] == 0) {
    if (tokenHolder == burner) return;
    accountIndex[accountCount] = tokenHolder;
    accountCount++;
  }
}