---
eip: 3000
label: ERC-3000
title: Optimistic enactment governance standard
status: Stagnant
type: Standards Track
category: ERC
created: 2020-09-24
official: https://eips.ethereum.org/EIPS/eip-3000
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-3000.md
canonical: https://eips.huatuo.xyz/zh/eip-3000/
lang: zh
tldr: 一项已停滞的 ERC：定义乐观治理的接口。链下做出的决定被安排到链上，在延迟期内可被质疑或否决，若无人反对则自动执行。
tags: [governance, dao, optimistic, erc, stagnant]
---

# ERC-3000: Optimistic enactment governance standard

> Interface for scheduling, executing and challenging contract executions based on off-chain approval

**TL;DR:** 一项已停滞的 ERC：定义乐观治理的接口。链下做出的决定被安排到链上，在延迟期内可被质疑或否决，若无人反对则自动执行。

## 它解决什么问题？

链上投票既昂贵又缓慢：每个投票者都要支付 gas，而且即使没有人有异议，每个提案也都需要完整的投票。链下投票（由 Snapshot 之类的服务收集签名投票）很便宜，但其结果本身无法转移资金或调用合约。必须有人来执行它，同时还需要办法阻止这个人去执行从未获批准的事项。

ERC-3000 标准化了这种"乐观"的折中方案：任何人都可以附带押金把决定发布到链上，等待一段延迟，如果在这个窗口内无人质疑，就可以执行。争议交由可配置的**解析者（resolver）**处理。

## 它如何运作

一切都围绕 `Container` 展开，它把 `Payload` 与当前生效的 `Config` 配成一对：

- **Payload**：`nonce`、`executionTime`、`submitter`、`executor`、`Action { to, value, data }` 列表，以及链下的 `proof`（例如投票的链接或哈希）。
- **Config**：`executionDelay`、用于安排、质疑和否决的押金（`Collateral { token, amount }`）、`resolver` 地址，以及自由格式的 `rules`。

生命周期：

1. `schedule(container)` – 提交者发布载荷和押金；触发 `Scheduled`。
2. 延迟期间，任何人都可以提交抵押并调用 `challenge(container, reason)`。争议被提交给解析者；触发 `Challenged`。
3. 如果延迟结束后无人质疑，`execute(container)` 调用 `executor.exec(actions)`；触发 `Executed`。
4. 如果被质疑，`resolve(container, resolverId)` 应用解析者的裁决，仅在获批时才执行；触发 `Resolved`。
5. 可选：`veto(...)` 和 `configure(config)`（即使没有实现 `configure`，也必须触发一次初始的 `Configured` 事件）。

标准对解析者刻意保持中立。它可以是 Aragon Court 这样的主观预言机，也可以是确定性的欺诈证明系统。

## 示例代码

用 TypeScript 和 ethers v6 安排一个载荷（`queue` 是一个 ERC-3000 合约；ABI 经过精简）：

```ts
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();
```

## 需要注意

- 状态：**Stagnant**。错误/回滚原因以及若干名称被作者明确留作待定。
- 规范把 Aragon Govern 列为一种实现。在依赖任何实现之前，请先查看其当前状态。
- 安全性在很大程度上取决于解析者的选择：主观预言机依赖密码经济学激励，而确定性解析者则复杂且容易出现漏洞。
- 延迟过短或质疑押金过低，会让恶意载荷更容易在不被察觉的情况下通过；请结合你所在社区的监控能力来设置。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-3000
