An infinite-supply ERC-20-compatible token where every transfer mints a hug. Deployed August 23, 2016 by Jon Romero as a social experiment and Ethereum tutorial
Token Information
Key Facts
Description
Anyone can claim and send Hug tokens. When a user gives their first hug, they may include a name or message which is stored and indexed on-chain. Each address is allowed exactly one logged message; subsequent hugs still work, but the contract records only the hug itself.
The contract tracks total huggers and stores structured data about hugs, including the recipient address, an associated name string, and the timestamp of the hug. Hug tokens can be transferred between addresses, and the primary interaction pattern is the "giveHugTo" function, which combines token transfer with message recording.
The token has no fixed supply limit, reinforcing its purpose as a symbolic gesture rather than a scarce asset.
HugCoin was deployed on August 23, 2016 and implements an infinite-supply token designed to represent โhugs.โ The contract exposes a human-friendly interface, including a name (HugCoin), a symbol (๐ค), and functions for giving hugs directly to other addresses.
Source Verified
Byte-perfect match on both runtime bytecode (1,715 bytes) and creation bytecode (3,100 bytes, excluding 96-byte constructor args). Verified with soljson v0.3.3, v0.3.4, and v0.3.5 โ all produce identical output with optimizer enabled. Source published by the author at github.com/jonromero/ethereum_contracts.
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
DAO Fork Era
The controversial fork to recover funds from The DAO hack.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
Show source code (Solidity)
contract HugCoin {
string public name = 'HugCoin';
string standard = 'HugCoin 0.2';
string public symbol = '<3';
uint8 decimals = 0;
address owner;
uint8 constant a_hug = 1;
uint public totalHuggers = 0;
Member[] public hugged;
mapping (address => uint256) public balanceOf;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
struct Member {
address member;
string name;
uint memberSince;
}
modifier isOwner {
if (msg.sender != owner) throw;
_
}
function HugCoin(string sym) {
symbol = sym;
owner = msg.sender;
giveHugTo("Jon V", msg.sender);
msg.sender.send(msg.value);
}
function transfer(address _to, uint256 _value) returns (bool success) {
balanceOf[_to] += a_hug;
totalHuggers += 1;
Transfer(msg.sender, _to, a_hug);
return true;
}
function giveHugTo(string receipient_name, address _to) returns (bool success){
if (balanceOf[_to] == 0) {
hugged[hugged.length++] = Member({member: _to, name:receipient_name, memberSince: now});
balanceOf[_to] = a_hug;
totalHuggers += 1;
}
else {
balanceOf[_to] += a_hug;
}
Transfer(msg.sender, _to, a_hug);
return true;
}
function destroy() isOwner {
suicide(owner);
}
function () {
throw;
}
}