Blockwell

Centra token

ERC20

This contract is an ERC20 token.

Name Centra token
Symbol Centra
Decimals 18
Total Supply 100,000,000 Centra

About

Stats

Public Functions 14
Event Types 2
Code Size 12,081 bytes

Library Use

Uses SafeMath for uint.

Events (2) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

symbol Constant

string help
Centra

name Constant

string help
Centra token

decimals Constant

uint8 help
18

maxTokens Constant

uint256 help
100000000 * UNKNOWN VALUE

ownerSupply Constant

uint256 help

token_price Constant

uint256 help
1 / 400 * UNKNOWN VALUE

ico_start Constant

uint help
1501891200

ico_finish Constant

uint help
1507248000

minValuePre Constant

uint help
1 / 10 * UNKNOWN VALUE

minValue Constant

uint help
1 / 10 * UNKNOWN VALUE

maxValue Constant

uint help
3000 * UNKNOWN VALUE

card_gold_minamount Constant

uint help
30 * UNKNOWN VALUE

card_gold_first Constant

uint help
1000

card_black_minamount Constant

uint help
100 * UNKNOWN VALUE

card_black_first Constant

uint help
500

card_titanium_minamount Constant

uint help
500 * UNKNOWN VALUE

card_titanium_first Constant

uint help
200

card_blue_minamount Constant

uint help
5 / 10 * UNKNOWN VALUE

card_blue_first Constant

uint help
100000000

card_start_minamount Constant

uint help
1 / 10 * UNKNOWN VALUE

card_start_first Constant

uint help
100000000

owner Variable

address help

cards_black_check Variable

mapping(address => uint) help

_totalSupply Variable

uint256 help
Internal Variable

cards_gold_check Variable

mapping(address => uint) help
Internal Variable

cards_gold Variable

address[] help
Internal Variable

cards_black Variable

address[] help
Internal Variable

cards_titanium_check Variable

mapping(address => uint) help
Internal Variable

cards_titanium Variable

address[] help
Internal Variable

cards_blue_check Variable

mapping(address => uint) help
Internal Variable

cards_blue Variable

address[] help
Internal Variable

cards_start_check Variable

mapping(address => uint) help
Internal Variable

cards_start Variable

address[] help
Internal Variable

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

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

Functions Expand All Collapse All

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
_owner
address help

Properties

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

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _amount) returns (bool success) {
  if (now < ico_start) throw;

  if (
    balances[msg.sender] >= _amount &&
    _amount > 0 &&
    balances[_to] + _amount > balances[_to]
  ) {
    balances[msg.sender] -= _amount;
    balances[_to] += _amount;
    Transfer(msg.sender, _to, _amount);
    return true;
  } else {
    return false;
  }
}

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _amount
) returns (bool success) {
  if (now < ico_start) throw;

  if (
    balances[_from] >= _amount &&
    allowed[_from][msg.sender] >= _amount &&
    _amount > 0 &&
    balances[_to] + _amount > balances[_to]
  ) {
    balances[_from] -= _amount;
    allowed[_from][msg.sender] -= _amount;
    balances[_to] += _amount;
    Transfer(_from, _to, _amount);
    return true;
  } else {
    return false;
  }
}

Parameters help

Name Type
_spender
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _amount) returns (bool success) {
  allowed[msg.sender][_spender] = _amount;
  Approval(msg.sender, _spender, _amount);
  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)
  constant
  returns (uint256 remaining)
{
  return allowed[_owner][_spender];
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

withdraw keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function withdraw() onlyOwner returns (bool result) {
  owner.send(this.balance);
  return true;
}

cards_black_total keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function cards_black_total() constant returns (uint256) {
  return cards_black.length;
}

cards_gold_total keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function cards_gold_total() constant returns (uint256) {
  return cards_gold.length;
}

cards_titanium_total keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function cards_titanium_total() constant returns (uint256) {
  return cards_titanium.length;
}

cards_blue_total keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function cards_blue_total() constant returns (uint256) {
  return cards_blue.length;
}

cards_start_total keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function cards_start_total() constant returns (uint256) {
  return cards_start.length;
}

tokens_buy keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function tokens_buy() payable returns (bool) {
  uint256 tnow = now;

  if (tnow > ico_finish) throw;
  if (_totalSupply >= maxTokens) throw;
  if (!(msg.value >= token_price)) throw;
  if (!(msg.value >= minValue)) throw;
  if (msg.value > maxValue) throw;

  uint256 tokens_buy = (msg.value / token_price) * 10**18;

  if (!(tokens_buy > 0)) throw;

  if (tnow < ico_start) {
    if (!(msg.value >= minValuePre)) throw;
    tokens_buy = (tokens_buy * 125) / 100;
  }
  if ((ico_start + 86400 * 0 <= tnow) && (tnow < ico_start + 86400 * 2)) {
    tokens_buy = (tokens_buy * 120) / 100;
  }
  if ((ico_start + 86400 * 2 <= tnow) && (tnow < ico_start + 86400 * 7)) {
    tokens_buy = (tokens_buy * 110) / 100;
  }
  if ((ico_start + 86400 * 7 <= tnow) && (tnow < ico_start + 86400 * 14)) {
    tokens_buy = (tokens_buy * 105) / 100;
  }

  if (_totalSupply.add(tokens_buy) > maxTokens) throw;
  _totalSupply = _totalSupply.add(tokens_buy);
  balances[msg.sender] = balances[msg.sender].add(tokens_buy);

  if (
    (msg.value >= card_gold_minamount) &&
    (msg.value < card_black_minamount) &&
    (cards_gold.length < card_gold_first) &&
    (cards_gold_check[msg.sender] != 1)
  ) {
    cards_gold.push(msg.sender);
    cards_gold_check[msg.sender] = 1;
  }

  if (
    (msg.value >= card_black_minamount) &&
    (msg.value < card_titanium_minamount) &&
    (cards_black.length < card_black_first) &&
    (cards_black_check[msg.sender] != 1)
  ) {
    cards_black.push(msg.sender);
    cards_black_check[msg.sender] = 1;
  }

  if (
    (msg.value >= card_titanium_minamount) &&
    (cards_titanium.length < card_titanium_first) &&
    (cards_titanium_check[msg.sender] != 1)
  ) {
    cards_titanium.push(msg.sender);
    cards_titanium_check[msg.sender] = 1;
  }

  if (
    (msg.value >= card_blue_minamount) &&
    (msg.value < card_gold_minamount) &&
    (cards_blue.length < card_blue_first) &&
    (cards_blue_check[msg.sender] != 1)
  ) {
    cards_blue.push(msg.sender);
    cards_blue_check[msg.sender] = 1;
  }

  if (
    (msg.value >= card_start_minamount) &&
    (msg.value < card_blue_minamount) &&
    (cards_start.length < card_start_first) &&
    (cards_start_check[msg.sender] != 1)
  ) {
    cards_start.push(msg.sender);
    cards_start_check[msg.sender] = 1;
  }

  return true;
}

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.