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
State Variables (22) keyboard_arrow_up
Functions
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
One or more of the following:
-
founder
must be equal to
the sender's address
- OR
block.number
must be greater than
endBlock + transferLockup
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);
}
transferFrom keyboard_arrow_up
Requirements help
One or more of the following:
-
founder
must be equal to
the sender's address
- OR
block.number
must be greater than
endBlock + transferLockup
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);
}
approve keyboard_arrow_up
Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
allowance keyboard_arrow_up
price keyboard_arrow_up
Parameters help
This function has no parameters.
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
}
testPrice keyboard_arrow_up
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
}
buy keyboard_arrow_up
Requirements help
etherCap
must be greater than or equal to
the result of calling safeAdd with presaleEtherRaised, msg.value
Source Code
function buy(
uint8 v,
bytes32 r,
bytes32 s
) {
buyRecipient(msg.sender, v, r, s);
}
buyRecipient keyboard_arrow_up
Requirements help
etherCap
must be greater than or equal to
the result of calling safeAdd with presaleEtherRaised, msg.value
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);
}
allocateFounderTokens keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
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);
}
allocateBountyAndEcosystemTokens keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
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);
}
halt keyboard_arrow_up
unhalt keyboard_arrow_up
changeFounder keyboard_arrow_up
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.
internal SafeMath.safeMul keyboard_arrow_up
Requirements help
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
internal SafeMath.safeAdd keyboard_arrow_up
Source Code
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c >= a && c >= b);
return c;
}