Blockwell

Fantom Token

ERC20

This contract is an ERC20 token.

Name Fantom Token
Symbol FTM
Decimals 18
Total Supply 2,132,239,133 FTM

About

Stats

Public Functions 36
Event Types 13
Code Size 20,626 bytes

Events (13) keyboard_arrow_up

AdminChange Event

Parameters help
_admin
address help
_status
bool help

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint help

IcoDateUpdated Event

Parameters help
id
uint help
unixts
uint help

OwnershipTransferProposed Event

Parameters help
_from
address help
_to
address help

OwnershipTransferred Event

Parameters help
_from
address help
_to
address help

RegisterContribution Event

Parameters help
account
address help
tokensIssued
uint help
ethContributed
uint help
ethReturned
uint help

RegisteredLockedTokens Event

Parameters help
account
address help
idx
uint help
tokens
uint help
term
uint help

TokenExchangeRequested Event

Parameters help
account
address help
tokens
uint help

TokensMinted Event

Parameters help
mintType
uint help
account
address help
tokens
uint help
term
uint help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint help

UpdatedTokensPerEth Event

Parameters help
tokensPerEth
uint help

WalletUpdated Event

Parameters help
newWallet
address help

Whitelisted Event

Parameters help
account
address help
countWhitelisted
uint help

E18 Constant

uint help
UNKNOWN VALUE

name Constant

string help
Fantom Token

symbol Constant

string help
FTM

decimals Constant

uint8 help
18

MAX_TOTAL_TOKEN_SUPPLY Constant

uint help

MINIMUM_CONTRIBUTION Constant

uint help
0.2 ether

MAXIMUM_FIRST_DAY_CONTRIBUTION Constant

uint help
1.692294656 ether

TOKEN_MAIN_CAP Constant

uint help

LOCK_SLOTS Constant

uint help
5

DATE_LIMIT Constant

uint help
1529658000 + 180 days

tokensPerEth Variable

uint help

tokensTradeable Variable

bool help

numberWhitelisted Variable

uint help

tokensMain Variable

uint help

totalEthContributed Variable

uint help

tokensMinted Variable

uint help

isMigrationPhaseOpen Variable

bool help

tokensIssuedTotal Variable

uint help

owner Variable

address help

newOwner Variable

address help

wallet Variable

address help

dateMainStart Variable

uint help

dateMainEnd Variable

uint help

whitelist Variable

mapping(address => bool) help

balancesMain Variable

mapping(address => uint) help

ethContributed Variable

mapping(address => uint) help

balancesMinted Variable

mapping(address => uint) help

isAdmin Variable

mapping(address => bool) help

mayHaveLockedTokens Variable

mapping(address => bool) help

balancesMintedByType Variable

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

balances Variable

mapping(address => uint) help
Internal Variable

allowed Variable

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

lockTerm Variable

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

lockAmnt Variable

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

Functions Expand All Collapse All

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferOwnership(address _newOwner) public onlyOwner {
  require(_newOwner != address(0x0));
  emit OwnershipTransferProposed(owner, _newOwner);
  newOwner = _newOwner;
}

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;
}

Parameters help

Name Type
_a
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function addAdmin(address _a) public onlyOwner {
  require(isAdmin[_a] == false);
  isAdmin[_a] = true;
  emit AdminChange(_a, true);
}

Parameters help

Name Type
_a
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function removeAdmin(address _a) public onlyOwner {
  require(isAdmin[_a] == true);
  isAdmin[_a] = false;
  emit AdminChange(_a, false);
}

Parameters help

Name Type
_unixts
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function setDateMainStart(uint256 _unixts) public onlyOwner checkDateOrder {
  require(now < _unixts && now < dateMainStart);
  dateMainStart = _unixts;
  emit IcoDateUpdated(1, _unixts);
}

Parameters help

