ERC-3000 · Stagnant · ERC · 2020-09-24
ERC-3000: Optimistic enactment governance standard
A stagnant ERC defining an interface for optimistic governance: decisions made off-chain are scheduled on-chain, can be challenged or vetoed during a delay, and execute automatically if nobody objects.
What problem does it solve?
On-chain voting is expensive and slow: every voter pays gas, and every proposal needs a full vote even when nobody disagrees. Off-chain voting (signed votes collected by a service such as Snapshot) is cheap, but its result cannot move funds or call contracts by itself. Someone has to execute it, and you need a way to stop that someone from executing something that was never approved.
ERC-3000 standardises the "optimistic" middle ground: anyone posts the decision on-chain with a deposit, it waits for a delay, and if nobody challenges it in that window it can be executed. Disputes go to a configurable resolver.
How it works
Everything revolves around a Container, which pairs a Payload with the Config in force:
- Payload:
nonce,executionTime,submitter,executor, a list ofAction { to, value, data }, and an off-chainproof(for example a link or hash of the vote). - Config:
executionDelay, deposits for scheduling, challenging and vetoing (Collateral { token, amount }), theresolveraddress, and free-formrules.
Lifecycle:
schedule(container)– submitter posts the payload and deposit; emitsScheduled.- During the delay, anyone may
challenge(container, reason), posting collateral. The dispute is raised with the resolver; emitsChallenged. - If unchallenged after the delay,
execute(container)callsexecutor.exec(actions); emitsExecuted. - If challenged,
resolve(container, resolverId)applies the resolver's ruling and executes only if approved; emitsResolved. - Optional:
veto(...)andconfigure(config)(ifconfigureis not implemented, an initialConfiguredevent must still be emitted).
The standard is deliberately neutral about the resolver. It could be a subjective oracle such as Aragon Court or a deterministic fraud-proof system.
Sample code
Scheduling a payload from TypeScript with ethers v6 (queue is an ERC-3000 contract; ABI trimmed):
import { Contract, Wallet, JsonRpcProvider } from "ethers";
const abi = [
"function schedule(((uint256 nonce,uint256 executionTime,address submitter,address executor,(address to,uint256 value,bytes data)[] actions,bytes proof) payload,(uint256 executionDelay,(address token,uint256 amount) scheduleDeposit,(address token,uint256 amount) challengeDeposit,(address token,uint256 amount) vetoDeposit,address resolver,bytes rules) config) container) returns (bytes32)",
];
const signer = new Wallet(process.env.PRIVATE_KEY!, new JsonRpcProvider(process.env.RPC_URL));
const queue = new Contract(process.env.QUEUE!, abi, signer);
const config = await loadCurrentConfig(); // your helper: must match the queue's active config
const now = Math.floor(Date.now() / 1000);
const payload = {
nonce: 1n,
executionTime: BigInt(now) + config.executionDelay,
submitter: await signer.getAddress(),
executor: process.env.EXECUTOR!,
actions: [{ to: process.env.TREASURY!, value: 0n, data: "0x" }],
proof: "0x", // e.g. encoded reference to the off-chain vote
};
await (await queue.schedule({ payload, config })).wait();
Things to know
- Status: Stagnant. Error/revert reasons and several names were explicitly left open by the authors.
- The spec lists Aragon Govern as an implementation. Check the current state of any implementation before relying on it.
- Security depends heavily on the resolver choice: a subjective oracle relies on crypto-economic incentives, while a deterministic resolver is complex and bug-prone.
- Short delays or low challenge deposits make it easier to push through a malicious payload unnoticed; set them with your community's monitoring capacity in mind.