Blockwell

BrickblockToken

ERC20

This contract is an ERC20 token.

Name BrickblockToken
Symbol BBK
Decimals 18
Total Supply 265,000,143 BBK

About

Stats

Public Functions 16
Event Types 7
Code Size 16,560 bytes

Events (7) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

Burn Event

Parameters help
burner
address help
value
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Pause Event

Parameters help

TokenSaleFinished Event

Parameters help
totalSupply
uint256 help
distributedTokens
uint256 help
bonusTokens
uint256 help
companyTokens
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

Unpause Event

Parameters help

name Constant

string help
BrickblockToken

symbol Constant

string help
BBK

initialSupply Constant

uint256 help
500 * UNKNOWN VALUE * UNKNOWN VALUE

contributorsShare Constant

uint8 help
51

companyShare Constant

uint8 help
35

bonusShare Constant

uint8 help
14

decimals Constant

uint8 help
18

companyTokens Variable

uint256 help

bonusTokens Variable

uint256 help

bonusDistributionAddress Variable

address help

fountainContractAddress Variable

address help

tokenSaleActive Variable

bool help

dead Variable

bool help

totalSupply Variable

uint256 help

paused Variable

bool help

owner Variable

address help

allowed Variable

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

balances Variable

mapping(address => uint256) help
Internal Variable

Functions Expand All Collapse All

transferOwnership keyboard_arrow_up

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(newOwner != address(0));
  OwnershipTransferred(owner, newOwner);
  owner = newOwner;
}

pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function pause() public onlyOwner whenNotPaused {
  paused = true;
  Pause();
}

unpause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unpause() public onlyOwner whenPaused {
  paused = false;
  Unpause();
}

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
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transfer(address _to, uint256 _value)
  public
  whenNotPaused
  returns (bool)
{
  return super.transfer(_to, _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)
{
  return allowed[_owner][_spender];
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) public whenNotPaused returns (bool) {
  return super.transferFrom(_from, _to, _value);
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function approve(address _spender, uint256 _value)
  public
  whenNotPaused
  returns (bool)
{
  return super.approve(_spender, _value);
}

increaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_addedValue
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function increaseApproval(address _spender, uint256 _addedValue)
  public
  whenNotPaused
  returns (bool success)
{
  return super.increaseApproval(_spender, _addedValue);
}

decreaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_subtractedValue
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function decreaseApproval(address _spender, uint256 _subtractedValue)
  public
  whenNotPaused
  returns (bool success)
{
  return super.decreaseApproval(_spender, _subtractedValue);
}

toggleDead keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function toggleDead() external onlyOwner returns (bool) {
  dead = !dead;
}

changeFountainContractAddress keyboard_arrow_up

Parameters help

Name Type
_newAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function changeFountainContractAddress(address _newAddress)
  external
  onlyOwner
  returns (bool)
{
  require(isContract(_newAddress));
  require(_newAddress != address(this));
  require(_newAddress != owner);
  fountainContractAddress = _newAddress;
  return true;
}

distributeTokens keyboard_arrow_up

Parameters help

Name Type
_contributor
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function distributeTokens(address _contributor, uint256 _value)
  external
  onlyOwner
  supplyAvailable(_value)
  returns (bool)
{
  require(tokenSaleActive == true);
  require(_contributor != address(0));
  require(_contributor != owner);
  balances[this] = balances[this].sub(_value);
  balances[_contributor] = balances[_contributor].add(_value);
  Transfer(this, _contributor, _value);
  return true;
}

distributeBonusTokens keyboard_arrow_up

Parameters help

Name Type
_recipient
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function distributeBonusTokens(address _recipient, uint256 _value)
  external
  onlyOwner
  returns (bool)
{
  require(_recipient != address(0));
  require(_recipient != owner);
  balances[bonusDistributionAddress] = balances[bonusDistributionAddress].sub(
    _value
  );
  balances[_recipient] = balances[_recipient].add(_value);
  Transfer(bonusDistributionAddress, _recipient, _value);
  return true;
}

finalizeTokenSale keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function finalizeTokenSale() external onlyOwner returns (bool) {
  // ensure that sale is active. is set to false at the end. can only be performed once.
  require(tokenSaleActive == true);
  // ensure that fountainContractAddress has been set
  require(fountainContractAddress != address(0));
  // calculate new total supply. need to do this in two steps in order to have accurate totalSupply due to integer division
  uint256 _distributedTokens = initialSupply.sub(
    balances[this].add(bonusTokens)
  );
  uint256 _newTotalSupply = _distributedTokens.add(
    bonusTokens.add(companyTokens)
  );
  // unpurchased amount of tokens which will be burned
  uint256 _burnAmount = totalSupply.sub(_newTotalSupply);
  // leave remaining balance for company to be claimed at later date
  balances[this] = balances[this].sub(_burnAmount);
  Burn(this, _burnAmount);
  // allow our fountain contract to transfer the company tokens to itself
  allowed[this][fountainContractAddress] = companyTokens;
  Approval(this, fountainContractAddress, companyTokens);
  // set new totalSupply
  totalSupply = _newTotalSupply;
  // prevent this function from ever running again after finalizing the token sale
  tokenSaleActive = false;
  // dispatch event showing sale is finished
  TokenSaleFinished(
    totalSupply,
    _distributedTokens,
    bonusTokens,
    companyTokens
  );
  // everything went well return true
  return true;
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function() external {
  revert();
}

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 BrickblockToken.isContract keyboard_arrow_up

Parameters help

Name Type
addr
address help

Properties

Visibility help private
Mutability help view
Source Code
function isContract(address addr) private view returns (bool) {
  uint256 _size;
  assembly {
    _size := extcodesize(addr)
  }
  return _size > 0;
}