Name Type
_unixts
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function setDateMainEnd(uint256 _unixts) public onlyOwner checkDateOrder {
  require(now < _unixts && now < dateMainEnd);
  dateMainEnd = _unixts;
  emit IcoDateUpdated(2, _unixts);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function isMainFirstDay() public view returns (bool) {
  if (now > dateMainStart && now <= dateMainStart + 1 days) return true;
  return false;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function isMain() public view returns (bool) {
  if (now > dateMainStart && now < dateMainEnd) return true;
  return false;
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
_owner
address help

Properties

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

Parameters help

Name Type
_to
address help
_amount
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _amount) public returns (bool success) {
  require(tokensTradeable);
  require(_amount <= unlockedTokensInternal(msg.sender));
  return super.transfer(_to, _amount);
}

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _amount
) public returns (bool success) {
  require(tokensTradeable);
  require(_amount <= unlockedTokensInternal(_from));
  return super.transferFrom(_from, _to, _amount);
}

Parameters help

Name Type
_spender
address help
_amount
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _amount) public returns (bool) {
  allowed[msg.sender][_spender] = _amount;
  emit Approval(msg.sender, _spender, _amount);
  return true;
}

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

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

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help view
Source Code
function lockedTokens(address _account) public view returns (uint256) {
  if (!mayHaveLockedTokens[_account]) return 0;
  return pNumberOfLockedTokens(_account);
}

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help view
Source Code
function unlockedTokens(address _account) public view returns (uint256) {
  return balances[_account].sub(lockedTokens(_account));
}

Parameters help

Name Type
_account
address help
_term
uint help

Properties

Visibility help public
Mutability help view
Source Code
function isAvailableLockSlot(address _account, uint256 _term)
  public
  view
  returns (bool)
{
  if (!mayHaveLockedTokens[_account]) return true;
  if (_term < now) return true;
  uint256[LOCK_SLOTS] storage term = lockTerm[_account];
  for (uint256 i; i < LOCK_SLOTS; i++) {
    if (term[i] < now || term[i] == _term) return true;
  }
  return false;
}

Parameters help

