Blockwell

FirstBlood Token

ERC20

This contract is an ERC20 token.

Name FirstBlood Token
Symbol 1ST
Decimals 18
Total Supply 93,468,684 1ST

About

Stats

Public Functions 16
Event Types 6
Code Size 14,189 bytes

Events (6) keyboard_arrow_up

AllocateBountyAndEcosystemTokens Event

Parameters help
sender
address help

AllocateFounderTokens Event

Parameters help
sender
address help

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Buy Event

Parameters help
sender
address help
eth
uint help
fbt
uint help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Withdraw Event

Parameters help
sender
address help
to
address help
eth
uint help

name Variable

string help

symbol Variable

string help

decimals Variable

uint help

startBlock Variable

uint help

endBlock Variable

uint help

founder Variable

address help

signer Variable

address help

etherCap Variable

uint help

transferLockup Variable

uint help

founderLockup Variable

uint help

bountyAllocation Variable

uint help

ecosystemAllocation Variable

uint help

founderAllocation Variable

uint help

bountyAllocated Variable

bool help

ecosystemAllocated Variable

bool help

founderAllocated Variable

bool help

presaleTokenSupply Variable

uint help

presaleEtherRaised Variable

uint help

halted Variable

bool 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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function totalSupply() constant returns (uint256 supply) {}

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

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _value) returns (bool success) {
  if (block.number <= endBlock + transferLockup && msg.sender != founder) throw;
  return super.transfer(_to, _value);
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) returns (bool success) {
  if (block.number <= endBlock + transferLockup && msg.sender != founder) throw;
  return super.transferFrom(_from, _to, _value);
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
  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 constant
Source Code
function allowance(address _owner, address _spender)
  constant
  returns (uint256 remaining)
{
  return allowed[_owner][_spender];
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function price() constant returns (uint256) {
  if (block.number >= startBlock && block.number < startBlock + 250) return 170; //power hour
  if (block.number < startBlock || block.number > endBlock) return 100; //default price
  return
    100 +
    (((4 * (endBlock - block.number)) / (endBlock - startBlock + 1)) * 67) /
    4; //crowdsale price
}

Parameters help

Name Type
blockNumber
uint help

Properties

Visibility help public
Mutability help constant
Source Code
function testPrice(uint256 blockNumber) constant returns (uint256) {
  if (blockNumber >= startBlock && blockNumber < startBlock + 250) return 170; //power hour
  if (blockNumber < startBlock || blockNumber > endBlock) return 100; //default price
  return
    100 +
    (((4 * (endBlock - blockNumber)) / (endBlock - startBlock + 1)) * 67) /
    4; //crowdsale price
}

Parameters help

Name Type
v
uint8 help
r
bytes32 help
s
bytes32 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function buy(
  uint8 v,
  bytes32 r,
  bytes32 s
) {
  buyRecipient(msg.sender, v, r, s);
}

Parameters help

Name Type
recipient
address help
v
uint8 help
r
bytes32 help
s
bytes32 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function buyRecipient(
  address recipient,
  uint8 v,
  bytes32 r,
  bytes32 s
) {
  bytes32 hash = sha256(msg.sender);
  if (ecrecover(hash, v, r, s) != signer) throw;
  if (
    block.number < startBlock ||
    block.number > endBlock ||
    safeAdd(presaleEtherRaised, msg.value) > etherCap ||
    halted
  ) throw;
  uint256 tokens = safeMul(msg.value, price());
  balances[recipient] = safeAdd(balances[recipient], tokens);
  totalSupply = safeAdd(totalSupply, tokens);
  presaleEtherRaised = safeAdd(presaleEtherRaised, msg.value);

  if (!founder.call.value(msg.value)()) throw; //immediately send Ether to founder address

  Buy(recipient, msg.value, tokens);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function allocateFounderTokens() {
  if (msg.sender != founder) throw;
  if (block.number <= endBlock + founderLockup) throw;
  if (founderAllocated) throw;
  if (!bountyAllocated || !ecosystemAllocated) throw;
  balances[founder] = safeAdd(
    balances[founder],
    (presaleTokenSupply * founderAllocation) / (1 ether)
  );
  totalSupply = safeAdd(
    totalSupply,
    (presaleTokenSupply * founderAllocation) / (1 ether)
  );
  founderAllocated = true;
  AllocateFounderTokens(msg.sender);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function allocateBountyAndEcosystemTokens() {
  if (msg.sender != founder) throw;
  if (block.number <= endBlock) throw;
  if (bountyAllocated || ecosystemAllocated) throw;
  presaleTokenSupply = totalSupply;
  balances[founder] = safeAdd(
    balances[founder],
    (presaleTokenSupply * ecosystemAllocation) / (1 ether)
  );
  totalSupply = safeAdd(
    totalSupply,
    (presaleTokenSupply * ecosystemAllocation) / (1 ether)
  );
  balances[founder] = safeAdd(balances[founder], bountyAllocation);
  totalSupply = safeAdd(totalSupply, bountyAllocation);
  bountyAllocated = true;
  ecosystemAllocated = true;
  AllocateBountyAndEcosystemTokens(msg.sender);
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function halt() {
  if (msg.sender != founder) throw;
  halted = true;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unhalt() {
  if (msg.sender != founder) throw;
  halted = false;
}

Parameters help

Name Type
newFounder
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function changeFounder(address newFounder) {
  if (msg.sender != founder) throw;
  founder = newFounder;
}

Parameters help

This function has no parameters.

Properties

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

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