Blockwell

RING

ERC20

This contract is an ERC20 token.

Name RING
Symbol
Decimals 18
Total Supply 989,153,247

About link description

Darwinia Network (RING) is a cryptocurrency and operates on the Ethereum platform. Darwinia Network has a current supply of 2,058,420,923.6562107 with 451,602,953.8689697 in circulation. The last known price of Darwinia Network is 0.03662799 USD and is down -0.32 over the last 24 hours. It is currently trading on 26 active market(s) with $9,597,741.88 traded over the last 24 hours. More information can be found at https://darwinia.network/.

Stats

Public Functions 34
Event Types 9
Code Size 20,053 bytes

Events (9) keyboard_arrow_up

Approval Event

Parameters help
src
address help
guy
address help
wad
uint help

Burn Event

Parameters help
guy
address help
wad
uint help

ClaimedTokens Event

Parameters help
_token
address help
_controller
address help
_amount
uint help

ERC223Transfer Event

Parameters help
from
address help
to
address help
amount
uint help
data
bytes help

LogNote Event

Parameters help
sig
bytes4 help
guy
address help
foo
bytes32 help
bar
bytes32 help
wad
uint help
fax
bytes help

LogSetAuthority Event

Parameters help
authority
address help

LogSetOwner Event

Parameters help
owner
address help

Mint Event

Parameters help
guy
address help
wad
uint help

Transfer Event

Parameters help
src
address help
dst
address help
wad
uint help

WAD Constant

uint help
UNKNOWN VALUE

RAY Constant

uint help
UNKNOWN VALUE

newOwner Variable

address help

transfersEnabled Variable

bool help

cap Variable

uint256 help

controller Variable

address help

symbol Variable

bytes32 help

decimals Variable

uint256 help

name Variable

bytes32 help

stopped Variable

bool help

authority Variable

address help

owner Variable

address help

_supply Variable

uint256 help
Internal Variable

_balances Variable

mapping(address => uint256) help
Internal Variable

_approvals Variable

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

Functions Expand All Collapse All

transferOwnership keyboard_arrow_up

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function transferOwnership(address _newOwner) public auth {
  require(_newOwner != owner);
  newOwner = _newOwner;
}

acceptOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function acceptOwnership() public {
  require(msg.sender == newOwner);
  owner = newOwner;
  newOwner = address(0);
}

disableTransfers keyboard_arrow_up

Parameters help

Name Type
_disable
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function disableTransfers(bool _disable) public auth {
  transfersEnabled = !_disable;
}

issue keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function issue(address _to, uint256 _amount) public auth stoppable {
  mint(_to, _amount);
}

destroy keyboard_arrow_up

Parameters help

Name Type
_from
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function destroy(address _from, uint256 _amount) public auth stoppable {
  // do not require allowance

  _balances[_from] = sub(_balances[_from], _amount);
  _supply = sub(_supply, _amount);
  emit Burn(_from, _amount);
  emit Transfer(_from, 0, _amount);
}

setOwner keyboard_arrow_up

Parameters help

Name Type
owner_
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function setOwner(address owner_) public auth {
  owner = owner_;
  emit LogSetOwner(owner);
}

setAuthority keyboard_arrow_up

Parameters help

Name Type
authority_
DSAuthority help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function setAuthority(DSAuthority authority_) public auth {
  authority = authority_;
  emit LogSetAuthority(authority);
}

stop keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
note checks for the following:
Source Code
function stop() public auth note {
  stopped = true;
}

start keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
note checks for the following:
Source Code
function start() public auth note {
  stopped = false;
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
src
address help

Properties

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

Parameters help

Name Type
src
address help
guy
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address src, address guy) public view returns (uint256) {
  return _approvals[src][guy];
}

Parameters help

Name Type
guy
address help
wad
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function approve(address guy, uint256 wad) public stoppable returns (bool) {
  return super.approve(guy, wad);
}

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) public 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

Modifiers help

Source Code
function transferFrom(
  address src,
  address dst,
  uint256 wad
) public stoppable returns (bool) {
  if (src != msg.sender && _approvals[src][msg.sender] != uint256(-1)) {
    _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad);
  }

  _balances[src] = sub(_balances[src], wad);
  _balances[dst] = add(_balances[dst], wad);

  emit Transfer(src, dst, wad);

  return true;
}

Parameters help

Name Type
guy
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function approve(address guy) public stoppable returns (bool) {
  return super.approve(guy, uint256(-1));
}

push keyboard_arrow_up

Parameters help

Name Type
dst
address help
wad
uint help

Properties

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

pull keyboard_arrow_up

Parameters help

Name Type
src
address help
wad
uint help

Properties

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

move keyboard_arrow_up

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

mint keyboard_arrow_up

Parameters help

Name Type
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function mint(uint256 wad) public {
  mint(msg.sender, wad);
}

burn keyboard_arrow_up

Parameters help

Name Type
wad
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 wad) public {
  burn(msg.sender, wad);
}

mint keyboard_arrow_up

Parameters help

Name Type
_guy
address help
_wad
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function mint(address _guy, uint256 _wad) auth stoppable {
  require(add(_supply, _wad) <= cap);

  super.mint(_guy, _wad);

  emit Transfer(0, _guy, _wad);
}

burn keyboard_arrow_up

Parameters help

Name Type
_guy
address help
_wad
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function burn(address _guy, uint256 _wad) auth stoppable {
  super.burn(_guy, _wad);

  emit Transfer(_guy, 0, _wad);
}

setName keyboard_arrow_up

Parameters help

Name Type
name_
bytes32 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function setName(bytes32 name_) public auth {
  name = name_;
}

changeCap keyboard_arrow_up

