ERC-3000 Optimistic governance execution standard (Optimistic enactment governance standard)

Stagnant · Other · created 2020-09-24

Defines a six-function interface that reserves off-chain-agreed decisions for a delay period during which they can be challenged, and executes them automatically on-chain if no issue arises.

Why it is needed

Without this standard, a DAO or governance contract must process every decision from scratch through on-chain voting, which is costly and slow. Conversely, if decisions are made purely through off-chain voting or consensus, there is no standardized way to reflect the outcome in a contract, forcing each project to build its own execution logic every time, with no common safeguard to prevent an incorrect or malicious proposal from being executed as-is. Without a procedure to adjudicate disputes when they arise, and the flexibility to change how adjudication works, it also becomes difficult for multiple projects to share the same standard.

What to implement

In depth

Container and Payload structure

A Container consists of two fields, Payload and Config. Payload consists of nonce, executionTime, submitter (the submitting address), executor (IERC3000Executor, the contract responsible for actual execution), actions (the array of Actions to execute), and proof (bytes, supporting evidence data). In other words, it packs 'what, when, by whom, and through which executor' into a single struct.

Action: the actual call target

Action is a struct consisting of to (target address), value (amount of ETH to send), and data (call data). Since Payload.actions is an array of Actions, a single reservation can bundle multiple calls together.

Config and Collateral: rules and collateral

Config consists of executionDelay (the execution delay duration), scheduleDeposit, challengeDeposit, and vetoDeposit (the collateral required for scheduling, challenging, and vetoing respectively), resolver (the dispute adjudicator's address), and rules (bytes, the applicable rules). Collateral is a simple struct consisting of token (the collateral token address) and amount (the quantity).

schedule and execute

schedule takes a Container, returns a containerHash, and emits a Scheduled event to register the reservation. execute MUST call Payload.executor.exec(payload.actions) once the execution delay has passed and the state has not been changed by a challenge or veto; on success it returns execResults and emits an Executed event exactly once. All standard functions MUST revert if preconditions are not met or an unexpected error occurs.

challenge and resolve

challenge takes a Container and a dispute reason, argues that the reservation is invalid under Config.rules, pulls the collateral and dispute fee from the caller, and returns a resolverId. resolve takes a Container and a resolverId, applies the arbiter's (Config.resolver) final ruling, and returns execResults; the Resolved event carries the ruling outcome (approved).

veto and configure: optional functions

veto is an optional function that takes a payloadHash and its Config to reject execution of a specific Payload. configure is also an optional function that takes a new Config and returns a configHash that applies only to Containers reserved thereafter. Even if an implementer chooses not to implement configure at all, it must still emit the initial Configured event.

Why the resolver was designed to be swappable

The authors see subjective oracle resolvers (such as dispute resolution systems like Aragon Court) as a reasonable compromise, but the standard itself was designed so that it could be swapped for a deterministic resolver like Optimism's OVM, or even hot swapped on the same live instance. To that end, some function and variable names were deliberately kept abstract so they remain compatible with future resolvers.

Standard status

This proposal (ERC-3000) is currently Stagnant, meaning it is no longer being actively discussed or advanced. An example implementation is specified in the interface and implementation of Aragon Govern.

Things to watch out for

Original ERC · ← ERCs