A collection of Ethereum contracts
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
contracts
packages
tests
.gitignore
README.md

README.md

Ethereum Contracts

A collection of contracts for Ethereum

Notary (LLL)

A notary contract for Ethereum

Overview

The notary allows accounts to submit a hash which it
will add to a public record.  Along with the hash, the
notary records the sender's address and a timestamp of
when the information was received.  After submission,
the original sender can provide additional information
by setting custom properties for the entry.

Example

# Notarise a hash
"record" <id>

# Get default properties
"get" <id> "account"
"get" <id> "timestamp"

# Set custom properties
"set" <id> "my-note" "An arbitrary message"
"set" <id> "author"  "John Q. Public"

API

"record" <id>                # Notarise a hash, submitter, and timestamp
"get"    <id> <key>          # Get a property
"set"    <id> <key> <value>  # Set a property
"database" <address>         # Set the database address (Creator only)
"kill"                       # Kill the notary          (Creator only)

ObjectDB (Serpent, LLL)

An object database contract for Ethereum

Overview

In public mode, anyone can add objects to the database.
The first account to add an object becomes its owner.
Only the object's owner can modify its properties.

In private mode, only the database parent may add objects.
Thus, only they will own (and be able to modify) objects.

By default, public mode is enabled.
In either mode, any account can read object properties.

API

"add" <id>                  # Add empty object    (20-byte id)
"get" <id> <key>            # Get object property (12-byte key)
"set" <id> <key> <value>    # Set object property (32-byte value)
"config" "public" <bool>    # Configure mode      (1 for public, 0 for private)
"config" "parent" <address> # Configure parent    (Defaults to the creator)
"kill"                      # Kill the database   (Parent only)

KeyStore (Serpent, LLL)

A key-value store contract for Ethereum

API

"get" <key>                # Get a value
"set" <key> <value>        # Set a value
"kill"                     # Kill keystore (creator only)

NameReg (Serpent, LLL)

A name registration contract for Ethereum

Overview

Simply a re-implementation of the classic in Serpent and LLL.
For science!

API

"register" <name>         # Register name
<name>                    # Get address by name
<address>                 # Get name by address
"unregister"              # Unregister the caller
"kill"                    # Kill registry (creator only)

UNLICENSE

Released into the public domain with the Unlicense.
Please consider Lightness, nonviolence and the Unlicense.