Blockwell

FNKOSToken

ERC20

This contract is an ERC20 token.

Name FNKOSToken
Symbol FNKOS
Decimals 18
Total Supply 1,000,000,000 FNKOS

About

Stats

Public Functions 25
Event Types 8
Code Size 12,174 bytes

Events (8) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

BeginRunning Event

Parameters help

BeginSell Event

Parameters help

Burn Event

Parameters help
burner
address help
val
uint256 help

Freeze Event

Parameters help
from
address help
value
uint256 help

PauseRunning Event

Parameters help

PauseSell Event

Parameters help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

BalanceInfo Struct

Members
balance
uint256 help
freezeAmount
uint256[] help
releaseTime
uint256[] help

name Constant

string help
FNKOSToken

symbol Constant

string help
FNKOS

decimals Constant

uint help
18

totalSupply Variable

uint256 help

minInvEth Variable

uint256 help

maxInvEth Variable

uint256 help

sellStartTime Variable

uint256 help

sellDeadline1 Variable

uint256 help

sellDeadline2 Variable

uint256 help

freezeDuration Variable

uint256 help

ethFnkRate1 Variable

uint256 help

ethFnkRate2 Variable

uint256 help

running Variable

bool help

buyable Variable

bool help

whitelist Variable

mapping(address => bool) help

fnkEthRate Variable

uint256 help
Internal Variable

fnkSupply Variable

uint256 help
Internal Variable

owner Variable

address help
Internal Variable

allowed Variable

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

whitelistLimit Variable

mapping(address => uint256) help
Internal Variable

balances Variable

mapping(address => BalanceInfo) help
Internal Variable

Functions Expand All Collapse All

setPbulicOfferingPrice keyboard_arrow_up

Parameters help

Name Type
_rate1
uint256 help
_rate2
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setPbulicOfferingPrice(uint256 _rate1, uint256 _rate2)
  public
  onlyOwner
{
  ethFnkRate1 = _rate1;
  ethFnkRate2 = _rate2;
}

setPublicOfferingLimit keyboard_arrow_up

Parameters help

Name Type
_minVal
uint256 help
_maxVal
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setPublicOfferingLimit(uint256 _minVal, uint256 _maxVal)
  public
  onlyOwner
{
  minInvEth = _minVal;
  maxInvEth = _maxVal;
}

setPublicOfferingDate keyboard_arrow_up

Parameters help

Name Type
_startTime
uint256 help
_deadLine1
uint256 help
_deadLine2
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setPublicOfferingDate(
  uint256 _startTime,
  uint256 _deadLine1,
  uint256 _deadLine2
) public onlyOwner {
  sellStartTime = _startTime;
  sellDeadline1 = _deadLine1;
  sellDeadline2 = _deadLine2;
}

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 {
  if (_newOwner != address(0)) {
    owner = _newOwner;
  }
}

pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function pause() public onlyOwner isRunning {
  running = false;
  emit PauseRunning();
}

start keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function start() public onlyOwner isNotRunning {
  running = true;
  emit BeginRunning();
}

pauseSell keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function pauseSell() public onlyOwner isBuyable isRunning {
  buyable = false;
  emit PauseSell();
}

beginSell keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function beginSell() public onlyOwner isNotBuyable isRunning {
  buyable = true;
  emit BeginSell();
}

airDeliver keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function airDeliver(address _to, uint256 _amount) public onlyOwner {
  require(owner != _to);
  require(_amount > 0);
  require(balances[owner].balance >= _amount);

  // take big number as wei
  if (_amount < fnkSupply) {
    _amount = _amount * fnkEthRate;
  }
  balances[owner].balance = safeSub(balances[owner].balance, _amount);
  balances[_to].balance = safeAdd(balances[_to].balance, _amount);
  emit Transfer(owner, _to, _amount);
}

airDeliverMulti keyboard_arrow_up

Parameters help

Name Type
_addrs
address[] help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function airDeliverMulti(address[] _addrs, uint256 _amount) public onlyOwner {
  require(_addrs.length <= 255);

  for (uint8 i = 0; i < _addrs.length; i++) {
    airDeliver(_addrs[i], _amount);
  }
}

