Blockwell

"BANKEX" project utility token

ERC20

This contract is an ERC20 token.

Name "BANKEX" project utility token
Symbol BKX
Decimals 18
Total Supply 400,000,000 BKX

About

Stats

Public Functions 14
Event Types 3
Code Size 9,637 bytes

Library Use

Uses SafeMath for uint256.

Events (3) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

owner Variable

address help

name Variable

string help

symbol Variable

string help

upgradable Variable

bool help

upgraderSet Variable

bool help

upgrader Variable

address help

locked Variable

bool help

decimals Variable

uint8 help

decimalMultiplier Variable

uint256 help

totalSupply Variable

uint256 help

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

mapping(address => 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
  returns (bool success)
{
  require(newOwner != address(0));
  OwnershipTransferred(owner, newOwner);
  owner = newOwner;
  return true;
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function transfer(address _to, uint256 _value) public unlocked returns (bool) {
  require(_to != address(0));
  balances[msg.sender] = balances[msg.sender].sub(_value);
  balances[_to] = balances[_to].add(_value);
  Transfer(msg.sender, _to, _value);
  return true;
}

Parameters help

Name Type
_owner
address help

Properties

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

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 unlocked returns (bool) {
  require(_to != address(0));
  uint256 _allowance = allowed[_from][msg.sender];
  require(_allowance >= _value);
  balances[_from] = balances[_from].sub(_value);
  balances[_to] = balances[_to].add(_value);
  allowed[_from][msg.sender] = _allowance.sub(_value);
  Transfer(_from, _to, _value);
  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

One or more of the following:
Source Code
function approve(address _spender, uint256 _value)
  public
  unlocked
  returns (bool)
{
  require((_value == 0) || (allowed[msg.sender][_spender] == 0));
  allowed[msg.sender][_spender] = _value;
  Approval(msg.sender, _spender, _value);
  return true;
}

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

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
  unlocked
  returns (bool success)
{
  allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(
    _addedValue
  );
  Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
  return true;
}

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
  unlocked
  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);
  }
  Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
  return true;
}

setLock keyboard_arrow_up

Parameters help

Name Type
_newLockState
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function setLock(bool _newLockState) public onlyOwner returns (bool success) {
  require(_newLockState != locked);
  locked = _newLockState;
  return true;
}

allowUpgrading keyboard_arrow_up

Parameters help

Name Type
_newState
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function allowUpgrading(bool _newState)
  public
  onlyOwner
  returns (bool success)
{
  upgradable = _newState;
  return true;
}

setUpgrader keyboard_arrow_up

Parameters help

Name Type
_upgraderAddress
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function setUpgrader(address _upgraderAddress)
  public
  onlyOwner
  returns (bool success)
{
  require(!upgraderSet);
  require(_upgraderAddress != address(0));
  upgraderSet = true;
  upgrader = TokenUpgraderInterface(_upgraderAddress);
  return true;
}

upgrade keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function upgrade() public returns (bool success) {
  require(upgradable);
  require(upgraderSet);
  require(upgrader != TokenUpgraderInterface(0));
  uint256 value = balances[msg.sender];
  assert(value > 0);
  delete balances[msg.sender];
  totalSupply = totalSupply.sub(value);
  assert(upgrader.upgradeFor(msg.sender, value));
  return true;
}

upgradeFor keyboard_arrow_up

Parameters help

Name Type
_for
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function upgradeFor(address _for, uint256 _value)
  public
  returns (bool success)
{
  require(upgradable);
  require(upgraderSet);
  require(upgrader != TokenUpgraderInterface(0));
  uint256 _allowance = allowed[_for][msg.sender];
  require(_allowance >= _value);
  balances[_for] = balances[_for].sub(_value);
  allowed[_for][msg.sender] = _allowance.sub(_value);
  totalSupply = totalSupply.sub(_value);
  assert(upgrader.upgradeFrom(msg.sender, _for, _value));
  return true;
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
function() external payable {
  if (upgradable) {
    assert(upgrade());
    return;
  }
  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 Token.mint keyboard_arrow_up

Parameters help

Name Type
_for
address help
_amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function mint(address _for, uint256 _amount) internal returns (bool success) {
  _amount = _amount * decimalMultiplier;
  balances[_for] = balances[_for].add(_amount);
  totalSupply = totalSupply.add(_amount);
  Transfer(0, _for, _amount);
  return true;
}