Back to Home

Grove

Utility
Part of The Piper Merriam Collection
0xfe9d4e5717ec...3f7d3e9effef
FrontierContract #1,844Source VerifiedEdit this contract
Deployed October 8, 2015 (10 years ago)Block 353,504

An onchain sorted index by Piper Merriam: a self-balancing tree that answers first-above and first-below queries over stored values.

Frontier EraVerified Source

Historical Significance

The Ethereum Alarm Clock answered a problem the EVM has by design: nothing on chain runs unless an account sends a transaction, so a contract cannot wake itself at a future block. Piper Merriam's answer was to pay whoever does send it. A scheduler holds the requester's deposit, anyone may execute the call once its block arrives, and the executor is reimbursed for gas plus a margin. That shape, a public bounty for executing someone else's scheduled work, backed by bonded callers who get first refusal, is the one keeper networks settled on later.

Context

The Alarm Clock was built on mainnet through the autumn of 2015, and each revision was deployed as a complete new set rather than upgraded in place, so several generations of the service sit on chain side by side. The code is Frontier Solidity: no events are emitted, the log statements are commented out, and a failed check signals an error by reading past the end of an empty array so the transaction consumes its gas and reverts.

Key Facts
Deployer
Piper Merriam(0xd3cda9...293601)
Deployment Block
353,504
Deployment Date
Oct 8, 2015, 05:36 PM
Code Size
4.0 KB
Gas at Deploy
1,107,253

Description

Grove is a general purpose ordered index for contract storage, written alongside the Ethereum Alarm Clock, which needed to find the next scheduled call after a given block. Any contract can create an index by name. The index is identified by the hash of its owner's address and that name, so two contracts choosing the same name never collide, and only the owner can write to its own index.

Entries are an id and a signed integer value, held in a self-balancing binary tree that rotates on insertion and removal. Queries take a comparison operator as a two-character string, one of ==, <, >, <= or >=, and return the id of an entry satisfying it, the nearest one to the queried value. From there the previous and next entries can be stepped through one at a time.

The contract is a library in intent rather than in the Solidity sense: it holds every caller's index in its own storage and is used by calling into it, not by linking against it.

Heuristic Analysis

The following characteristics were detected through bytecode analysis and may not be accurate.

Detected Type: Utility

Bytecode Overview

Opcodes4,117
Unique Opcodes175
Jump Instructions289
Storage Operations245

External Links

Related contracts