{"eip":5247,"title":"Smart Contract Executable Proposal Interface","description":"An interface to create and execute proposals.","authors":["Zainan Victor Zhou (@xinbenlv)"],"status":"Review","type":"Standards Track","category":"ERC","created":"2022-07-13","discussionsTo":"https://ethereum-magicians.org/t/erc-5247-executable-proposal-standard/9938","repo":"ERCs","label":"ERC-5247","officialUrl":"https://eips.ethereum.org/EIPS/eip-5247","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5247.md","url":"https://eips.huatuo.xyz/eip-5247/","tldr":{"en":"A minimal interface for onchain proposals: record a batch of contract calls (targets, values, gas limits, calldata) now and execute them later, independent of how approval or voting happens.","ja":"オンチェーン提案のための最小限のインターフェースです。コントラクト呼び出しのバッチ（ターゲット、値、ガスリミット、calldata）を今記録し、後で実行できます。承認や投票がどのように行われるかには依存しません。","ko":"온체인 제안을 위한 최소한의 인터페이스입니다. 컨트랙트 호출 묶음(대상, 값, 가스 한도, calldata)을 지금 기록해 두고 나중에 실행하며, 승인이나 투표가 어떻게 이루어지는지와는 무관합니다.","zh":"链上提案的最小接口：现在记录一批合约调用（目标地址、数值、gas 限制、calldata），以后再执行，与批准或投票如何进行无关。"},"tags":["governance","dao","proposals","execution"],"explainers":{"en":{"lang":"en","tldr":"A minimal interface for onchain proposals: record a batch of contract calls (targets, values, gas limits, calldata) now and execute them later, independent of how approval or voting happens.","tags":["governance","dao","proposals","execution"],"related":[1202],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5247/","markdown":"## What problem does it solve?\n\nOften the code you want to run is agreed on separately from when it runs. A DAO drafts a proposal, members vote, and only then is it executed. A trustee or delegate prepares a set of actions for someone else to approve. One party makes an \"offer\" as a ready-to-run transaction bundle that the other can accept by executing it.\n\nGovernance frameworks each have their own proposal format, tangled up with their voting logic. ERC-5247 pulls the **proposal** part out on its own, originally split off from the voting standard [ERC-1202](/eip-1202/), so proposals can be created, stored and executed the same way regardless of how approval works.\n\n## How it works\n\nTwo functions and two events:\n\n- `createProposal(proposalId, targets[], values[], gasLimits[], calldatas[], extraParams)` records a list of calls. Each index `i` describes one call: send `values[i]` wei with `calldatas[i]` to `targets[i]`, using up to `gasLimits[i]` gas. It returns a `registeredProposalId`, letting each implementation choose its own ID scheme. Emits `ProposalCreated`.\n- `executeProposal(proposalId, extraParams)` runs the recorded calls. Emits `ProposalExecuted`.\n- `extraParams` is free-form bytes for implementation-specific data, such as signatures or vote references.\n\nArrays let one proposal bundle any number of calls. Who may execute, and when, is left to the implementation (a vote result, a multisig, a timelock, the counterparty of an offer…).\n\n## Sample code\n\nCreating and executing a two-call proposal (ethers v6):\n\n```ts\nimport { Contract, Interface } from \"ethers\";\n\nconst nft = new Interface([\"function mint(address to, uint256 id)\"]);\nconst calls = [\n  nft.encodeFunctionData(\"mint\", [recipient, 1]),\n  nft.encodeFunctionData(\"mint\", [recipient, 2]),\n];\n\nconst registry = new Contract(registryAddress, [\n  \"function createProposal(uint256,address[],uint256[],uint256[],bytes[],bytes) returns (uint256)\",\n  \"function executeProposal(uint256,bytes)\",\n], signer);\n\nawait (await registry.createProposal(\n  0,                         // proposer-chosen id\n  [nftAddress, nftAddress],  // targets\n  [0, 0],                    // ETH values\n  [0, 0],                    // gas limits (0 = no explicit limit in this example)\n  calls,\n  \"0x\",                      // extraParams\n)).wait();\n\n// later, once approved by whatever process the registry enforces\nawait (await registry.executeProposal(0, \"0x\")).wait();\n```\n\n## Things to know\n\n- **Status: Review.** The interface may still change, and its Security Considerations section just says \"Needs discussion\".\n- The standard does not define authorisation. The reference code shown in the spec lets anyone execute and never marks a proposal as executed, so a real deployment must add access control, approval checks and replay protection.\n- That code also does not apply the `gasLimits` it stores. If you depend on per-call gas limits, check your implementation honours them.\n- Executing arbitrary calls from a contract that holds funds or privileges is exactly as powerful as it sounds; treat the executor like an admin key.\n- Mature DAO frameworks offer a similar targets/values/calldatas model; ERC-5247 standardises it as a standalone interface.\n"},"ja":{"lang":"ja","tldr":"オンチェーン提案のための最小限のインターフェースです。コントラクト呼び出しのバッチ（ターゲット、値、ガスリミット、calldata）を今記録し、後で実行できます。承認や投票がどのように行われるかには依存しません。","tags":["governance","dao","proposals","execution"],"related":[1202],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5247/","markdown":"## 何を解決するのか\n\n実行したいコードが、実行されるタイミングとは別に合意されることはよくあります。DAO が提案を起草し、メンバーが投票し、その後で初めて実行されます。受託者や代理人が、他の人が承認するためのアクション一式を準備します。一方の当事者が、実行すれば相手が受諾できる、すぐ実行できるトランザクションバンドルとして「オファー」を出します。\n\nガバナンスのフレームワークはそれぞれ独自の提案フォーマットを持ち、投票ロジックと絡み合っています。ERC-5247 は**提案**の部分だけを独立させます。もともとは投票標準の [ERC-1202](/eip-1202/) から切り出されたもので、承認の方法にかかわらず、提案を同じ方法で作成・保存・実行できるようにします。\n\n## 仕組み\n\n関数 2 つとイベント 2 つです。\n\n- `createProposal(proposalId, targets[], values[], gasLimits[], calldatas[], extraParams)` は呼び出しのリストを記録します。各インデックス `i` が 1 回の呼び出しを表し、`targets[i]` に `calldatas[i]` を付けて `values[i]` wei を、最大 `gasLimits[i]` ガスで送ります。`registeredProposalId` を返すため、各実装が独自の ID 体系を選べます。`ProposalCreated` を発行します。\n- `executeProposal(proposalId, extraParams)` は記録された呼び出しを実行します。`ProposalExecuted` を発行します。\n- `extraParams` は、署名や投票への参照など、実装固有のデータのための自由形式のバイト列です。\n\n配列により、1 つの提案に任意の数の呼び出しをまとめられます。誰がいつ実行できるかは実装に任されています（投票結果、マルチシグ、タイムロック、オファーの相手方など）。\n\n## サンプルコード\n\n2 つの呼び出しからなる提案の作成と実行（ethers v6）:\n\n```ts\nimport { Contract, Interface } from \"ethers\";\n\nconst nft = new Interface([\"function mint(address to, uint256 id)\"]);\nconst calls = [\n  nft.encodeFunctionData(\"mint\", [recipient, 1]),\n  nft.encodeFunctionData(\"mint\", [recipient, 2]),\n];\n\nconst registry = new Contract(registryAddress, [\n  \"function createProposal(uint256,address[],uint256[],uint256[],bytes[],bytes) returns (uint256)\",\n  \"function executeProposal(uint256,bytes)\",\n], signer);\n\nawait (await registry.createProposal(\n  0,                         // proposer-chosen id\n  [nftAddress, nftAddress],  // targets\n  [0, 0],                    // ETH values\n  [0, 0],                    // gas limits (0 = no explicit limit in this example)\n  calls,\n  \"0x\",                      // extraParams\n)).wait();\n\n// later, once approved by whatever process the registry enforces\nawait (await registry.executeProposal(0, \"0x\")).wait();\n```\n\n## 知っておくべきこと\n\n- **ステータス: Review。** インターフェースはまだ変わる可能性があり、Security Considerations のセクションには「Needs discussion」とだけ書かれています。\n- この標準は認可を定義していません。仕様に示されたリファレンスコードは誰でも実行でき、提案を実行済みとして記録することもないため、実際のデプロイではアクセス制御、承認チェック、リプレイ保護を追加しなければなりません。\n- そのコードは、保存した `gasLimits` を適用してもいません。呼び出しごとのガスリミットに依存する場合は、実装がそれを守っているか確認してください。\n- 資金や権限を保持するコントラクトから任意の呼び出しを実行するのは、聞こえるとおり強力です。executor は管理者キーと同じように扱ってください。\n- 成熟した DAO フレームワークも同様の targets/values/calldatas モデルを提供しています。ERC-5247 はそれを独立したインターフェースとして標準化します。\n"},"ko":{"lang":"ko","tldr":"온체인 제안을 위한 최소한의 인터페이스입니다. 컨트랙트 호출 묶음(대상, 값, 가스 한도, calldata)을 지금 기록해 두고 나중에 실행하며, 승인이나 투표가 어떻게 이루어지는지와는 무관합니다.","tags":["governance","dao","proposals","execution"],"related":[1202],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5247/","markdown":"## 어떤 문제를 해결하나요?\n\n실행하려는 코드가 실행 시점과 별개로 합의되는 경우가 많습니다. DAO가 제안을 작성하고, 구성원이 투표하고, 그다음에야 실행됩니다. 수탁자나 대리인이 다른 사람이 승인할 작업 묶음을 준비합니다. 한쪽이 \"제안(offer)\"을 바로 실행 가능한 트랜잭션 묶음으로 내놓으면, 상대방이 그것을 실행함으로써 수락합니다.\n\n거버넌스 프레임워크마다 자체 제안 형식이 있고 투표 로직과 얽혀 있습니다. ERC-5247은 **제안** 부분만 따로 떼어냅니다. 원래는 투표 표준 [ERC-1202](/eip-1202/)에서 분리된 것으로, 승인이 어떻게 이루어지든 제안을 같은 방식으로 만들고 저장하고 실행할 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n함수 두 개와 이벤트 두 개입니다.\n\n- `createProposal(proposalId, targets[], values[], gasLimits[], calldatas[], extraParams)`는 호출 목록을 기록합니다. 각 인덱스 `i`는 호출 하나를 나타내며, `targets[i]`에 `calldatas[i]`와 함께 `values[i]` wei를 최대 `gasLimits[i]` 가스로 보냅니다. `registeredProposalId`를 반환하므로 각 구현이 자체 ID 체계를 고를 수 있습니다. `ProposalCreated`를 발생시킵니다.\n- `executeProposal(proposalId, extraParams)`는 기록된 호출을 실행합니다. `ProposalExecuted`를 발생시킵니다.\n- `extraParams`는 서명이나 투표 참조 같은 구현별 데이터를 위한 자유 형식 바이트입니다.\n\n배열 덕분에 제안 하나에 원하는 수만큼의 호출을 묶을 수 있습니다. 누가 언제 실행할 수 있는지는 구현에 맡겨져 있습니다(투표 결과, 멀티시그, 타임락, 제안의 상대방 등).\n\n## 샘플 코드\n\n호출 두 개로 이루어진 제안을 만들고 실행하기(ethers v6):\n\n```ts\nimport { Contract, Interface } from \"ethers\";\n\nconst nft = new Interface([\"function mint(address to, uint256 id)\"]);\nconst calls = [\n  nft.encodeFunctionData(\"mint\", [recipient, 1]),\n  nft.encodeFunctionData(\"mint\", [recipient, 2]),\n];\n\nconst registry = new Contract(registryAddress, [\n  \"function createProposal(uint256,address[],uint256[],uint256[],bytes[],bytes) returns (uint256)\",\n  \"function executeProposal(uint256,bytes)\",\n], signer);\n\nawait (await registry.createProposal(\n  0,                         // proposer-chosen id\n  [nftAddress, nftAddress],  // targets\n  [0, 0],                    // ETH values\n  [0, 0],                    // gas limits (0 = no explicit limit in this example)\n  calls,\n  \"0x\",                      // extraParams\n)).wait();\n\n// later, once approved by whatever process the registry enforces\nawait (await registry.executeProposal(0, \"0x\")).wait();\n```\n\n## 알아둘 점\n\n- **상태: Review.** 인터페이스는 아직 바뀔 수 있으며, Security Considerations 섹션에는 \"Needs discussion\"이라고만 적혀 있습니다.\n- 이 표준은 권한 부여를 정의하지 않습니다. 명세에 나온 레퍼런스 코드는 누구나 실행할 수 있게 하고 제안을 실행됨으로 표시하지도 않으므로, 실제 배포에서는 접근 제어, 승인 확인, 리플레이 방지를 추가해야 합니다.\n- 그 코드는 저장한 `gasLimits`를 적용하지도 않습니다. 호출별 가스 한도에 의존한다면 구현이 이를 지키는지 확인하세요.\n- 자금이나 권한을 가진 컨트랙트에서 임의의 호출을 실행하는 것은 들리는 그대로 강력합니다. 실행자를 관리자 키처럼 취급하세요.\n- 성숙한 DAO 프레임워크들도 비슷한 targets/values/calldatas 모델을 제공합니다. ERC-5247은 이를 독립된 인터페이스로 표준화합니다.\n"},"zh":{"lang":"zh","tldr":"链上提案的最小接口：现在记录一批合约调用（目标地址、数值、gas 限制、calldata），以后再执行，与批准或投票如何进行无关。","tags":["governance","dao","proposals","execution"],"related":[1202],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5247/","markdown":"## 它解决什么问题？\n\n你想运行的代码，往往是在运行之前就单独商定好的。DAO 起草提案，成员投票，然后才执行。受托人或代表为他人准备一组待批准的操作。一方把\"报价\"以一份可直接运行的交易包的形式发出，另一方通过执行它来接受。\n\n治理框架各自有自己的提案格式，与投票逻辑纠缠在一起。ERC-5247 把**提案**这一部分单独抽出来，最初是从投票标准 [ERC-1202](/eip-1202/) 中拆分出来的，这样无论批准机制如何，提案都能以同样的方式创建、存储和执行。\n\n## 它如何运作\n\n两个函数和两个事件：\n\n- `createProposal(proposalId, targets[], values[], gasLimits[], calldatas[], extraParams)` 记录一个调用列表。每个索引 `i` 描述一次调用：用最多 `gasLimits[i]` 的 gas，把 `values[i]` wei 连同 `calldatas[i]` 发送到 `targets[i]`。它返回 `registeredProposalId`，让每个实现可以选择自己的 ID 方案。触发 `ProposalCreated`。\n- `executeProposal(proposalId, extraParams)` 运行已记录的调用。触发 `ProposalExecuted`。\n- `extraParams` 是自由格式的字节，用于放置实现特有的数据，例如签名或投票引用。\n\n数组让一个提案可以打包任意数量的调用。谁可以执行、何时执行，由实现决定（投票结果、多签、时间锁、报价的对手方……）。\n\n## 示例代码\n\n创建并执行一个包含两次调用的提案（ethers v6）：\n\n```ts\nimport { Contract, Interface } from \"ethers\";\n\nconst nft = new Interface([\"function mint(address to, uint256 id)\"]);\nconst calls = [\n  nft.encodeFunctionData(\"mint\", [recipient, 1]),\n  nft.encodeFunctionData(\"mint\", [recipient, 2]),\n];\n\nconst registry = new Contract(registryAddress, [\n  \"function createProposal(uint256,address[],uint256[],uint256[],bytes[],bytes) returns (uint256)\",\n  \"function executeProposal(uint256,bytes)\",\n], signer);\n\nawait (await registry.createProposal(\n  0,                         // proposer-chosen id\n  [nftAddress, nftAddress],  // targets\n  [0, 0],                    // ETH values\n  [0, 0],                    // gas limits (0 = no explicit limit in this example)\n  calls,\n  \"0x\",                      // extraParams\n)).wait();\n\n// later, once approved by whatever process the registry enforces\nawait (await registry.executeProposal(0, \"0x\")).wait();\n```\n\n## 需要注意\n\n- **状态：Review。** 接口仍可能变化，其 Security Considerations 一节只写着\"Needs discussion\"。\n- 该标准没有定义授权。规范中展示的参考代码允许任何人执行，并且从不把提案标记为已执行，因此真实部署必须添加访问控制、批准检查和重放保护。\n- 该代码也没有应用它所存储的 `gasLimits`。如果你依赖每次调用的 gas 限制，请检查你的实现是否遵守了它们。\n- 从持有资金或权限的合约中执行任意调用，威力正如听起来那样大；请像对待管理员密钥一样对待执行者。\n- 成熟的 DAO 框架也提供类似的 targets/values/calldatas 模型；ERC-5247 把它标准化为一个独立的接口。\n"}},"requiredBy":[5485]}
