Blockwell

NEOWORLD CASH

ERC20

This contract is an ERC20 token.

Name NEOWORLD CASH
Symbol NASH
Decimals 18
Total Supply 100,000,000,000 NASH

About link description

NeoWorld Cash (NASH) is a cryptocurrency and operates on the Ethereum platform. NeoWorld Cash has a current supply of 100,000,000,000 with 23,709,948,545.63672 in circulation. The last known price of NeoWorld Cash is 0.0000126 USD and is down -27.57 over the last 24 hours. It is currently trading on 3 active market(s) with $93.33 traded over the last 24 hours. More information can be found at https://neoworld.io/.

Stats

Public Functions 30
Event Types 11
Code Size 18,931 bytes

Library Use

Uses SafeMath for uint256.
Uses ContractLib for address.

Events (11) keyboard_arrow_up

AddSupportedToken Event

Parameters help
_address
address help
_price
uint256 help
_startTime
uint256 help
_endTime
uint256 help

Approval Event

Parameters help
tokenOwner
address help
spender
address help
tokens
uint help

Burn Event

Parameters help
from
address help
value
uint256 help

Locked Event

Parameters help
_address
address help
_count
uint256 help
_starttime
uint256 help
_unlockPeriodInSeconds
uint256 help
_unlockNumberOfCycles
uint256 help

OwnershipTransferred Event

Parameters help
_from
address help
_to
address help

Pause Event

Parameters help

RemoveSupportedToken Event

Parameters help
_address
address help

Transfer Event

Parameters help
from
address help
to
address help
tokens
uint help

Transfer Event

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

Unlocked Event

Parameters help
_address
address help
_count
uint256 help

Unpause Event

Parameters help

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

totalSupply Variable

uint256 help

paused Variable

bool help

owner Variable

address help

newOwner Variable

address help

balances Variable

mapping(address => uint) help
Internal Variable

allowed Variable

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

supportedERC20Token Variable

address[] help
Internal Variable

tokenSupported Variable

mapping(address => bool) help
Internal Variable

prices Variable

mapping(address => uint256) help
Internal Variable

starttime Variable

mapping(address => uint256) help
Internal Variable

endtime Variable

mapping(address => uint256) help
Internal Variable

maxTokenCountPerTrans Variable

uint256 help
Internal Variable

nashInPool Variable

uint256 help
Internal Variable

lockedBalanceTotal Variable

mapping(address => uint256) help
Internal Variable

lockedStartTime Variable

mapping(address => uint256) help
Internal Variable

unlockPeriod Variable

mapping(address => uint256) help
Internal Variable

unlockNumberOfCycles Variable

mapping(address => uint256) help
Internal Variable

lockedBalanceRemains Variable

mapping(address => uint256) help
Internal Variable

cyclesUnlocked Variable

mapping(address => uint256) help
Internal Variable

addressAllowToLock Variable

mapping(address => bool) 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
Source Code
function transferOwnership(address _newOwner) public onlyOwner {
  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);
  emit OwnershipTransferred(owner, newOwner);
  owner = newOwner;
  newOwner = address(0);
}

pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function pause() public onlyOwner whenNotPaused returns (bool) {
  paused = true;
  emit Pause();
  return true;
}