Parameters help

Name Type
_newCap
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function changeCap(uint256 _newCap) public auth {
  require(_newCap >= _supply);

  cap = _newCap;
}

changeController keyboard_arrow_up

Parameters help

Name Type
_newController
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function changeController(address _newController) auth {
  controller = _newController;
}

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _amount
) public transfersAllowed returns (bool success) {
  // Alerts the token controller of the transfer
  if (isContract(controller)) {
    if (!TokenController(controller).onTransfer(_from, _to, _amount)) revert();
  }

  success = super.transferFrom(_from, _to, _amount);
}

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint256 help
_data
bytes help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _amount,
  bytes _data
) public transfersAllowed returns (bool success) {
  // Alerts the token controller of the transfer
  if (isContract(controller)) {
    if (!TokenController(controller).onTransfer(_from, _to, _amount)) revert();
  }

  require(super.transferFrom(_from, _to, _amount));

  if (isContract(_to)) {
    ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
    receiver.tokenFallback(_from, _amount, _data);
  }

  emit ERC223Transfer(_from, _to, _amount, _data);

  return true;
}

Parameters help

Name Type
_to
address help
_amount
uint256 help
_data
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(
  address _to,
  uint256 _amount,
  bytes _data
) public returns (bool success) {
  return transferFrom(msg.sender, _to, _amount, _data);
}

Parameters help

Name Type
_spender
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _amount) returns (bool success) {
  // Alerts the token controller of the approve function call
  if (isContract(controller)) {
    if (!TokenController(controller).onApprove(msg.sender, _spender, _amount))
      revert();
  }

  return super.approve(_spender, _amount);
}

approveAndCall keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_amount
uint256 help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
function approveAndCall(
  address _spender,
  uint256 _amount,
  bytes _extraData
) returns (bool success) {
  if (!approve(_spender, _amount)) revert();

  ApproveAndCallFallBack(_spender).receiveApproval(
    msg.sender,
    _amount,
    this,
    _extraData
  );

  return true;
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() payable {
  if (isContract(controller)) {
    if (
      !TokenController(controller).proxyPayment.value(msg.value)(
        msg.sender,
        msg.sig,
        msg.data
      )
    ) revert();
  } else {
    revert();
  }
}

claimTokens keyboard_arrow_up

Parameters help

Name Type
_token
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function claimTokens(address _token) public auth {
  if (_token == 0x0) {
    address(msg.sender).transfer(address(this).balance);
    return;
  }

  ERC20 token = ERC20(_token);
  uint256 balance = token.balanceOf(this);
  token.transfer(address(msg.sender), balance);

  emit ClaimedTokens(_token, address(msg.sender), balance);
}

withdrawTokens keyboard_arrow_up

Parameters help

Name Type
_token
ERC20 help
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

auth checks for the following:
null
Source Code
function withdrawTokens(
  ERC20 _token,
  address _to,
  uint256 _amount
) public auth {
  assert(_token.transfer(_to, _amount));
}

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 RING.isContract keyboard_arrow_up

Parameters help

Name Type
_addr
address help

Properties

Visibility help internal
Mutability help constant
Source Code
function isContract(address _addr) internal constant returns (bool) {
  uint256 size;
  if (_addr == 0) return false;
  assembly {
    size := extcodesize(_addr)
  }
  return size > 0;
}

internal DSMath.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 DSMath.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);
}

internal DSMath.mul keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
  require(y == 0 || (z = x * y) / y == x);
}

internal DSMath.min keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
  return x <= y ? x : y;
}

internal DSMath.max keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function max(uint256 x, uint256 y) internal pure returns (uint256 z) {
  return x >= y ? x : y;
}

internal DSMath.imin keyboard_arrow_up

Parameters help

Name Type
x
int help
y
int help

Properties

Visibility help internal
Mutability help pure
Source Code
function imin(int256 x, int256 y) internal pure returns (int256 z) {
  return x <= y ? x : y;
}

internal DSMath.imax keyboard_arrow_up

Parameters help

Name Type
x
int help
y
int help

Properties

Visibility help internal
Mutability help pure
Source Code
function imax(int256 x, int256 y) internal pure returns (int256 z) {
  return x >= y ? x : y;
}

internal DSMath.wmul keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function wmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
  z = add(mul(x, y), WAD / 2) / WAD;
}

internal DSMath.rmul keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) {
  z = add(mul(x, y), RAY / 2) / RAY;
}

internal DSMath.wdiv keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function wdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {
  z = add(mul(x, WAD), y / 2) / y;
}

internal DSMath.rdiv keyboard_arrow_up

Parameters help

Name Type
x
uint help
y
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function rdiv(uint256 x, uint256 y) internal pure returns (uint256 z) {
  z = add(mul(x, RAY), y / 2) / y;
}

internal DSMath.rpow keyboard_arrow_up

Parameters help

Name Type
x
uint help
n
uint help

Properties

Visibility help internal
Mutability help pure
Source Code
function rpow(uint256 x, uint256 n) internal pure returns (uint256 z) {
  z = n % 2 != 0 ? x : RAY;

  for (n /= 2; n != 0; n /= 2) {
    x = rmul(x, x);

    if (n % 2 != 0) {
      z = rmul(z, x);
    }
  }
}

internal DSAuth.isAuthorized keyboard_arrow_up

Parameters help

Name Type
src
address help
sig
bytes4 help

Properties

Visibility help internal
Mutability help view
Source Code
function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
  if (src == address(this)) {
    return true;
  } else if (src == owner) {
    return true;
  } else if (authority == DSAuthority(0)) {
    return false;
  } else {
    return authority.canCall(src, this, sig);
  }
}