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.

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

Functions Expand All Collapse All

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

balanceOf keyboard_arrow_up

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

transfer keyboard_arrow_up

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

transferFrom keyboard_arrow_up

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

approve keyboard_arrow_up

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

allowance keyboard_arrow_up

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 (uint) { 
      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 (uint) { 
      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 (uint) { 
      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 (uint) { 
      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 (uint) { 
      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) { 

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

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