ERC20
This contract is an ERC20 token.
Name
Genaro X
Symbol
GNX
Decimals
9
Total Supply
650,000,000 GNX
About
link
description
Genaro Network (GNX) is a cryptocurrency token and operates on the Ethereum platform. Users are able to generate GNX through the process of mining. Genaro Network has a current supply of 650,000,000 with 258,934,740.484 in circulation. The last known price of Genaro Network is $0.036105 USD and is up 24.04% over the last 24 hours. It is currently trading on 15 active market(s) with $3,841,223.609 traded over the last 24 hours. More information can be found at https://genaro.network/.
Stats
Public Functions
28
Event Types
4
Code Size
34,385 bytes
Events (4) keyboard_arrow_up
Functions
changeController keyboard_arrow_up
Modifiers help
onlyController checks for the following:
Source Code
function changeController(address _newController) onlyController {
controller = _newController;
}
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
allowance keyboard_arrow_up
transfer keyboard_arrow_up
Modifiers help
canTransfer checks for the following:
_value
must be less than or equal to
the result of calling spendableBalanceOf with the sender's address
Requirements help
transfersEnabled must be true
Source Code
function transfer(address _to, uint _value)
canTransfer(msg.sender, _value)
public
returns (bool success) {
return super.transfer(_to, _value);
}
transferFrom keyboard_arrow_up
Modifiers help
canTransfer checks for the following:
_value
must be less than or equal to
the result of calling spendableBalanceOf with the sender's address
Requirements help
Source Code
function transferFrom(address _from, address _to, uint _value)
canTransfer(_from, _value)
public
returns (bool success) {
return super.transferFrom(_from, _to, _value);
}
approve keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
transfersEnabled must be true
Source Code
function transfer(address _to, uint256 _amount) returns (bool success) {
require (transfersEnabled);
////if (!transfersEnabled) throw;
return doTransfer(msg.sender, _to, _amount);
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(address _from, address _to, uint256 _amount
) returns (bool success) {
// The controller of this contract can move tokens around at will,
// this is important to recognize! Confirm that you trust the
// controller of this contract, which in most situations should be
// another open source smart contract or 0x0
if (msg.sender != controller) {
require (transfersEnabled);
////if (!transfersEnabled) throw;
// The standard ERC 20 transferFrom functionality
assert (allowed[_from][msg.sender]>=_amount);
////if (allowed[_from][msg.sender] < _amount) throw;
allowed[_from][msg.sender] -= _amount;
}
return doTransfer(_from, _to, _amount);
}
approve keyboard_arrow_up
Requirements help
transfersEnabled must be true
One or more of the following:
Source Code
function approve(address _spender, uint256 _amount) returns (bool success) {
require(transfersEnabled);
// To change the approve amount you first have to reduce the addresses´
// allowance to zero by calling `approve(_spender,0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_amount==0)||(allowed[msg.sender][_spender]==0));
// Alerts the token controller of the approve function call
if (isContract(controller)) {
assert(Controller(controller).onApprove(msg.sender,_spender,_amount));
// if (!Controller(controller).onApprove(msg.sender, _spender, _amount))
// throw;
}
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
approveAndCall keyboard_arrow_up
Requirements help
transfersEnabled must be true
One or more of the following:
Source Code
function approveAndCall(address _spender, uint256 _amount, bytes _extraData
) returns (bool success) {
approve(_spender, _amount);
// This portion is copied from ConsenSys's Standard Token Contract. It
// calls the receiveApproval function that is part of the contract that
// is being approved (`_spender`). The function should look like:
// `receiveApproval(address _from, uint256 _amount, address
// _tokenContract, bytes _extraData)` It is assumed that the call
// *should* succeed, otherwise the plain vanilla approve would be used
ApproveAndCallReceiver(_spender).receiveApproval(
msg.sender,
_amount,
this,
_extraData
);
return true;
}
balanceOfAt keyboard_arrow_up
Source Code
function balanceOfAt(address _owner, uint _blockNumber) constant
returns (uint) {
// These next few lines are used when the balance of the token is
// requested before a check point was ever created for this token, it
// requires that the `parentToken.balanceOfAt` be queried at the
// genesis block for that token as this contains initial balance of
// this token
if ((balances[_owner].length == 0)
|| (balances[_owner][0].fromBlock > _blockNumber)) {
if (address(parentToken) != 0) {
return parentToken.balanceOfAt(_owner, min(_blockNumber, parentSnapShotBlock));
} else {
// Has no parent
return 0;
}
// This will return the expected balance during normal situations
} else {
return getValueAt(balances[_owner], _blockNumber);
}
}
totalSupplyAt keyboard_arrow_up
Source Code
function totalSupplyAt(uint _blockNumber) constant returns(uint) {
// These next few lines are used when the totalSupply of the token is
// requested before a check point was ever created for this token, it
// requires that the `parentToken.totalSupplyAt` be queried at the
// genesis block for this token as that contains totalSupply of this
// token at this block number.
if ((totalSupplyHistory.length == 0)
|| (totalSupplyHistory[0].fromBlock > _blockNumber)) {
if (address(parentToken) != 0) {
return parentToken.totalSupplyAt(min(_blockNumber, parentSnapShotBlock));
} else {
return 0;
}
// This will return the expected totalSupply during normal situations
} else {
return getValueAt(totalSupplyHistory, _blockNumber);
}
}
createCloneToken keyboard_arrow_up
Parameters help
Source Code
function createCloneToken(
string _cloneTokenName,
uint8 _cloneDecimalUnits,
string _cloneTokenSymbol,
uint _snapshotBlock,
bool _transfersEnabled
) returns(address) {
if (_snapshotBlock > block.number) _snapshotBlock = block.number;
MiniMeToken cloneToken = tokenFactory.createCloneToken(
this,
_snapshotBlock,
_cloneTokenName,
_cloneDecimalUnits,
_cloneTokenSymbol,
_transfersEnabled
);
cloneToken.changeController(msg.sender);
// An event to make the token easy to find on the blockchain
NewCloneToken(address(cloneToken), _snapshotBlock);
return address(cloneToken);
}
generateTokens keyboard_arrow_up
Modifiers help
onlyController checks for the following:
Requirements help
Source Code
function generateTokens(address _owner, uint _amount
) onlyController returns (bool) {
uint curTotalSupply = totalSupply();
//uint curTotalSupply = getValueAt(totalSupplyHistory, block.number);
assert(curTotalSupply+_amount>=curTotalSupply);
updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);
var previousBalanceTo = balanceOf(_owner);
assert(previousBalanceTo+_amount>=previousBalanceTo);
updateValueAtNow(balances[_owner], previousBalanceTo + _amount);
Transfer(0, _owner, _amount);
return true;
}
destroyTokens keyboard_arrow_up
Modifiers help
onlyController checks for the following:
Requirements help
Source Code
function destroyTokens(address _owner, uint _amount
) onlyController returns (bool) {
uint curTotalSupply = totalSupply();
//uint curTotalSupply = getValueAt(totalSupplyHistory, block.number);
assert(curTotalSupply >= _amount);
//// if (curTotalSupply < _amount) throw;
updateValueAtNow(totalSupplyHistory, curTotalSupply - _amount);
var previousBalanceFrom = balanceOf(_owner);
assert(previousBalanceFrom >=_amount);
//// if (previousBalanceFrom < _amount) throw;
updateValueAtNow(balances[_owner], previousBalanceFrom - _amount);
Transfer(_owner, 0, _amount);
return true;
}
enableTransfers keyboard_arrow_up
Modifiers help
onlyController checks for the following:
Source Code
function enableTransfers(bool _transfersEnabled) onlyController {
transfersEnabled = _transfersEnabled;
}
constructor keyboard_arrow_up
spendableBalanceOf keyboard_arrow_up
Requirements help
Source Code
function spendableBalanceOf(address _holder) constant public returns (uint) {
return transferableTokens(_holder, uint64(now));
}
grantVestedTokens keyboard_arrow_up
Parameters help
Requirements help
MAX_GRANTS_PER_ADDRESS
must be greater than or equal to
the result of calling tokenGrantsCount with _to
null
Source Code
function grantVestedTokens(
address _to,
uint256 _value,
uint64 _start,
uint64 _cliff,
uint64 _vesting) public {
// Check start, cliff and vesting are properly order to ensure correct functionality of the formula.
require(_cliff >= _start && _vesting >= _cliff);
require(tokenGrantsCount(_to)<=MAX_GRANTS_PER_ADDRESS); //// To prevent a user being spammed and have his balance locked (out of gas attack when calculating vesting).
assert(canCreateGrants[msg.sender]);
TokenGrant memory grant = TokenGrant(msg.sender, _value, _cliff, _vesting, _start);
grants[_to].push(grant);
assert(transfer(_to,_value));
NewTokenGrant(msg.sender, _to, _value, _cliff, _vesting, _start);
}
setCanCreateGrants keyboard_arrow_up
Modifiers help
onlyVestingWhitelister checks for the following:
Source Code
function setCanCreateGrants(address _addr, bool _allowed)
onlyVestingWhitelister public {
doSetCanCreateGrants(_addr, _allowed);
}
changeVestingWhitelister keyboard_arrow_up
Modifiers help
onlyVestingWhitelister checks for the following:
Source Code
function changeVestingWhitelister(address _newWhitelister) onlyVestingWhitelister public {
doSetCanCreateGrants(vestingWhitelister, false);
vestingWhitelister = _newWhitelister;
doSetCanCreateGrants(vestingWhitelister, true);
}
tokenGrantsCount keyboard_arrow_up
tokenGrant keyboard_arrow_up
Source Code
function tokenGrant(address _holder, uint _grantId) constant public returns (address granter, uint256 value, uint256 vested, uint64 start, uint64 cliff, uint64 vesting) {
TokenGrant storage grant = grants[_holder][_grantId];
granter = grant.granter;
value = grant.value;
start = grant.start;
cliff = grant.cliff;
vesting = grant.vesting;
vested = vestedTokens(grant, uint64(now));
}
lastTokenIsTransferableDate keyboard_arrow_up
Source Code
function lastTokenIsTransferableDate(address holder) constant public returns (uint64 date) {
date = uint64(now);
uint256 grantIndex = tokenGrantsCount(holder);
for (uint256 i = 0; i < grantIndex; i++) {
date = max64(grants[holder][i].vesting, date);
}
return date;
}
transferableTokens keyboard_arrow_up
Requirements help
Source Code
function transferableTokens(address holder, uint64 time) constant public returns (uint256) {
uint256 grantIndex = tokenGrantsCount(holder);
if (grantIndex == 0) return balanceOf(holder); // shortcut for holder without grants
// Iterate through all the grants the holder has, and add all non-vested tokens
uint256 nonVested = 0;
for (uint256 i = 0; i < grantIndex; i++) {
nonVested = safeAdd(nonVested, nonVestedTokens(grants[holder][i], time));
}
// Balance - totalNonVested is the amount of tokens a holder can transfer at any given time
return safeSub(balanceOf(holder), nonVested);
}
multiMint keyboard_arrow_up
Modifiers help
onlyController checks for the following:
Source Code
function multiMint(uint[] data) onlyController {
for (uint i = 0; i < data.length; i++ ) {
address addr = address( data[i] & (D160-1) );
uint amount = data[i] / D160;
assert(generateTokens(addr,amount));
}
}
sterilize keyboard_arrow_up
Modifiers help
onlyController checks for the following:
Source Code
function sterilize(uint[] data) onlyController {
for (uint i = 0; i < data.length; i++ ) {
address addr = address( data[i] & (D160-1) );
uint amount = data[i] / D160;
assert(destroyTokens(addr,amount));
}
}