Blockwell

Numeraire

ERC20

This contract is an ERC20 token.

Name Numeraire
Symbol NMR
Decimals 18
Total Supply 10,979,491 NMR

About link description

Numeraire (NMR) is a cryptocurrency and operates on the Ethereum platform. Numeraire has a current supply of 10,971,997.04319194 with 4,996,236.71001766 in circulation. The last known price of Numeraire is 31.78956938 USD and is up 2.71 over the last 24 hours. It is currently trading on 48 active market(s) with $20,999,379.05 traded over the last 24 hours. More information can be found at https://numer.ai/.

Stats

Public Functions 29
Event Types 11
Code Size 18,186 bytes

Events (11) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

Confirmation Event

Parameters help
owner
address help
operation
bytes32 help

DelegateChanged Event

Parameters help
oldAddress
address help
newAddress
address help

Mint Event

Parameters help
value
uint256 help

Revoke Event

Parameters help
owner
address help
operation
bytes32 help

RoundCreated Event

Parameters help
tournamentID
uint256 help
roundID
uint256 help
endTime
uint256 help
resolutionTime
uint256 help

StakeDestroyed Event

Parameters help
tournamentID
uint256 help
roundID
uint256 help
stakerAddress
address help
tag
bytes32 help

StakeReleased Event

Parameters help
tournamentID
uint256 help
roundID
uint256 help
stakerAddress
address help
tag
bytes32 help
etherReward
uint256 help

Staked Event

Parameters help
staker
address help
tag
bytes32 help
totalAmountStaked
uint256 help
confidence
uint256 help
tournamentID
uint256 help
roundID
uint256 help

TournamentCreated Event

Parameters help
tournamentID
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

c_maxOwners Constant

uint help
250

delegateContract Variable

address help

contractUpgradable Variable

bool help

standard Variable

string help

name Variable

string help

symbol Variable

string help

decimals Variable

uint256 help

stopped Variable

bool help

stoppable Variable

bool help

required Variable

uint help

numerai Variable

address help

supply_cap Variable

uint256 help

weekly_disbursement Variable

uint256 help

initial_disbursement Variable

uint256 help

deploy_time Variable

uint256 help

total_minted Variable

uint256 help

totalSupply Variable

uint256 help

balanceOf Variable

mapping(address => uint256) help

previousDelegates Variable

address[] help
Internal Variable

owners Variable

address[] help
Internal Variable

ownerIndex Variable

mapping(address => uint) help
Internal Variable

pendings Variable

mapping(bytes32 => PendingState) help
Internal Variable

pendingsIndex Variable

bytes32[] help
Internal Variable

thisContract Variable

address help
Internal Variable

allowance Variable

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

tournaments Variable

mapping(uint => Tournament) help
Internal Variable

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() payable {}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function getMintable() constant returns (uint256) {
  return
    safeSubtract(
      safeAdd(
        initial_disbursement,
        safeMultiply(
          weekly_disbursement,
          safeSubtract(block.timestamp, deploy_time)
        ) / 1 weeks
      ),
      total_minted
    );
}

Parameters help

Name Type
_owners
address[] help
_required
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyManyOwners checks for the following:
Source Code
function changeShareable(address[] _owners, uint256 _required)
  onlyManyOwners(sha3(msg.data))
{
  for (uint256 i = 0; i < _owners.length; ++i) {
    owners[1 + i] = _owners[i];
    ownerIndex[_owners[i]] = 1 + i;
  }
  if (required > owners.length) throw;
  required = _required;
}

Parameters help

Name Type
_operation
bytes32 help

Properties

Visibility help public
Mutability help transaction
Source Code
function revoke(bytes32 _operation) external {
  uint256 index = ownerIndex[msg.sender];
  // make sure they're an owner
  if (index == 0) return;
  uint256 ownerIndexBit = 2**index;
  var pending = pendings[_operation];
  if (pending.ownersDone & ownerIndexBit > 0) {
    pending.yetNeeded++;
    pending.ownersDone -= ownerIndexBit;
    Revoke(msg.sender, _operation);
  }
}

