Blockwell

StorjToken

ERC20

This contract is an ERC20 token.

Name StorjToken
Symbol STORJ
Decimals 8
Total Supply 424,999,998 STORJ

About link description

Storj (STORJ) is a cryptocurrency and operates on the Ethereum platform. Storj has a current supply of 424,999,998.00001335 with 288,459,570.8226945 in circulation. The last known price of Storj is 0.83135281 USD and is down -2.81 over the last 24 hours. It is currently trading on 74 active market(s) with $29,994,791.57 traded over the last 24 hours. More information can be found at https://storj.io/.

Stats

Public Functions 11
Event Types 5
Code Size 10,335 bytes

Events (5) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

Burned Event

Parameters help
burner
address help
burnedAmount
uint help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

Upgrade Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

UpgradeAgentSet Event

Parameters help
agent
address help

BURN_ADDRESS Constant

address help
0

isToken Constant

bool help
true

name Variable

string help

symbol Variable

string help

decimals Variable

uint help

totalSupply Variable

uint help

upgradeMaster Variable

address help

upgradeAgent Variable

address help

totalUpgraded Variable

uint256 help

balances Variable

mapping(address => uint) help
Internal Variable

allowed Variable

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

Functions Expand All Collapse All

Parameters help

Name Type
_owner
address help

Properties

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

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
function allowance(address _owner, address _spender)
  constant
  returns (uint256 remaining)
{
  return allowed[_owner][_spender];
}

Parameters help

Name Type
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transfer(address _to, uint256 _value)
  onlyPayloadSize(2 * 32)
  returns (bool success)
{
  balances[msg.sender] = safeSub(balances[msg.sender], _value);
  balances[_to] = safeAdd(balances[_to], _value);
  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
) returns (bool success) {
  var _allowance = allowed[_from][msg.sender];

  // Check is not needed because safeSub(_allowance, _value) will already throw if this condition is not met
  // if (_value > _allowance) throw;

  balances[_to] = safeAdd(balances[_to], _value);
  balances[_from] = safeSub(balances[_from], _value);
  allowed[_from][msg.sender] = safeSub(_allowance, _value);
  Transfer(_from, _to, _value);
  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Requirements help

One or more of the following:
Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
  // To change the approve amount you first have to reduce the addresses`
  //  allowance to zero by calling `approve(_spender, 0)` if it is not
  //  already 0 to mitigate the race condition described here:
  //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
  if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw;

  allowed[msg.sender][_spender] = _value;
  Approval(msg.sender, _spender, _value);
  return true;
}

Parameters help

