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
Constants (1) keyboard_arrow_up
State Variables (25) keyboard_arrow_up
Functions
constructor keyboard_arrow_up
getMintable keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
c
must be less than or equal to
the result of calling safeAdd with initial_disbursement, UNKNOWN ARGUMENT
total_minted
must be less than or equal to
the result of calling safeAdd with initial_disbursement, UNKNOWN ARGUMENT
Source Code
function getMintable() constant returns (uint256) {
return
safeSubtract(
safeAdd(
initial_disbursement,
safeMultiply(
weekly_disbursement,
safeSubtract(block.timestamp, deploy_time)
) / 1 weeks
),
total_minted
);
}
changeShareable keyboard_arrow_up
Modifiers help
onlyManyOwners checks for the following:
Requirements help
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;
}
revoke keyboard_arrow_up
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);
}
}
getOwner keyboard_arrow_up
isOwner keyboard_arrow_up
hasConfirmed keyboard_arrow_up
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);
}
emergencyStop keyboard_arrow_up
release keyboard_arrow_up
disableStopping keyboard_arrow_up
disableContractUpgradability keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyManyOwners checks for the following:
Requirements help
contractUpgradable must be true
Source Code
function disableContractUpgradability()
onlyManyOwners(sha3(msg.data))
returns (bool)
{
assert(contractUpgradable);
contractUpgradable = false;
}
changeDelegate keyboard_arrow_up
Modifiers help
onlyManyOwners checks for the following:
Requirements help
contractUpgradable must be true
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;
}
claimTokens keyboard_arrow_up
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);
}
mint keyboard_arrow_up
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);
}
stake keyboard_arrow_up
Parameters help
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
);
}
stakeOnBehalf keyboard_arrow_up
Parameters help
Modifiers help
stopInEmergency checks for the following:
onlyPayloadSize 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
);
}
releaseStake keyboard_arrow_up
Parameters help
Modifiers help
stopInEmergency checks for the following:
onlyPayloadSize 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
);
}
destroyStake keyboard_arrow_up
Parameters help
Modifiers help
stopInEmergency checks for the following:
onlyPayloadSize 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
);
}
numeraiTransfer keyboard_arrow_up
Modifiers help
onlyPayloadSize checks for the following:
Source Code
function numeraiTransfer(address _to, uint256 _value)
onlyPayloadSize(2)
returns (bool ok)
{
return
delegateContract.delegatecall(
bytes4(sha3("numeraiTransfer(address,uint256)")),
_to,
_value
);
}
withdraw keyboard_arrow_up
Modifiers help
onlyPayloadSize checks for the following:
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
);
}
createTournament keyboard_arrow_up
createRound keyboard_arrow_up
Parameters help
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
);
}
getTournament keyboard_arrow_up
Source Code
function getTournament(uint256 _tournamentID)
constant
returns (uint256, uint256[])
{
var tournament = tournaments[_tournamentID];
return (tournament.creationTime, tournament.roundIDs);
}
getRound keyboard_arrow_up
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);
}
getStake keyboard_arrow_up
Parameters help
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);
}
transferFrom keyboard_arrow_up
Modifiers help
stopInEmergency checks for the following:
onlyPayloadSize 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;
}
transfer keyboard_arrow_up
Modifiers help
stopInEmergency checks for the following:
onlyPayloadSize checks for the following:
Requirements help
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;
}
approve keyboard_arrow_up
Modifiers help
stopInEmergency checks for the following:
onlyPayloadSize 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;
}
changeApproval keyboard_arrow_up
Modifiers help
stopInEmergency checks for the following:
onlyPayloadSize checks for the following:
Requirements help
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
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
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.
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
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
Requirements help
c
must be less than or equal to
the result of calling safeAdd with initial_disbursement, UNKNOWN ARGUMENT
total_minted
must be less than or equal to
the result of calling safeAdd with initial_disbursement, UNKNOWN ARGUMENT
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
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
Source Code
function shrink128(uint256 a) internal returns (uint128) {
assert(a < 0x100000000000000000000000000000000);
return uint128(a);
}