Blockwell

Hydro

ERC20

This contract is an ERC20 token.

Name Hydro
Symbol HYDRO
Decimals 18
Total Supply 11,111,111,111 HYDRO

About

Stats

Public Functions 12
Event Types 4
Code Size 8,680 bytes

Library Use

Uses SafeMath for uint256.

Events (4) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_amount
uint256 help

Burn Event

Parameters help
_burner
address help
_amount
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
_from
address help
_to
address help
_amount
uint256 help

name Variable

string help

decimals Variable

uint8 help

symbol Variable

string help

totalSupply Variable

uint help

raindropAddress Variable

address help

owner Variable

address help

balances Variable

mapping(address => uint256) help

allowed Variable

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

Functions Expand All Collapse All

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transferOwnership(address newOwner) public onlyOwner {
  require(newOwner != address(0));
  emit OwnershipTransferred(owner, newOwner);
  owner = newOwner;
}

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transfer(address _to, uint256 _amount) public returns (bool success) {
  doTransfer(msg.sender, _to, _amount);
  return true;
}

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _amount
) public returns (bool success) {
  // The standard ERC 20 transferFrom functionality
  require(allowed[_from][msg.sender] >= _amount);
  allowed[_from][msg.sender] -= _amount;
  doTransfer(_from, _to, _amount);
  return true;
}

Parameters help

Name Type
_owner
address help

Properties

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

Parameters help

Name Type
_spender
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

One or more of the following:
Source Code
function approve(address _spender, uint256 _amount)
  public
  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
  require((_amount == 0) || (allowed[msg.sender][_spender] == 0));

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

approveAndCall keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction
Source Code
function approveAndCall(
  address _spender,
  uint256 _value,
  bytes _extraData
) public returns (bool success) {
  tokenRecipient spender = tokenRecipient(_spender);
  if (approve(_spender, _value)) {
    spender.receiveApproval(msg.sender, _value, this, _extraData);
    return true;
  }
}

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burn(uint256 _value) public onlyOwner {
  require(balances[msg.sender] >= _value);
  balances[msg.sender] = balances[msg.sender].sub(_value);
  totalSupply = totalSupply.sub(_value);
}

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)
  public
  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 totalSupply() public constant returns (uint256) {
  return totalSupply;
}

setRaindropAddress keyboard_arrow_up

Parameters help

Name Type
_raindrop
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function setRaindropAddress(address _raindrop) public onlyOwner {
  raindropAddress = _raindrop;
}

authenticate keyboard_arrow_up

Parameters help

Name Type
_value
uint help
_challenge
uint help
_partnerId
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function authenticate(
  uint256 _value,
  uint256 _challenge,
  uint256 _partnerId
) public {
  Raindrop raindrop = Raindrop(raindropAddress);
  raindrop.authenticate(msg.sender, _value, _challenge, _partnerId);
  doTransfer(msg.sender, owner, _value);
}

setBalances keyboard_arrow_up

Parameters help

Name Type
_addressList
address[] help
_amounts
uint[] help

Properties

Visibility help public
Mutability help transaction
Source Code
function setBalances(address[] _addressList, uint256[] _amounts)
  public
  onlyOwner
{
  require(_addressList.length == _amounts.length);
  for (uint256 i = 0; i < _addressList.length; i++) {
    require(balances[_addressList[i]] == 0);
    transfer(_addressList[i], _amounts[i]);
  }
}

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 HydroToken.doTransfer keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_amount
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function doTransfer(
  address _from,
  address _to,
  uint256 _amount
) internal {
  // Do not allow transfer to 0x0 or the token contract itself
  require((_to != 0) && (_to != address(this)));
  require(_amount <= balances[_from]);
  balances[_from] = balances[_from].sub(_amount);
  balances[_to] = balances[_to].add(_amount);
  emit Transfer(_from, _to, _amount);
}