airDeliverStandalone keyboard_arrow_up

Parameters help

Name Type
_addrs
address[] help
_amounts
uint256[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function airDeliverStandalone(address[] _addrs, uint256[] _amounts)
  public
  onlyOwner
{
  require(_addrs.length <= 255);
  require(_addrs.length == _amounts.length);

  for (uint8 i = 0; i < _addrs.length; i++) {
    airDeliver(_addrs[i], _amounts[i]);
  }
}

freezeDeliver keyboard_arrow_up

Parameters help

Name Type
_to
address help
_amount
uint help
_freezeAmount
uint help
_freezeMonth
uint help
_unfreezeBeginTime
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function freezeDeliver(
  address _to,
  uint256 _amount,
  uint256 _freezeAmount,
  uint256 _freezeMonth,
  uint256 _unfreezeBeginTime
) public onlyOwner {
  require(owner != _to);
  require(_freezeMonth > 0);

  uint256 average = _freezeAmount / _freezeMonth;
  BalanceInfo storage bi = balances[_to];
  uint256[] memory fa = new uint256[](_freezeMonth);
  uint256[] memory rt = new uint256[](_freezeMonth);

  if (_amount < fnkSupply) {
    _amount = _amount * fnkEthRate;
    average = average * fnkEthRate;
    _freezeAmount = _freezeAmount * fnkEthRate;
  }
  require(balances[owner].balance > _amount);
  uint256 remainAmount = _freezeAmount;

  if (_unfreezeBeginTime == 0) _unfreezeBeginTime = now + freezeDuration;
  for (uint256 i = 0; i < _freezeMonth - 1; i++) {
    fa[i] = average;
    rt[i] = _unfreezeBeginTime;
    _unfreezeBeginTime += freezeDuration;
    remainAmount = safeSub(remainAmount, average);
  }
  fa[i] = remainAmount;
  rt[i] = _unfreezeBeginTime;

  bi.balance = safeAdd(bi.balance, _amount);
  bi.freezeAmount = fa;
  bi.releaseTime = rt;
  balances[owner].balance = safeSub(balances[owner].balance, _amount);
  emit Transfer(owner, _to, _amount);
  emit Freeze(_to, _freezeAmount);
}

freezeDeliverMuti keyboard_arrow_up

Parameters help

Name Type
_addrs
address[] help
_deliverAmount
uint help
_freezeAmount
uint help
_freezeMonth
uint help
_unfreezeBeginTime
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function freezeDeliverMuti(
  address[] _addrs,
  uint256 _deliverAmount,
  uint256 _freezeAmount,
  uint256 _freezeMonth,
  uint256 _unfreezeBeginTime
) public onlyOwner {
  require(_addrs.length <= 255);

  for (uint256 i = 0; i < _addrs.length; i++) {
    freezeDeliver(
      _addrs[i],
      _deliverAmount,
      _freezeAmount,
      _freezeMonth,
      _unfreezeBeginTime
    );
  }
}

freezeDeliverMultiStandalone keyboard_arrow_up

Parameters help

Name Type
_addrs
address[] help
_deliverAmounts
uint[] help
_freezeAmounts
uint[] help
_freezeMonth
uint help
_unfreezeBeginTime
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function freezeDeliverMultiStandalone(
  address[] _addrs,
  uint256[] _deliverAmounts,
  uint256[] _freezeAmounts,
  uint256 _freezeMonth,
  uint256 _unfreezeBeginTime
) public onlyOwner {
  require(_addrs.length <= 255);
  require(_addrs.length == _deliverAmounts.length);
  require(_addrs.length == _freezeAmounts.length);

  for (uint256 i = 0; i < _addrs.length; i++) {
    freezeDeliver(
      _addrs[i],
      _deliverAmounts[i],
      _freezeAmounts[i],
      _freezeMonth,
      _unfreezeBeginTime
    );
  }
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

buyTokens keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Modifiers help

Source Code
function buyTokens() public payable isRunning isBuyable onlyWhitelist {
  uint256 weiVal = msg.value;
  address investor = msg.sender;
  require(investor != address(0) && weiVal >= minInvEth && weiVal <= maxInvEth);
  require(safeAdd(weiVal, whitelistLimit[investor]) <= maxInvEth);

  uint256 amount = 0;
  if (now > sellDeadline1) amount = safeMul(msg.value, ethFnkRate2);
  else amount = safeMul(msg.value, ethFnkRate1);

  whitelistLimit[investor] = safeAdd(weiVal, whitelistLimit[investor]);

  balances[owner].balance = safeSub(balances[owner].balance, amount);
  balances[investor].balance = safeAdd(balances[investor].balance, amount);
  emit Transfer(owner, investor, amount);
}

addWhitelist keyboard_arrow_up

Parameters help

Name Type
_addrs
address[] help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function addWhitelist(address[] _addrs) public onlyOwner {
  require(_addrs.length <= 255);

  for (uint8 i = 0; i < _addrs.length; i++) {
    if (!whitelist[_addrs[i]]) {
      whitelist[_addrs[i]] = true;
    }
  }
}

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].balance;
}

freezeOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
function freezeOf(address _owner) public constant returns (uint256) {
  BalanceInfo storage bi = balances[_owner];
  uint256 freezeAmount = 0;
  uint256 t = now;

  for (uint256 i = 0; i < bi.freezeAmount.length; i++) {
    if (t < bi.releaseTime[i]) freezeAmount += bi.freezeAmount[i];
  }
  return freezeAmount;
}

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transfer(address _to, uint256 _amount)
  public
  isRunning
  onlyPayloadSize(2 * 32)
  returns (bool success)
{
  require(_to != address(0));
  uint256 freezeAmount = freezeOf(msg.sender);
  uint256 _balance = safeSub(balances[msg.sender].balance, freezeAmount);
  require(_amount <= _balance);

  balances[msg.sender].balance = safeSub(balances[msg.sender].balance, _amount);
  balances[_to].balance = safeAdd(balances[_to].balance, _amount);
  emit Transfer(msg.sender, _to, _amount);
  return true;
}

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 isRunning onlyPayloadSize(3 * 32) returns (bool success) {
  require(_from != address(0) && _to != address(0));
  require(_amount <= allowed[_from][msg.sender]);
  uint256 freezeAmount = freezeOf(_from);
  uint256 _balance = safeSub(balances[_from].balance, freezeAmount);
  require(_amount <= _balance);

  balances[_from].balance = safeSub(balances[_from].balance, _amount);
  allowed[_from][msg.sender] = safeSub(allowed[_from][msg.sender], _amount);
  balances[_to].balance = safeAdd(balances[_to].balance, _amount);
  emit Transfer(_from, _to, _amount);
  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function approve(address _spender, uint256 _value)
  public
  isRunning
  returns (bool success)
{
  if (_value != 0 && allowed[msg.sender][_spender] != 0) {
    return false;
  }
  allowed[msg.sender][_spender] = _value;
  emit Approval(msg.sender, _spender, _value);
  return true;
}

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

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

withdraw keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function withdraw() public onlyOwner {
  address myAddress = this;
  require(myAddress.balance > 0);
  owner.transfer(myAddress.balance);
  emit Transfer(this, owner, myAddress.balance);
}

burn keyboard_arrow_up

Parameters help

Name Type
burner
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function burn(address burner, uint256 _value) public onlyOwner {
  require(_value <= balances[msg.sender].balance);

  balances[burner].balance = safeSub(balances[burner].balance, _value);
  totalSupply = safeSub(totalSupply, _value);
  fnkSupply = totalSupply / fnkEthRate;
  emit Burn(burner, _value);
}

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 FNKOSToken.safeMul keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help pure
Source Code
function safeMul(uint256 a, uint256 b) internal pure returns (uint256) {
  uint256 c = a * b;
  assert(a == 0 || c / a == b);
  return c;
}

internal FNKOSToken.safeSub keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help pure

Requirements help

Source Code
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
  assert(b <= a);
  return a - b;
}

internal FNKOSToken.safeAdd keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help pure

Requirements help

Source Code
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
  uint256 c = a + b;
  assert(c >= a);
  return c;
}