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.
Constants (21) keyboard_arrow_up
State Variables (14) keyboard_arrow_up
Functions
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
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;
}
}
transferFrom keyboard_arrow_up
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;
}
}
approve keyboard_arrow_up
Source Code
function approve(address _spender, uint256 _amount) returns (bool success) {
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
allowance keyboard_arrow_up
constructor keyboard_arrow_up
withdraw keyboard_arrow_up
cards_black_total keyboard_arrow_up
cards_gold_total keyboard_arrow_up
cards_titanium_total keyboard_arrow_up
cards_blue_total keyboard_arrow_up
cards_start_total keyboard_arrow_up
tokens_buy keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
UNKNOWN VALUE must not be true
UNKNOWN VALUE must not be true
UNKNOWN VALUE must not be true
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
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.