Blockwell

Buggyra Coin Zero

ERC20

This contract is an ERC20 token.

Name Buggyra Coin Zero
Symbol BCZERO
Decimals 18
Total Supply 10,000,000,000 BCZERO

About

Stats

Public Functions 14
Event Types 6
Code Size 10,722 bytes

Library Use

Uses SafeMath for uint.

Events (6) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

TokenExchangeEnabled Event

Parameters help
caller
address help
exchangeCost
uint help

TokenExportEnabled Event

Parameters help
caller
address help
enableCost
uint help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

TransferSold Event

Parameters help
to
address help
value
uint help

name Variable

string help

symbol Variable

string help

decimals Variable

uint help

version Variable

string help

totalSupply Variable

uint help

tokenPrice Variable

uint help

exchangeEnabled Variable

bool help

parentContract Variable

address help

codeExportEnabled Variable

bool help

commissionAddress Variable

address help

deploymentCost Variable

uint help

tokenOnlyDeploymentCost Variable

uint help

exchangeEnableCost Variable

uint help

codeExportCost Variable

uint help

totalSupply Variable

uint help

owner Variable

address help

newOwner Variable

address help

balances Variable

mapping(address => uint) help

allowed Variable

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

Functions Expand All Collapse All

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferOwnership(address _newOwner) public onlyOwner {
  require(address(0) != _newOwner);
  newOwner = _newOwner;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function acceptOwnership() public {
  require(msg.sender == newOwner);
  emit OwnershipTransferred(owner, msg.sender);
  owner = msg.sender;
  newOwner = address(0);
}

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 balances[_owner];
}

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 allowed[_owner][_spender];
}

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) public returns (bool) {
  require(_to != address(0));
  require(balances[msg.sender] >= _value);
  balances[msg.sender] = balances[msg.sender].sub(_value);
  balances[_to] = balances[_to].add(_value);
  emit Transfer(msg.sender, _to, _value);
  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
) public returns (bool ok);

Parameters help

Name Type
_spender
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _value) public returns (bool) {
  allowed[msg.sender][_spender] = _value;
  emit Approval(msg.sender, _spender, _value);
  return true;
}

Parameters help

Name Type
_tokenPrice
uint help

Properties

Visibility help public
Mutability help payable
Source Code
function enableExchange(uint256 _tokenPrice) public payable {
  require(!exchangeEnabled);
  require(exchangeEnableCost == msg.value);
  exchangeEnabled = true;
  tokenPrice = _tokenPrice;
  commissionAddress.transfer(msg.value);
  emit TokenExchangeEnabled(msg.sender, _tokenPrice);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function enableCodeExport() public payable {
  require(!codeExportEnabled);
  require(codeExportCost == msg.value);
  codeExportEnabled = true;
  commissionAddress.transfer(msg.value);
  emit TokenExportEnabled(msg.sender, msg.value);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function swapTokens() public payable {
  require(exchangeEnabled);
  uint256 tokensToSend;
  tokensToSend = (msg.value * (10**decimals)) / tokenPrice;
  require(balances[owner] >= tokensToSend);
  balances[msg.sender] += tokensToSend;
  balances[owner] -= tokensToSend;
  owner.transfer(msg.value);
  emit Transfer(owner, msg.sender, tokensToSend);
  emit TransferSold(msg.sender, tokensToSend);
}

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 onlyOwner() {
  balances[_target] += _mintedAmount;
  totalSupply += _mintedAmount;
  emit Transfer(0, _target, _mintedAmount);
}

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(_to != address(0));
  require(balances[_from] >= _value); // Check if the sender has enough
  require(_value <= allowed[_from][msg.sender]); // Check if allowed is greater or equal
  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[_from][msg.sender].sub(_value); // adjust allowed
  emit Transfer(_from, _to, _value);
  return true;
}

Parameters help

Name Type
_spender
address help
_addedValue
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function increaseApproval(address _spender, uint256 _addedValue)
  public
  returns (bool success)
{
  allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(
    _addedValue
  );
  emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
  return true;
}

Parameters help

Name Type
_spender
address help
_subtractedValue
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function decreaseApproval(address _spender, uint256 _subtractedValue)
  public
  returns (bool success)
{
  uint256 oldValue = allowed[msg.sender][_spender];
  if (_subtractedValue > oldValue) {
    allowed[msg.sender][_spender] = 0;
  } else {
    allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
  }
  emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
  return true;
}

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.