Blockwell

Blockium Token

ERC20

This contract is an ERC20 token.

Name Blockium Token
Symbol BOK
Decimals 18
Total Supply 650,000,000 BOK

About

Stats

Public Functions 30
Event Types 9
Code Size 34,011 bytes

Library Use

Uses SafeMath for uint256.

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

LogUpgrade Event

Parameters help
from
address help
to
address help
value
uint256 help

LogUpgradeAgentSet Event

Parameters help
agent
address help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Paused Event

Parameters help
account
address help

PauserAdded Event

Parameters help
account
address help

PauserRemoved Event

Parameters help
account
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

Unpaused Event

Parameters help
account
address help

Functions Expand All Collapse All

isUpgradeAgent keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help pure
Source Code
    function isUpgradeAgent() external pure returns (bool) {
        return true;
    }

upgradeFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function upgradeFrom(address _from, uint256 _value) external validateAddress(_from) {
        require(previousToken != address(0), "previousToken was not set");
        require(msg.sender == previousToken, "upgradeFrom should only be called by previousToken");
        _mint(_from, _value);
    }

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function owner() public view returns (address) {
        return _owner;
    }

isOwner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function isOwner() public view returns (bool) {
        return msg.sender == _owner;
    }

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

name keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function name() public view returns (string memory) {
        return _name;
    }

symbol keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function symbol() public view returns (string memory) {
        return _symbol;
    }

decimals keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function decimals() public view returns (uint8) {
        return _decimals;
    }

isPauser keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
    function isPauser(address account) public view returns (bool) {
        return _pausers.has(account);
    }

addPauser keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyPauser checks for the following:
null
Source Code
    function addPauser(address account) public onlyPauser {
        _addPauser(account);
    }

removePauser keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyPauser checks for the following:
null

Requirements help

Source Code
    function removePauser(address account) public onlyPauser {
        _removePauser(account);
    }

paused keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function paused() public view returns (bool) {
        return _paused;
    }

pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyPauser checks for the following:
null
Source Code
    function pause() public onlyPauser whenNotPaused {
        _paused = true;
        emit Paused(msg.sender);
    }

unpause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function unpause() public onlyPauser whenPaused {
        _paused = false;
        emit Unpaused(msg.sender);
    }

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function totalSupply() public view returns (uint256) {
        return _totalSupply;
    }

balanceOf keyboard_arrow_up

Parameters help

Name Type
owner
address help

Properties

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

allowance keyboard_arrow_up

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 _allowances[owner][spender];
    }

transfer keyboard_arrow_up

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);
    }

approve keyboard_arrow_up

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);
    }

transferFrom keyboard_arrow_up

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);
    }

increaseAllowance keyboard_arrow_up

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) {
        return super.increaseAllowance(spender, addedValue);
    }

decreaseAllowance keyboard_arrow_up

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
    function decreaseAllowance(address spender, uint256 subtractedValue) public whenNotPaused returns (bool) {
        return super.decreaseAllowance(spender, subtractedValue);
    }

upgrade keyboard_arrow_up

Parameters help

Name Type
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function upgrade(uint256 value) external {
        UpgradeState state = getUpgradeState();
        require(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading, "upgrade state does not allow upgrade");
        require(value != 0, "value must be non-zero");

        // Take tokens out from circulation
        _burn(msg.sender, value);
        totalUpgraded = totalUpgraded.add(value);
        emit LogUpgrade(msg.sender, address(upgradeAgent), value);

        // Upgrade agent reissues the tokens
        upgradeAgent.upgradeFrom(msg.sender, value);
    }

setUpgradeAgent keyboard_arrow_up

Parameters help

Name Type
newUpgradeAgent
UpgradeAgent help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function setUpgradeAgent(UpgradeAgent newUpgradeAgent) external onlyUpgradeMaster validateAddress(address(newUpgradeAgent)) {
        require(getUpgradeState() != UpgradeState.Upgrading, "upgrade already started");

        upgradeAgent = newUpgradeAgent;
        emit LogUpgradeAgentSet(address(newUpgradeAgent));

        // Calling non-existent function will revert inside the call without this require error message
        require(newUpgradeAgent.isUpgradeAgent(), "Bad interface");
    }

getUpgradeState keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
    function getUpgradeState() public view returns(UpgradeState) {
        if (address(upgradeAgent) == address(0)) {
            return UpgradeState.WaitingForAgent;
        } else if (totalUpgraded == 0) {
            return UpgradeState.ReadyToUpgrade;
        } else if (totalUpgraded < totalSupply()) {
            return UpgradeState.Upgrading;
        } else {
            return UpgradeState.UpgradeFinished;
        }
    }

setUpgradeMaster keyboard_arrow_up

Parameters help

Name Type
master
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setUpgradeMaster(address master) external onlyUpgradeMaster validateAddress(master) {
        upgradeMaster = master;
    }

recoverToken keyboard_arrow_up

Parameters help

Name Type
_token
IERC20 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
    function recoverToken(IERC20 _token) external onlyOwner {
        uint256 balance = _token.balanceOf(address(this));
        require(balance > 0, "no tokens to recover for received token type");
        SafeERC20.safeTransfer(_token, _owner, balance);
    }

reclaimContract keyboard_arrow_up

Parameters help

Name Type
contractInst
Ownable help

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null
Source Code
    function reclaimContract(Ownable contractInst) external onlyOwner {
        contractInst.transferOwnership(_owner);
    }

tokenFallback keyboard_arrow_up

Parameters help

Name Type
from
address help
value
uint256 help
data
bytes help

Properties

Visibility help public
Mutability help pure
Source Code
    function tokenFallback(address from, uint256 value, bytes calldata data) external pure {
        /* Use variables to remove warnings https://github.com/OpenZeppelin/openzeppelin-solidity/commit/b50391862c42857e3ff2388598e52ebab92fc9fa#diff-24aa1138eec9d5dd65b1a8a898e04dd2 */
        from;
        value;
        data;
        revert("this contract does not support receiving ERC223 tokens");
    }

recoverEther keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
null

Requirements help

Source Code
    function recoverEther() external onlyOwner {
        require(address(this).balance > 0, "no ether to recover");
        address(uint160(_owner)).transfer(address(this).balance);
    }