unpause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unpause() public onlyOwner whenPaused returns (bool) {
  paused = false;
  emit Unpause();
  return true;
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
_owner
address help

Properties

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

Parameters help

Name Type
tokenOwner
address help
spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
function allowance(address tokenOwner, address spender)
  public
  constant
  returns (uint256)
{
  return allowed[tokenOwner][spender];
}

Parameters help

Name Type
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function transfer(address _to, uint256 _value)
  public
  whenNotPaused
  returns (bool)
{
  //standard function transfer similar to ERC20 transfer with no _data
  //added due to backwards compatibility reasons
  require(_to != 0x0);

  bytes memory empty;
  if (_to.isContract()) {
    return transferToContract(_to, _value, empty);
  } else {
    return transferToAddress(_to, _value, empty);
  }
}

Parameters help

Name Type
spender
address help
tokens
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function approve(address spender, uint256 tokens)
  public
  whenNotPaused
  returns (bool)
{
  allowed[msg.sender][spender] = tokens;
  emit Approval(msg.sender, spender, tokens);
  return true;
}

Parameters help

Name Type
from
address help
to
address help
tokens
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transferFrom(
  address from,
  address to,
  uint256 tokens
) public whenNotPaused returns (bool) {
  allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
  balances[from] = balances[from].sub(tokens);
  balances[to] = balances[to].add(tokens);
  emit Transfer(from, to, tokens);
  return true;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function name() public constant returns (string) {
  return name;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function symbol() public constant returns (string) {
  return symbol;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function decimals() public constant returns (uint8) {
  return decimals;
}

Parameters help

Name Type
_to
address help
_value
uint help
_data
bytes help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function transfer(
  address _to,
  uint256 _value,
  bytes _data
) public whenNotPaused returns (bool) {
  require(_to != 0x0);
  if (_to.isContract()) {
    return transferToContract(_to, _value, _data);
  } else {
    return transferToAddress(_to, _value, _data);
  }
}

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function burn(uint256 _value) public whenNotPaused returns (bool) {
  require(_value > 0);
  require(balanceOf(msg.sender) >= _value); // Check if the sender has enough
  balances[msg.sender] = balanceOf(msg.sender).sub(_value); // Subtract from the sender
  totalSupply = totalSupply.sub(_value); // Updates totalSupply
  emit Burn(msg.sender, _value);
  return true;
}

increaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_addedValue
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function increaseApproval(address _spender, uint256 _addedValue)
  public
  whenNotPaused
  returns (bool success)
{
  allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(
    _addedValue
  );
  emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
  return true;
}

decreaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_subtractedValue
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function decreaseApproval(address _spender, uint256 _subtractedValue)
  public
  whenNotPaused
  returns (bool success)
{
  uint256 oldValue = allowed[msg.sender][_spender];
  if (_subtractedValue > oldValue) {
    allowed[msg.sender][_spender] = 0;
  } else {
    allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
  }
  emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
  return true;
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

transferAnyERC20Token keyboard_arrow_up

Parameters help

Name Type
tokenAddress
address help
tokens
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferAnyERC20Token(address tokenAddress, uint256 tokens)
  public
  onlyOwner
  returns (bool)
{
  return ERC20Interface(tokenAddress).transfer(owner, tokens);
}

addSupportedToken keyboard_arrow_up

Parameters help

Name Type
_address
address help
_price
uint256 help
_startTime
uint256 help
_endTime
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function addSupportedToken(
  address _address,
  uint256 _price,
  uint256 _startTime,
  uint256 _endTime
) public onlyOwner returns (bool) {
  require(_address != 0x0);
  require(_address.isContract());
  require(_startTime < _endTime);
  require(_price > 0);
  require(_endTime > block.timestamp);

  for (uint256 i = 0; i < supportedERC20Token.length; i++) {
    require(supportedERC20Token[i] != _address);
  }

  supportedERC20Token.push(_address);
  tokenSupported[_address] = true;
  prices[_address] = _price;
  starttime[_address] = _startTime;
  endtime[_address] = _endTime;

  emit AddSupportedToken(_address, _price, _startTime, _endTime);

  return true;
}

removeSupportedToken keyboard_arrow_up

Parameters help

Name Type
_address
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function removeSupportedToken(address _address)
  public
  onlyOwner
  returns (bool)
{
  require(_address != 0x0);
  uint256 length = supportedERC20Token.length;
  for (uint256 i = 0; i < length; i++) {
    if (supportedERC20Token[i] == _address) {
      if (i != length - 1) {
        supportedERC20Token[i] = supportedERC20Token[length - 1];
      }
      delete supportedERC20Token[length - 1];
      supportedERC20Token.length--;

      prices[_address] = 0;
      starttime[_address] = 0;
      endtime[_address] = 0;
      tokenSupported[_address] = false;

      emit RemoveSupportedToken(_address);

      break;
    }
  }
  return true;
}

joinPreSale keyboard_arrow_up

Parameters help

Name Type
_tokenAddress
address help
_tokenCount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function joinPreSale(address _tokenAddress, uint256 _tokenCount)
  public
  canBuy(_tokenAddress)
  returns (bool)
{
  require(prices[_tokenAddress] > 0);
  uint256 total = _tokenCount.mul(prices[_tokenAddress]); // will not overflow here since the price will not be high
  balances[msg.sender] = balances[msg.sender].sub(total);
  nashInPool = nashInPool.add(total);

  require(ERC20Interface(_tokenAddress).transfer(msg.sender, _tokenCount));
  emit Transfer(msg.sender, this, total);

  return true;
}

transferNashOut keyboard_arrow_up

Parameters help

Name Type
_to
address help
count
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferNashOut(address _to, uint256 count)
  public
  onlyOwner
  returns (bool)
{
  require(_to != 0x0);
  nashInPool = nashInPool.sub(count);
  balances[_to] = balances[_to].add(count);

  emit Transfer(this, _to, count);

  return true;
}

getSupportedTokens keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function getSupportedTokens() public view returns (address[]) {
  return supportedERC20Token;
}

getTokenStatus keyboard_arrow_up

Parameters help

Name Type
_tokenAddress
address help

Properties

Visibility help public
Mutability help view
Source Code
function getTokenStatus(address _tokenAddress)
  public
  view
  returns (
    uint256 _starttime,
    uint256 _endtime,
    uint256 _price
  )
{
  _starttime = starttime[_tokenAddress];
  _endtime = endtime[_tokenAddress];
  _price = prices[_tokenAddress];
}

allowToLock keyboard_arrow_up

Parameters help

Name Type
_address
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function allowToLock(address _address) public onlyOwner {
  require(_address != 0x0);
  addressAllowToLock[_address] = true;
}

disallowToLock keyboard_arrow_up

Parameters help

Name Type
_address
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function disallowToLock(address _address) public onlyOwner {
  require(_address != 0x0);
  addressAllowToLock[_address] = false;
}

lock keyboard_arrow_up

Parameters help

Name Type
_count
uint256 help
_starttime
uint256 help
_unlockPeriodInSeconds
uint256 help
_unlockNumberOfCycles
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function lock(
  uint256 _count,
  uint256 _starttime,
  uint256 _unlockPeriodInSeconds,
  uint256 _unlockNumberOfCycles
) public returns (bool) {
  require(addressAllowToLock[msg.sender]);
  require(lockedStartTime[msg.sender] == 0);
  require(0 < _unlockNumberOfCycles && _unlockNumberOfCycles <= 10);
  require(_unlockPeriodInSeconds > 0);
  require(_count > 10000);
  require(_starttime > 0);

  balances[msg.sender] = balances[msg.sender].sub(_count);

  lockedBalanceTotal[msg.sender] = _count;
  lockedStartTime[msg.sender] = _starttime;
  unlockPeriod[msg.sender] = _unlockPeriodInSeconds;
  unlockNumberOfCycles[msg.sender] = _unlockNumberOfCycles;

  lockedBalanceRemains[msg.sender] = lockedBalanceTotal[msg.sender];

  emit Locked(
    msg.sender,
    _count,
    _starttime,
    _unlockPeriodInSeconds,
    _unlockNumberOfCycles
  );

  return true;
}

tryUnlock keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function tryUnlock() public returns (bool) {
  require(lockedBalanceRemains[msg.sender] > 0);
  uint256 cycle = (block.timestamp.sub(lockedStartTime[msg.sender])) /
    unlockPeriod[msg.sender];
  require(cycle > cyclesUnlocked[msg.sender]);

  if (cycle > unlockNumberOfCycles[msg.sender]) {
    cycle = unlockNumberOfCycles[msg.sender];
  }

  uint256 amount = lockedBalanceTotal[msg.sender].mul(
    cycle - cyclesUnlocked[msg.sender]
  ) / unlockNumberOfCycles[msg.sender];
  lockedBalanceRemains[msg.sender] = lockedBalanceRemains[msg.sender].sub(
    amount
  );
  balances[msg.sender] = balances[msg.sender].add(amount);

  if (cycle == unlockNumberOfCycles[msg.sender]) {
    // cleanup
    lockedBalanceTotal[msg.sender] = 0;
    lockedStartTime[msg.sender] = 0;
    unlockPeriod[msg.sender] = 0;
    unlockNumberOfCycles[msg.sender] = 0;
    cyclesUnlocked[msg.sender] = 0;

    if (lockedBalanceRemains[msg.sender] > 0) {
      balances[msg.sender] = balances[msg.sender].add(
        lockedBalanceRemains[msg.sender]
      );
      lockedBalanceRemains[msg.sender] = 0;
    }
  } else {
    cyclesUnlocked[msg.sender] = cycle;
  }

  emit Unlocked(msg.sender, amount);

  return true;
}

getLockStatus keyboard_arrow_up

Parameters help

Name Type
_address
address help

Properties

Visibility help public
Mutability help view
Source Code
function getLockStatus(address _address)
  public
  view
  returns (
    uint256 _lockTotal,
    uint256 _starttime,
    uint256 _unlockPeriodInSeconds,
    uint256 _unlockNumberOfCycles,
    uint256 _lockedBalanceRemains,
    uint256 _cyclesUnlocked
  )
{
  _lockTotal = lockedBalanceTotal[_address];
  _starttime = lockedStartTime[_address];
  _unlockPeriodInSeconds = unlockPeriod[_address];
  _unlockNumberOfCycles = unlockNumberOfCycles[_address];
  _lockedBalanceRemains = lockedBalanceRemains[_address];
  _cyclesUnlocked = cyclesUnlocked[_address];
}

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 NeoWorldCash.transferToAddress keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint help
_data
bytes help

Properties

Visibility help private
Mutability help transaction
Source Code
function transferToAddress(
  address _to,
  uint256 _value,
  bytes _data
) private returns (bool) {
  balances[msg.sender] = balanceOf(msg.sender).sub(_value);
  balances[_to] = balanceOf(_to).add(_value);
  emit Transfer(msg.sender, _to, _value);
  emit Transfer(msg.sender, _to, _value, _data);
  return true;
}

internal NeoWorldCash.transferToContract keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint help
_data
bytes help

Properties

Visibility help private
Mutability help transaction
Source Code
function transferToContract(
  address _to,
  uint256 _value,
  bytes _data
) private returns (bool success) {
  balances[msg.sender] = balanceOf(msg.sender).sub(_value);
  balances[_to] = balanceOf(_to).add(_value);
  ContractReceiver receiver = ContractReceiver(_to);
  receiver.tokenFallback(msg.sender, _value, _data);
  emit Transfer(msg.sender, _to, _value);
  emit Transfer(msg.sender, _to, _value, _data);
  return true;
}