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
State Variables (18) keyboard_arrow_up
Functions
setPbulicOfferingPrice keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setPbulicOfferingPrice(uint256 _rate1, uint256 _rate2)
public
onlyOwner
{
ethFnkRate1 = _rate1;
ethFnkRate2 = _rate2;
}
setPublicOfferingLimit keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setPublicOfferingLimit(uint256 _minVal, uint256 _maxVal)
public
onlyOwner
{
minInvEth = _minVal;
maxInvEth = _maxVal;
}
setPublicOfferingDate keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setPublicOfferingDate(
uint256 _startTime,
uint256 _deadLine1,
uint256 _deadLine2
) public onlyOwner {
sellStartTime = _startTime;
sellDeadline1 = _deadLine1;
sellDeadline2 = _deadLine2;
}
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function transferOwnership(address _newOwner) public onlyOwner {
if (_newOwner != address(0)) {
owner = _newOwner;
}
}
pause keyboard_arrow_up
start keyboard_arrow_up
pauseSell keyboard_arrow_up
Parameters help
This function has no parameters.
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.
Modifiers help
onlyOwner checks for the following:
isNotBuyable checks for the following:
One or more of the following:
-
now
must be greater than
sellDeadline2
- OR
now
must be less than
sellStartTime
- ORbuyable must not be true
isRunning checks for the following:
running must be true
Source Code
function beginSell() public onlyOwner isNotBuyable isRunning {
buyable = true;
emit BeginSell();
}
airDeliver keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
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
airDeliverStandalone keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
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
Modifiers help
onlyOwner checks for the following:
Requirements help
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
Modifiers help
onlyOwner checks for the following:
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
Modifiers help
onlyOwner checks for the following:
Requirements help
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
buyTokens keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
Requirements 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
balanceOf keyboard_arrow_up
freezeOf keyboard_arrow_up
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;
}
transfer keyboard_arrow_up
Modifiers help
isRunning checks for the following:
running must be true
onlyPayloadSize checks for the following:
Requirements 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;
}
transferFrom keyboard_arrow_up
Modifiers help
isRunning checks for the following:
running must be true
onlyPayloadSize checks for the following:
Requirements 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;
}
approve keyboard_arrow_up
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;
}
allowance keyboard_arrow_up
withdraw keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyOwner checks for the following:
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
Modifiers help
onlyOwner checks for the following:
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
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
Requirements help
Source Code
function safeMul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}