Blockwell

Poker Chips

ERC20

This contract is an ERC20 token.

Name Poker Chips
Symbol CHP
Decimals 18
Total Supply 354,786,435 CHP

About link description

CoinPoker (CHP) is a cryptocurrency and operates on the Ethereum platform. CoinPoker has a current supply of 278,237,314.35457474 with 274,720,611.9545747 in circulation. The last known price of CoinPoker is 0.01950101 USD and is up 7.64 over the last 24 hours. It is currently trading on 2 active market(s) with $7,198.19 traded over the last 24 hours. More information can be found at https://coinpoker.com/.

Stats

Public Functions 8
Event Types 3
Code Size 7,288 bytes

Library Use

Uses SafeMath for uint.

Events (3) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
spender
address help
value
uint help

Burned Event

Parameters help
amount
uint help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

standard Constant

string help
ERC20

name Constant

string help
Poker Chips

symbol Constant

string help
CHP

decimals Constant

uint8 help
18

tokensPreICO Constant

uint help
100000000e18

tokensICO Constant

uint help
275000000e18

teamReserve Constant

uint help
50000000e18

tournamentsReserve Constant

uint help
75000000e18

startTime Variable

uint help

ownerAddr Variable

address help

preIcoAddr Variable

address help

tournamentsAddr Variable

address help

cashierAddr Variable

address help

_totalSupply Variable

uint help
Internal Variable

burned Variable

bool help
Internal Variable

balances Variable

mapping(address => uint) help
Internal Variable

allowed Variable

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

Functions Expand All Collapse All

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

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _value) returns (bool) {
  if (now < startTime)
    // Check if the crowdsale is already over
    require(_to == cashierAddr); // allow only to transfer CHP (make a deposit) to game/cashier wallet
  balances[msg.sender] = balances[msg.sender].sub(_value); // Subtract from the sender
  balances[_to] = balances[_to].add(_value); // Add the same to the recipient
  Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
  return true;
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) returns (bool) {
  if (now < startTime)
    // Check if the crowdsale is already over
    require(_from == ownerAddr || _to == cashierAddr);
  var _allowed = allowed[_from][msg.sender];
  balances[_from] = balances[_from].sub(_value); // Subtract from the sender
  balances[_to] = balances[_to].add(_value); // Add the same to the recipient
  allowed[_from][msg.sender] = _allowed.sub(_value);
  Transfer(_from, _to, _value);
  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

One or more of the following:
Source Code
function approve(address _spender, uint256 _value) returns (bool) {
  //https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
  require((_value == 0) || (allowed[msg.sender][_spender] == 0));
  allowed[msg.sender][_spender] = _value;
  Approval(msg.sender, _spender, _value);
  return true;
}

percent keyboard_arrow_up

Parameters help

Name Type
numerator
uint help
denominator
uint help
precision
uint help

Properties

Visibility help public
Mutability help constant
Source Code
function percent(
  uint256 numerator,
  uint256 denominator,
  uint256 precision
) public constant returns (uint256 quotient) {
  uint256 _numerator = numerator.mul(10**(precision.add(1)));
  uint256 _quotient = _numerator.div(denominator).add(5).div(10);
  return (_quotient);
}

burn keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function burn() {
  // If tokens have not been burned already and the crowdsale ended
  if (!burned && now > startTime) {
    // Calculate tournament release amount (tournament_reserve * proportion_how_many_sold)
    uint256 total_sold = _totalSupply.sub(balances[ownerAddr]);
    total_sold = total_sold.add(tokensPreICO);
    uint256 total_ico_amount = tokensPreICO.add(tokensICO);
    uint256 percentage = percent(total_sold, total_ico_amount, 8);
    uint256 tournamentsAmount = tournamentsReserve.mul(percentage).div(
      100000000
    );

    // Calculate what's left
    uint256 totalReserve = teamReserve.add(tokensPreICO);
    totalReserve = totalReserve.add(tournamentsAmount);
    uint256 difference = balances[ownerAddr].sub(totalReserve);

    // Distribute tokens
    balances[preIcoAddr] = balances[preIcoAddr].add(tokensPreICO);
    balances[tournamentsAddr] = balances[tournamentsAddr].add(
      tournamentsAmount
    );
    balances[ownerAddr] = teamReserve;

    // Burn what's left
    _totalSupply = _totalSupply.sub(difference);
    burned = true;
    Burned(difference);
  }
}

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.