Name Type
value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function upgrade(uint256 value) public {
  UpgradeState state = getUpgradeState();
  if (
    !(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)
  ) {
    // Called in a bad state
    throw;
  }

  // Validate input value.
  if (value == 0) throw;

  balances[msg.sender] = safeSub(balances[msg.sender], value);

  // Take tokens out from circulation
  totalSupply = safeSub(totalSupply, value);
  totalUpgraded = safeAdd(totalUpgraded, value);

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

Parameters help

Name Type
agent
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function setUpgradeAgent(address agent) external {
  if (!canUpgrade()) {
    // The token is not yet in a state that we could think upgrading
    throw;
  }

  if (agent == 0x0) throw;
  // Only a master can designate the next agent
  if (msg.sender != upgradeMaster) throw;
  // Upgrade has already begun for an agent
  if (getUpgradeState() == UpgradeState.Upgrading) throw;

  upgradeAgent = UpgradeAgent(agent);

  // Bad interface
  if (!upgradeAgent.isUpgradeAgent()) throw;
  // Make sure that token supplies match in source and target
  if (upgradeAgent.originalSupply() != totalSupply) throw;

  UpgradeAgentSet(upgradeAgent);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function getUpgradeState() public constant returns (UpgradeState) {
  if (!canUpgrade()) return UpgradeState.NotAllowed;
  else if (address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent;
  else if (totalUpgraded == 0) return UpgradeState.ReadyToUpgrade;
  else return UpgradeState.Upgrading;
}

Parameters help

Name Type
master
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function setUpgradeMaster(address master) public {
  if (master == 0x0) throw;
  if (msg.sender != upgradeMaster) throw;
  upgradeMaster = master;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function canUpgrade() public constant returns (bool) {
  return true;
}

Parameters help

Name Type
burnAmount
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 burnAmount) {
  address burner = msg.sender;
  balances[burner] = safeSub(balances[burner], burnAmount);
  totalSupply = safeSub(totalSupply, burnAmount);
  Burned(burner, burnAmount);

  // Keep token balance tracking services happy by sending the burned amount to
  // "burn address", so that it will show up as a ERC-20 transaction
  // in etherscan, etc. as there is no standarized burn event yet
  Transfer(burner, BURN_ADDRESS, burnAmount);
}

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 SafeMath.safeMul keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a * b;
  assert(a == 0 || c / a == b);
  return c;
}

internal SafeMath.safeDiv keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
  assert(b > 0);
  uint256 c = a / b;
  assert(a == b * c + (a % b));
  return c;
}

internal SafeMath.safeSub keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function safeSub(uint256 a, uint256 b) internal returns (uint256) {
  assert(b <= a);
  return a - b;
}

internal SafeMath.safeAdd keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a + b;
  assert(c >= a && c >= b);
  return c;
}

internal SafeMath.max64 keyboard_arrow_up

Parameters help

Name Type
a
uint64 help
b
uint64 help

Properties

Visibility help internal
Mutability help constant
Source Code
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
  return a >= b ? a : b;
}

internal SafeMath.min64 keyboard_arrow_up

Parameters help

Name Type
a
uint64 help
b
uint64 help

Properties

Visibility help internal
Mutability help constant
Source Code
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
  return a < b ? a : b;
}

internal SafeMath.max256 keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help constant
Source Code
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
  return a >= b ? a : b;
}

internal SafeMath.min256 keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help constant
Source Code
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
  return a < b ? a : b;
}

internal SafeMath.assert keyboard_arrow_up

Parameters help

Name Type
assertion
bool help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function assert(bool assertion) internal {
  if (!assertion) {
    throw;
  }
}

internal SafeMath.safeMul keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a * b;
  assert(a == 0 || c / a == b);
  return c;
}

internal SafeMath.safeDiv keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeDiv(uint256 a, uint256 b) internal returns (uint256) {
  assert(b > 0);
  uint256 c = a / b;
  assert(a == b * c + (a % b));
  return c;
}

internal SafeMath.safeSub keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function safeSub(uint256 a, uint256 b) internal returns (uint256) {
  assert(b <= a);
  return a - b;
}

internal SafeMath.safeAdd keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a + b;
  assert(c >= a && c >= b);
  return c;
}

internal SafeMath.max64 keyboard_arrow_up

Parameters help

Name Type
a
uint64 help
b
uint64 help

Properties

Visibility help internal
Mutability help constant
Source Code
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
  return a >= b ? a : b;
}

internal SafeMath.min64 keyboard_arrow_up

Parameters help

Name Type
a
uint64 help
b
uint64 help

Properties

Visibility help internal
Mutability help constant
Source Code
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
  return a < b ? a : b;
}

internal SafeMath.max256 keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help constant
Source Code
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
  return a >= b ? a : b;
}

internal SafeMath.min256 keyboard_arrow_up

Parameters help

Name Type
a
uint256 help
b
uint256 help

Properties

Visibility help internal
Mutability help constant
Source Code
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
  return a < b ? a : b;
}

internal SafeMath.assert keyboard_arrow_up

Parameters help

Name Type
assertion
bool help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function assert(bool assertion) internal {
  if (!assertion) {
    throw;
  }
}