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
State Variables (8) keyboard_arrow_up
Functions
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address _to, uint256 _amount) public returns (bool success) {
doTransfer(msg.sender, _to, _amount);
return true;
}
transferFrom keyboard_arrow_up
Requirements help
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;
}
balanceOf keyboard_arrow_up
approve keyboard_arrow_up
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
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
allowance keyboard_arrow_up
totalSupply keyboard_arrow_up
setRaindropAddress keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setRaindropAddress(address _raindrop) public onlyOwner {
raindropAddress = _raindrop;
}
authenticate keyboard_arrow_up
Requirements help
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
Modifiers help
onlyOwner checks for the following:
Requirements help
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
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
Requirements help
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);
}