Bytecode verified via sibling
This contract shares identical runtime bytecode with StringLib (0x4f830b11...) which has been verified through compiler archaeology.
A string and bytes conversion library, deployed 2015-10-21.
Historical Significance
StringLib converts between a 32 byte word and an unsigned integer in both directions, which is the operation contracts of the period needed to build and parse packed identifiers by hand. It holds no state and has no owner. At a few hundred bytes it is one of the smaller deliberate library deployments of the era, put on chain so other contracts could link against it instead of duplicating the code.
Context
Deployed in October 2015, when contracts had no standard library and common routines were put on chain individually to be linked against.
Key Facts
Description
StringLib converts between a 32 byte word and an unsigned integer in both directions, which is the operation contracts of the period needed to build and parse packed identifiers by hand. It holds no state and has no owner. At a few hundred bytes it is one of the smaller deliberate library deployments of the era, put on chain so other contracts could link against it instead of duplicating the code.
Source Verified
Runtime + creation exact. Compiler identified from the on-chain library version stamp PUSH6 0x0105e11e10f8.
Historian Categories
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Frontier Era
The initial release of Ethereum. A bare-bones implementation for technical users.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
// String Utils v0.1
/// @title String Utils - String utility functions
/// @author Piper Merriam - <pipermerriam@gmail.com>
library StringLib {
/// @dev Converts an unsigned integert to its string representation.
/// @param v The number to be converted.
function uintToBytes(uint v) constant returns (bytes32 ret) {
if (v == 0) {
ret = '0';
}
else {
while (v > 0) {
ret = bytes32(uint(ret) / (2 ** 8));
ret |= bytes32(((v % 10) + 48) * 2 ** (8 * 31));
v /= 10;
}
}
return ret;
}
/// @dev Converts a numeric string to it's unsigned integer representation.
/// @param v The string to be converted.
function bytesToUInt(bytes32 v) constant returns (uint ret) {
if (v == 0x0) {
throw;
}
uint digit;
for (uint i = 0; i < 32; i++) {
digit = uint((uint(v) / (2 ** (8 * (31 - i)))) & 0xff);
if (digit == 0) {
break;
}
else if (digit < 48 || digit > 57) {
throw;
}
ret *= 10;
ret += (digit - 48);
}
return ret;
}
}
/// @title String Utils - String utility functions
/// @author Piper Merriam - <pipermerriam@gmail.com>
library StringUtils {
/// @dev Converts an unsigned integert to its string representation.
/// @param v The number to be converted.
function uintToBytes(uint v) constant returns (bytes32 ret) {
return StringLib.uintToBytes(v);
}
/// @dev Converts a numeric string to it's unsigned integer representation.
/// @param v The string to be converted.
function bytesToUInt(bytes32 v) constant returns (uint ret) {
return StringLib.bytesToUInt(v);
}
}External Links
Related contracts
MemberRegistry
Same deployerOwner-controlled dynamic-array member registry.
0x1f3b19...7c161aAugust 13, 2015Members
Same deployerOwner-controlled member registry with array + mapping tracking.
0xaeb2ac...a5fd37August 14, 2015MembershipRoster
Same deployerAn Ethereum Public Trust roster contract for adding, removing, and checking members.
0xf1d327...aa0455August 14, 2015KillMul
Same deployerTest/utility contract with `suicide(address)` kill switch and a `multiply2` helper.
0x3e5e1f...7c78cdAugust 14, 2015Members
Same deployerOwner-controlled member registry using sequential id + mapping storage.
0xc6810e...db4e6fAugust 14, 2015CallerPool
Same deployerThe bonded caller pool of the Ethereum Alarm Clock: callers post a bond, take turns being the designated executor, and forfeit it if they miss.
0x329219...fc3e8bSeptember 22, 2015