Parameters help

Name Type
ownerIndex
uint help

Properties

Visibility help public
Mutability help constant
Source Code
function getOwner(uint256 ownerIndex) external constant returns (address) {
  return address(owners[ownerIndex + 1]);
}

Parameters help

Name Type
_addr
address help

Properties

Visibility help public
Mutability help constant
Source Code
function isOwner(address _addr) constant returns (bool) {
  return ownerIndex[_addr] > 0;
}

Parameters help

Name Type
_operation
bytes32 help
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
function hasConfirmed(bytes32 _operation, address _owner)
  constant
  returns (bool)
{
  var pending = pendings[_operation];
  uint256 index = ownerIndex[_owner];

  // make sure they're an owner
  if (index == 0) return false;

  // determine the bit to set for this owner.
  uint256 ownerIndexBit = 2**index;
  return !(pending.ownersDone & ownerIndexBit == 0);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:

Requirements help

Source Code
function emergencyStop() external onlyOwner {
  assert(stoppable);
  stopped = true;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyManyOwners checks for the following:

Requirements help

Source Code
function release() external onlyManyOwners(sha3(msg.data)) {
  assert(stoppable);
  stopped = false;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyManyOwners checks for the following:
Source Code
function disableStopping() external onlyManyOwners(sha3(msg.data)) {
  stoppable = false;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyManyOwners checks for the following:

Requirements help

Source Code
function disableContractUpgradability()
  onlyManyOwners(sha3(msg.data))
  returns (bool)
{
  assert(contractUpgradable);
  contractUpgradable = false;
}

Parameters help

Name Type
_newDelegate
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyManyOwners checks for the following:

Requirements help

Source Code
function changeDelegate(address _newDelegate)
  onlyManyOwners(sha3(msg.data))
  returns (bool)
{
  assert(contractUpgradable);

  if (_newDelegate != delegateContract) {
    previousDelegates.push(delegateContract);
    var oldDelegate = delegateContract;
    delegateContract = _newDelegate;
    DelegateChanged(oldDelegate, _newDelegate);
    return true;
  }

  return false;
}

Parameters help

Name Type
_token
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
Source Code
function claimTokens(address _token) onlyOwner {
  assert(_token != numerai);
  if (_token == 0x0) {
    msg.sender.transfer(this.balance);
    return;
  }

  NumeraireBackend token = NumeraireBackend(_token);
  uint256 balance = token.balanceOf(this);
  token.transfer(msg.sender, balance);
}

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:
Source Code
function mint(uint256 _value) stopInEmergency returns (bool ok) {
  return delegateContract.delegatecall(bytes4(sha3("mint(uint256)")), _value);
}

Parameters help

Name Type
_value
uint256 help
_tag
bytes32 help
_tournamentID
uint256 help
_roundID
uint256 help
_confidence
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:
Source Code
function stake(
  uint256 _value,
  bytes32 _tag,
  uint256 _tournamentID,
  uint256 _roundID,
  uint256 _confidence
) stopInEmergency returns (bool ok) {
  return
    delegateContract.delegatecall(
      bytes4(sha3("stake(uint256,bytes32,uint256,uint256,uint256)")),
      _value,
      _tag,
      _tournamentID,
      _roundID,
      _confidence
    );
}

Parameters help

Name Type
_staker
address help
_value
uint256 help
_tag
bytes32 help
_tournamentID
uint256 help
_roundID
uint256 help
_confidence
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:
Source Code
function stakeOnBehalf(
  address _staker,
  uint256 _value,
  bytes32 _tag,
  uint256 _tournamentID,
  uint256 _roundID,
  uint256 _confidence
) stopInEmergency onlyPayloadSize(6) returns (bool ok) {
  return
    delegateContract.delegatecall(
      bytes4(
        sha3("stakeOnBehalf(address,uint256,bytes32,uint256,uint256,uint256)")
      ),
      _staker,
      _value,
      _tag,
      _tournamentID,
      _roundID,
      _confidence
    );
}

Parameters help

Name Type
_staker
address help
_tag
bytes32 help
_etherValue
uint256 help
_tournamentID
uint256 help
_roundID
uint256 help
_successful
bool help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:
Source Code
function releaseStake(
  address _staker,
  bytes32 _tag,
  uint256 _etherValue,
  uint256 _tournamentID,
  uint256 _roundID,
  bool _successful
) stopInEmergency onlyPayloadSize(6) returns (bool ok) {
  return
    delegateContract.delegatecall(
      bytes4(
        sha3("releaseStake(address,bytes32,uint256,uint256,uint256,bool)")
      ),
      _staker,
      _tag,
      _etherValue,
      _tournamentID,
      _roundID,
      _successful
    );
}

Parameters help

Name Type
_staker
address help
_tag
bytes32 help
_tournamentID
uint256 help
_roundID
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:
Source Code
function destroyStake(
  address _staker,
  bytes32 _tag,
  uint256 _tournamentID,
  uint256 _roundID
) stopInEmergency onlyPayloadSize(4) returns (bool ok) {
  return
    delegateContract.delegatecall(
      bytes4(sha3("destroyStake(address,bytes32,uint256,uint256)")),
      _staker,
      _tag,
      _tournamentID,
      _roundID
    );
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function numeraiTransfer(address _to, uint256 _value)
  onlyPayloadSize(2)
  returns (bool ok)
{
  return
    delegateContract.delegatecall(
      bytes4(sha3("numeraiTransfer(address,uint256)")),
      _to,
      _value
    );
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function withdraw(
  address _from,
  address _to,
  uint256 _value
) onlyPayloadSize(3) returns (bool ok) {
  return
    delegateContract.delegatecall(
      bytes4(sha3("withdraw(address,address,uint256)")),
      _from,
      _to,
      _value
    );
}

Parameters help

Name Type
_tournamentID
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function createTournament(uint256 _tournamentID) returns (bool ok) {
  return
    delegateContract.delegatecall(
      bytes4(sha3("createTournament(uint256)")),
      _tournamentID
    );
}

Parameters help

Name Type
_tournamentID
uint256 help
_roundID
uint256 help
_endTime
uint256 help
_resolutionTime
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function createRound(
  uint256 _tournamentID,
  uint256 _roundID,
  uint256 _endTime,
  uint256 _resolutionTime
) returns (bool ok) {
  return
    delegateContract.delegatecall(
      bytes4(sha3("createRound(uint256,uint256,uint256,uint256)")),
      _tournamentID,
      _roundID,
      _endTime,
      _resolutionTime
    );
}

Parameters help

Name Type
_tournamentID
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
function getTournament(uint256 _tournamentID)
  constant
  returns (uint256, uint256[])
{
  var tournament = tournaments[_tournamentID];
  return (tournament.creationTime, tournament.roundIDs);
}

Parameters help

Name Type
_tournamentID
uint256 help
_roundID
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
function getRound(uint256 _tournamentID, uint256 _roundID)
  constant
  returns (
    uint256,
    uint256,
    uint256
  )
{
  var round = tournaments[_tournamentID].rounds[_roundID];
  return (round.creationTime, round.endTime, round.resolutionTime);
}

Parameters help

Name Type
_tournamentID
uint256 help
_roundID
uint256 help
_staker
address help
_tag
bytes32 help

Properties

Visibility help public
Mutability help constant
Source Code
function getStake(
  uint256 _tournamentID,
  uint256 _roundID,
  address _staker,
  bytes32 _tag
)
  constant
  returns (
    uint256,
    uint256,
    bool,
    bool
  )
{
  var stake = tournaments[_tournamentID].rounds[_roundID].stakes[_staker][_tag];
  return (stake.confidence, stake.amount, stake.successful, stake.resolved);
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:

Requirements help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) stopInEmergency onlyPayloadSize(3) returns (bool ok) {
  require(!isOwner(_from) && _from != numerai); // Transfering from Numerai can only be done with the numeraiTransfer function

  // Check for sufficient funds.
  require(balanceOf[_from] >= _value);
  // Check for authorization to spend.
  require(allowance[_from][msg.sender] >= _value);

  balanceOf[_from] = safeSubtract(balanceOf[_from], _value);
  allowance[_from][msg.sender] = safeSubtract(
    allowance[_from][msg.sender],
    _value
  );
  balanceOf[_to] = safeAdd(balanceOf[_to], _value);

  // Notify anyone listening.
  Transfer(_from, _to, _value);

  return true;
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:
Source Code
function transfer(address _to, uint256 _value)
  stopInEmergency
  onlyPayloadSize(2)
  returns (bool ok)
{
  // Check for sufficient funds.
  require(balanceOf[msg.sender] >= _value);

  balanceOf[msg.sender] = safeSubtract(balanceOf[msg.sender], _value);
  balanceOf[_to] = safeAdd(balanceOf[_to], _value);

  // Notify anyone listening.
  Transfer(msg.sender, _to, _value);

  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:

Requirements help

One or more of the following:
Source Code
function approve(address _spender, uint256 _value)
  stopInEmergency
  onlyPayloadSize(2)
  returns (bool ok)
{
  require((_value == 0) || (allowance[msg.sender][_spender] == 0));
  allowance[msg.sender][_spender] = _value;
  Approval(msg.sender, _spender, _value);
  return true;
}

Parameters help

Name Type
_spender
address help
_oldValue
uint256 help
_newValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

stopInEmergency checks for the following:
Source Code
function changeApproval(
  address _spender,
  uint256 _oldValue,
  uint256 _newValue
) stopInEmergency onlyPayloadSize(3) returns (bool ok) {
  require(allowance[msg.sender][_spender] == _oldValue);
  allowance[msg.sender][_spender] = _newValue;
  Approval(msg.sender, _spender, _newValue);
  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 Shareable.confirmAndCheck keyboard_arrow_up

Parameters help

Name Type
_operation
bytes32 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function confirmAndCheck(bytes32 _operation) internal returns (bool) {
  // determine what index the present sender is:
  uint256 index = ownerIndex[msg.sender];
  // make sure they're an owner
  if (index == 0) return;

  var pending = pendings[_operation];
  // if we're not yet working on this operation, switch over and reset the confirmation status.
  if (pending.yetNeeded == 0) {
    // reset count of confirmations needed.
    pending.yetNeeded = required;
    // reset which owners have confirmed (none) - set our bitmap to 0.
    pending.ownersDone = 0;
    pending.index = pendingsIndex.length++;
    pendingsIndex[pending.index] = _operation;
  }
  // determine the bit to set for this owner.
  uint256 ownerIndexBit = 2**index;
  // make sure we (the message sender) haven't confirmed this operation previously.
  if (pending.ownersDone & ownerIndexBit == 0) {
    Confirmation(msg.sender, _operation);
    // ok - check if count is enough to go ahead.
    if (pending.yetNeeded <= 1) {
      // enough confirmations: reset and run interior.
      delete pendingsIndex[pendings[_operation].index];
      delete pendings[_operation];
      return true;
    } else {
      // not enough: record that this owner in particular confirmed.
      pending.yetNeeded--;
      pending.ownersDone |= ownerIndexBit;
    }
  }
}

internal Shareable.clearPending keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
function clearPending() internal {
  uint256 length = pendingsIndex.length;
  for (uint256 i = 0; i < length; ++i)
    if (pendingsIndex[i] != 0) delete pendings[pendingsIndex[i]];
  delete pendingsIndex;
}

internal Safe.safeAdd keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a + b;
  assert(c >= a && c >= b);
  return c;
}

internal Safe.safeSubtract keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeSubtract(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a - b;
  assert(b <= a && c <= a);
  return c;
}

internal Safe.safeMultiply keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function safeMultiply(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a * b;
  assert(a == 0 || (c / a) == b);
  return c;
}

internal Safe.shrink128 keyboard_arrow_up

Parameters help

Name Type
a
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function shrink128(uint256 a) internal returns (uint128) {
  assert(a < 0x100000000000000000000000000000000);
  return uint128(a);
}