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 token and operates on the Ethereum platform. CoinPoker has a current supply of 282,554,703.575 with 267,956,001.175 in circulation. The last known price of CoinPoker is $0.004294 USD and is up 14.68% over the last 24 hours. It is currently trading on 3 active market(s) with $6,185.12 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
Functions
balanceOf keyboard_arrow_up
allowance keyboard_arrow_up
totalSupply keyboard_arrow_up
transfer keyboard_arrow_up
Source Code
function transfer(address _to, uint _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;
}
transferFrom keyboard_arrow_up
Source Code
function transferFrom(address _from, address _to, uint _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;
}
approve keyboard_arrow_up
Requirements help
One or more of the following:
Source Code
function approve(address _spender, uint _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
Source Code
function percent(uint numerator, uint denominator, uint precision) public constant returns(uint quotient) {
uint _numerator = numerator.mul(10 ** (precision.add(1)));
uint _quotient = _numerator.div(denominator).add(5).div(10);
return (_quotient);
}
burn keyboard_arrow_up
Parameters help
This function has no parameters.
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)
uint total_sold = _totalSupply.sub(balances[ownerAddr]);
total_sold = total_sold.add(tokensPreICO);
uint total_ico_amount = tokensPreICO.add(tokensICO);
uint percentage = percent(total_sold, total_ico_amount, 8);
uint tournamentsAmount = tournamentsReserve.mul(percentage).div(100000000);
// Calculate what's left
uint totalReserve = teamReserve.add(tokensPreICO);
totalReserve = totalReserve.add(tournamentsAmount);
uint 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);
}
}