Blockwell

HPBToken

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

Approval Event

Parameters help
owner
address help
spender
address help
value
uint help

InvalidCaller Event

Parameters help
caller
address help

InvalidState Event

Parameters help
msg
bytes help

Issue Event

Parameters help
issueIndex
uint help
addr
address help
ethAmount
uint help
tokenAmount
uint help

SaleEnded Event

Parameters help

SaleFailed Event

Parameters help

SaleStarted Event

Parameters help

SaleSucceeded Event

Parameters help

Transfer Event

Parameters help
from
address help
to
address help
value
uint help

Functions Expand All Collapse All

balanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

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

transfer keyboard_arrow_up

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, 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

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 (uint remaining) {
    return allowed[_owner][_spender];
  }

transferFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_value
uint help

Properties

Visibility help public
Mutability help transaction

Modifiers help

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

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, 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

Parameters help

Name Type
_firstblock
uint help

Properties

Visibility help public
Mutability help transaction

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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

onlyOwner checks for the following:
afterEnd checks for the following:
Source Code
    function close() public onlyOwner afterEnd {
        if (totalEthReceived < GOAL) {
            SaleFailed();
        } else {
            SaleSucceeded();
        }
    }

price keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function price() public constant returns (uint tokens) {
        return computeTokenAmount(1 ether);
    }

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
    function () payable {
        issueToken(msg.sender);
    }

issueToken keyboard_arrow_up

Parameters help

Name Type
recipient
address help

Properties

Visibility help public
Mutability help payable

Modifiers help

inProgress checks for the following:
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;
        }
    }

saleStarted keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function saleStarted() constant returns (bool) {
        return (firstblock > 0 && block.number >= firstblock);
    }

saleEnded keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function saleEnded() constant returns (bool) {
        return firstblock > 0 && (saleDue() || hardCapReached());
    }

saleDue keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function saleDue() constant returns (bool) {
        return block.number >= firstblock + BLOCKS_PER_PHASE * NUM_OF_PHASE;
    }

hardCapReached keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function hardCapReached() constant returns (bool) {
        return totalEthReceived >= HARD_CAP;
    }