ERC20
This contract is an ERC20 token.
Name
HPBToken
Symbol
HPB
Decimals
Total Supply
NaN HPB
About
Stats
Public Functions
14
Event Types
9
Code Size
13,709 bytes
Events (9) keyboard_arrow_up
Functions
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Modifiers help
onlyPayloadSize checks for the following:
Source Code
function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
}
allowance keyboard_arrow_up
transferFrom keyboard_arrow_up
Modifiers help
onlyPayloadSize checks for the following:
Source Code
function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// if (_value > _allowance) throw;
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
}
approve keyboard_arrow_up
Requirements help
One or more of the following:
Source Code
function approve(address _spender, uint _value) {
// 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);
}
start keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
beforeStart checks for the following:
Requirements help
Source Code
function start(uint _firstblock) public onlyOwner beforeStart {
if (_firstblock <= block.number) {
// Must specify a block in the future.
throw;
}
firstblock = _firstblock;
SaleStarted();
}
close keyboard_arrow_up
price keyboard_arrow_up
constructor keyboard_arrow_up
issueToken keyboard_arrow_up
Modifiers help
inProgress checks for the following:
Requirements help
Source Code
function issueToken(address recipient) payable inProgress {
// We only accept minimum purchase of 0.01 ETH.
assert(msg.value >= 0.01 ether);
// We only accept maximum purchase of 35 ETH.
assert(msg.value <= 35 ether);
// We only accept totalEthReceived < HARD_CAP
uint ethReceived = totalEthReceived + msg.value;
assert(ethReceived <= HARD_CAP);
uint tokens = computeTokenAmount(msg.value);
totalEthReceived = totalEthReceived.add(msg.value);
balances[msg.sender] = balances[msg.sender].add(tokens);
balances[target] = balances[target].sub(tokens);
Issue(
issueIndex++,
recipient,
msg.value,
tokens
);
if (!target.send(msg.value)) {
throw;
}
}