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
State Variables (11) keyboard_arrow_up
Functions
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
pause keyboard_arrow_up
unpause keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address _to, uint256 _value)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
allowance keyboard_arrow_up
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
approve keyboard_arrow_up
Source Code
function approve(address _spender, uint256 _value)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
increaseApproval keyboard_arrow_up
Source Code
function increaseApproval(address _spender, uint256 _addedValue)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
decreaseApproval keyboard_arrow_up
Source Code
function decreaseApproval(address _spender, uint256 _subtractedValue)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
toggleDead keyboard_arrow_up
changeFountainContractAddress keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Requirements help
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
Modifiers help
onlyOwner checks for the following:
supplyAvailable checks for the following:
Requirements help
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
Modifiers help
onlyOwner checks for the following:
Requirements help
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.
Modifiers help
onlyOwner checks for the following:
Requirements help
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;
}
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.