Blockwell

P2P Global Network

ERC20

This contract is an ERC20 token.

Name P2P Global Network
Symbol P2PX
Decimals 18
Total Supply 100,000,000 P2PX

About

Stats

Public Functions 14
Event Types 7
Code Size 13,833 bytes

Events (7) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Burn Event

Parameters help
target
address help
_value
uint256 help

Freeze Event

Parameters help

FrozenFunds Event

Parameters help
target
address help
frozen
bool help

RefundTokens Event

Parameters help
_token
address help
_refund
address help
_value
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Unfreeze Event

Parameters help

MAX_TOKEN_COUNT Constant

uint256 help
100000000 * UNKNOWN VALUE

name Constant

string help
P2P Global Network

symbol Constant

string help
P2PX

decimals Constant

uint8 help
18

owner Variable

address help
Internal Variable

frozenAccount Variable

mapping(address => bool) help
Internal Variable

tokenCount Variable

uint256 help
Internal Variable

frozen Variable

bool help
Internal Variable

accounts Variable

mapping(address => uint256) help
Internal Variable

allowances 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 view
Source Code
function totalSupply() public view returns (uint256 supply) {
  return tokenCount;
}

Parameters help

Name Type
_owner
address help

Properties

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

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _value) public returns (bool success) {
  require(!frozenAccount[msg.sender]);
  if (frozen) return false;
  else return AbstractToken.transfer(_to, _value);
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) public returns (bool success) {
  require(!frozenAccount[_from]);
  if (frozen) return false;
  else return AbstractToken.transferFrom(_from, _to, _value);
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _value)
  public
  returns (bool success)
{
  require(allowance(msg.sender, _spender) == 0 || _value == 0);
  return AbstractToken.approve(_spender, _value);
}

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address _owner, address _spender)
  public
  view
  returns (uint256 remaining)
{
  return allowances[_owner][_spender];
}

createTokens keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function createTokens(uint256 _value) public returns (bool success) {
  require(msg.sender == owner);

  if (_value > 0) {
    if (_value > safeSub(MAX_TOKEN_COUNT, tokenCount)) return false;

    accounts[msg.sender] = safeAdd(accounts[msg.sender], _value);
    tokenCount = safeAdd(tokenCount, _value);

    // adding transfer event and _from address as null address
    emit Transfer(address(0), msg.sender, _value);

    return true;
  }

  return false;
}

mintToken keyboard_arrow_up

Parameters help

Name Type
target
address help
mintedAmount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function mintToken(address target, uint256 mintedAmount)
  public
  returns (bool success)
{
  require(msg.sender == owner);
  if (mintedAmount > 0) {
    accounts[target] = safeAdd(accounts[target], mintedAmount);
    tokenCount = safeAdd(tokenCount, mintedAmount);

    // adding transfer event and _from address as null address
    emit Transfer(address(0), target, mintedAmount);

    return true;
  }
  return false;
}

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 _value) public returns (bool success) {
  require(accounts[msg.sender] >= _value);

  require(msg.sender == owner);

  accounts[msg.sender] = safeSub(accounts[msg.sender], _value);

  tokenCount = safeSub(tokenCount, _value);

  emit Burn(msg.sender, _value);

  return true;
}

setOwner keyboard_arrow_up

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function setOwner(address _newOwner) public {
  require(msg.sender == owner);

  owner = _newOwner;
}

freezeTransfers keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function freezeTransfers() public {
  require(msg.sender == owner);

  if (!frozen) {
    frozen = true;
    emit Freeze();
  }
}

unfreezeTransfers keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unfreezeTransfers() public {
  require(msg.sender == owner);

  if (frozen) {
    frozen = false;
    emit Unfreeze();
  }
}

refundTokens keyboard_arrow_up

Parameters help

Name Type
_token
address help
_refund
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function refundTokens(
  address _token,
  address _refund,
  uint256 _value
) public {
  require(msg.sender == owner);
  require(_token != address(this));
  AbstractToken token = AbstractToken(_token);
  token.transfer(_refund, _value);
  emit RefundTokens(_token, _refund, _value);
}

freezeAccount keyboard_arrow_up

Parameters help

Name Type
_target
address help
freeze
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function freezeAccount(address _target, bool freeze) public {
  require(msg.sender == owner);
  require(msg.sender != _target);
  frozenAccount[_target] = freeze;
  emit FrozenFunds(_target, freeze);
}

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.

internal SafeMath.mul keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help pure
Source Code
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
  if (a == 0) {
    return 0;
  }
  uint256 c = a * b;
  assert(c / a == b);
  return c;
}

internal SafeMath.safeDiv keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help pure
Source Code
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
  // assert(b > 0); // Solidity automatically throws when dividing by 0
  uint256 c = a / b;
  // assert(a == b * c + a % b); // There is no case in which this doesn't hold
  return c;
}

internal SafeMath.safeSub keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help pure

Requirements help

Source Code
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
  assert(b <= a);
  return a - b;
}

internal SafeMath.safeAdd keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help pure

Requirements help

Source Code
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
  uint256 c = a + b;
  assert(c >= a);
  return c;
}