Name Type
_wallet
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setWallet(address _wallet) public onlyOwner {
  require(_wallet != address(0x0));
  wallet = _wallet;
  emit WalletUpdated(_wallet);
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function availableToMint() public view returns (uint256) {
  return MAX_TOTAL_TOKEN_SUPPLY.sub(TOKEN_MAIN_CAP).sub(tokensMinted);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function firstDayTokenLimit() public view returns (uint256) {
  return ethToTokens(MAXIMUM_FIRST_DAY_CONTRIBUTION);
}

Parameters help

Name Type
_eth
uint help

Properties

Visibility help public
Mutability help view
Source Code
function ethToTokens(uint256 _eth) public view returns (uint256 tokens) {
  tokens = _eth.mul(tokensPerEth);
}

Parameters help

Name Type
_tokens
uint help

Properties

Visibility help public
Mutability help view
Source Code
function tokensToEth(uint256 _tokens) public view returns (uint256 eth) {
  eth = _tokens / tokensPerEth;
}

Parameters help

Name Type
_account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
Source Code
function addToWhitelist(address _account) public onlyAdmin {
  pWhitelist(_account);
}

Parameters help

Name Type
_addresses
address[] help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyAdmin checks for the following:
Source Code
function addToWhitelistMultiple(address[] _addresses) public onlyAdmin {
  for (uint256 i; i < _addresses.length; i++) {
    pWhitelist(_addresses[i]);
  }
}

Parameters help

Name Type
_tokens_per_eth
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function updateTokensPerEth(uint256 _tokens_per_eth) public onlyOwner {
  require(now < dateMainStart);
  tokensPerEth = _tokens_per_eth;
  emit UpdatedTokensPerEth(tokensPerEth);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function makeTradeable() public {
  require(msg.sender == owner || now > dateMainEnd + 20 weeks);
  tokensTradeable = true;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function openMigrationPhase() public onlyOwner {
  require(now > dateMainEnd);
  isMigrationPhaseOpen = true;
}

Parameters help

Name Type
_mint_type
uint help
_account
address help
_tokens
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function mintTokens(
  uint256 _mint_type,
  address _account,
  uint256 _tokens
) public onlyOwner {
  pMintTokens(_mint_type, _account, _tokens, 0);
}

Parameters help

Name Type
_mint_type
uint help
_accounts
address[] help
_tokens
uint[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function mintTokensMultiple(
  uint256 _mint_type,
  address[] _accounts,
  uint256[] _tokens
) public onlyOwner {
  require(_accounts.length == _tokens.length);
  for (uint256 i; i < _accounts.length; i++) {
    pMintTokens(_mint_type, _accounts[i], _tokens[i], 0);
  }
}

Parameters help

Name Type
_mint_type
uint help
_account
address help
_tokens
uint help
_term
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function mintTokensLocked(
  uint256 _mint_type,
  address _account,
  uint256 _tokens,
  uint256 _term
) public onlyOwner {
  pMintTokens(_mint_type, _account, _tokens, _term);
}

Parameters help

Name Type
_mint_type
uint help
_accounts
address[] help
_tokens
uint[] help
_terms
uint[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function mintTokensLockedMultiple(
  uint256 _mint_type,
  address[] _accounts,
  uint256[] _tokens,
  uint256[] _terms
) public onlyOwner {
  require(_accounts.length == _tokens.length);
  require(_accounts.length == _terms.length);
  for (uint256 i; i < _accounts.length; i++) {
    pMintTokens(_mint_type, _accounts[i], _tokens[i], _terms[i]);
  }
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function requestTokenExchangeMax() public {
  requestTokenExchange(unlockedTokensInternal(msg.sender));
}

Parameters help

Name Type
_tokens
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function requestTokenExchange(uint256 _tokens) public {
  require(isMigrationPhaseOpen);
  require(_tokens > 0 && _tokens <= unlockedTokensInternal(msg.sender));
  balances[msg.sender] = balances[msg.sender].sub(_tokens);
  tokensIssuedTotal = tokensIssuedTotal.sub(_tokens);
  emit Transfer(msg.sender, 0x0, _tokens);
  emit TokenExchangeRequested(msg.sender, _tokens);
}

Parameters help

Name Type
_token_address
address help
_amount
uint help

Properties

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

Parameters help

Name Type
_addresses
address[] help
_amounts
uint[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferMultiple(address[] _addresses, uint256[] _amounts) external {
  require(_addresses.length <= 100);
  require(_addresses.length == _amounts.length);

  // do the transfers
  for (uint256 j; j < _addresses.length; j++) {
    transfer(_addresses[j], _amounts[j]);
  }
}

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 FantomToken.pWhitelist keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function pWhitelist(address _account) internal {
  if (whitelist[_account]) return;
  whitelist[_account] = true;
  numberWhitelisted = numberWhitelisted.add(1);
  emit Whitelisted(_account, numberWhitelisted);
}

internal LockSlots.registerLockedTokens keyboard_arrow_up

Parameters help

Name Type
_account
address help
_tokens
uint help
_term
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function registerLockedTokens(
  address _account,
  uint256 _tokens,
  uint256 _term
) internal returns (uint256 idx) {
  require(_term > now, "lock term must be in the future");

  // find a slot (clean up while doing this)
  // use either the existing slot with the exact same term,
  // of which there can be at most one, or the first empty slot
  idx = 9999;
  uint256[LOCK_SLOTS] storage term = lockTerm[_account];
  uint256[LOCK_SLOTS] storage amnt = lockAmnt[_account];
  for (uint256 i; i < LOCK_SLOTS; i++) {
    if (term[i] < now) {
      term[i] = 0;
      amnt[i] = 0;
      if (idx == 9999) idx = i;
    }
    if (term[i] == _term) idx = i;
  }

  // fail if no slot was found
  require(idx != 9999, "registerLockedTokens: no available slot found");

  // register locked tokens
  if (term[idx] == 0) term[idx] = _term;
  amnt[idx] = amnt[idx].add(_tokens);
  mayHaveLockedTokens[_account] = true;
  emit RegisteredLockedTokens(_account, idx, _tokens, _term);
}

internal LockSlots.unlockedTokensInternal keyboard_arrow_up

Parameters help

Name Type
_account
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function unlockedTokensInternal(address _account) internal returns (uint256) {
  // updates mayHaveLockedTokens if necessary
  if (!mayHaveLockedTokens[_account]) return balances[_account];
  uint256 locked = pNumberOfLockedTokens(_account);
  if (locked == 0) mayHaveLockedTokens[_account] = false;
  return balances[_account].sub(locked);
}