{"eip":5005,"title":"Zodiac Modular Accounts","description":"Composable interoperable programmable accounts","authors":["Auryn Macmillan (@auryn-macmillan)","Kei Kreutler (@keikreutler)"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2022-04-14","requires":[165],"discussionsTo":"https://ethereum-magicians.org/t/eip-zodiac-a-composable-design-philosophy-for-daos/8963","repo":"ERCs","label":"ERC-5005","officialUrl":"https://eips.ethereum.org/EIPS/eip-5005","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5005.md","url":"https://eips.huatuo.xyz/eip-5005/","tldr":{"en":"Proposed standard interfaces (Zodiac) that split a smart account into an avatar that holds assets and pluggable modules, modifiers and guards that decide what it may do, so DAOs can mix and swap tools.","ja":"スマートアカウントを、資産を保持する avatar と、何ができるかを決める差し替え可能な module・modifier・guard に分割する標準インターフェース（Zodiac）の提案。DAO がツールを組み合わせたり入れ替えたりできる。","ko":"스마트 계정을 자산을 보유하는 avatar와, 무엇을 할 수 있는지 결정하는 교체 가능한 module, modifier, guard로 나누는 표준 인터페이스(Zodiac) 제안. DAO가 도구를 섞고 바꿔 쓸 수 있다.","zh":"建议的标准接口（Zodiac），把智能账户拆分为持有资产的 avatar，以及决定其能做什么的可插拔 module、modifier 和 guard，让 DAO 可以混用和更换工具。"},"tags":["dao","smart-accounts","modules","governance","safe"],"explainers":{"en":{"lang":"en","tldr":"Proposed standard interfaces (Zodiac) that split a smart account into an avatar that holds assets and pluggable modules, modifiers and guards that decide what it may do, so DAOs can mix and swap tools.","tags":["dao","smart-accounts","modules","governance","safe"],"related":[165,7579,6900,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5005/","markdown":"## What problem does it solve?\n\nMost DAO frameworks and programmable accounts are monolithic: the contract holding the treasury is tightly coupled to one way of authorising transactions (a particular voting system, a multisig, and so on). Switching tools means migrating everything, which locks projects in.\n\nEIP-5005 (the \"Zodiac\" design) separates **what holds the assets** from **who can make it act**. That lets a DAO run several control mechanisms side by side, swap them later, govern across chains, or decentralise step by step.\n\n## How it works\n\nFour roles:\n\n| Role | What it is | Interface |\n| --- | --- | --- |\n| **Avatar** | The account itself: holds funds, owns contracts, executes transactions | `IAvatar` |\n| **Module** | A contract the avatar has enabled that can ask it to execute transactions (e.g. a voting or bridge module) | any |\n| **Modifier** | Sits between a module and the avatar and changes behaviour, e.g. adds a delay or limits scope | `IAvatar` |\n| **Guard** | Runs checks before and after each transaction a module or modifier executes | `IGuard` |\n\nKey `IAvatar` functions:\n\n- `enableModule(module)` / `disableModule(prevModule, module)`: only the avatar itself can call these. Modules are kept as a linked list, hence `prevModule`.\n- `execTransactionFromModule(to, value, data, operation)`: callable only by an enabled module. `operation` is `Call` or `DelegateCall`.\n- `isModuleEnabled`, `getModulesPaginated` for discovery.\n\nGuardable contracts store a `guard` address. Before execution they call `checkTransaction(...)`, and afterwards `checkAfterExecution(txHash, success)`. `setGuard` checks with [ERC-165](/eip-165/) that the guard really implements `IGuard`.\n\nThe interfaces were designed to match the most popular programmable accounts in use at the time (Safe's module interface has the same shape), so existing tooling needs few changes.\n\n## Sample code\n\nA minimal module that lets one address pay out from the avatar:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nenum Operation { Call, DelegateCall }\n\ninterface IAvatar {\n    function execTransactionFromModule(address to, uint256 value, bytes calldata data, Operation op)\n        external returns (bool success);\n}\n\ncontract PayoutModule {\n    IAvatar public immutable avatar;\n    address public immutable treasurer;\n\n    constructor(IAvatar _avatar, address _treasurer) {\n        avatar = _avatar;\n        treasurer = _treasurer;\n    }\n\n    function pay(address to, uint256 amount) external {\n        require(msg.sender == treasurer, \"not treasurer\");\n        bool ok = avatar.execTransactionFromModule(to, amount, \"\", Operation.Call);\n        require(ok, \"payout failed\");\n    }\n}\n```\n\nThe avatar must first call `enableModule(address(payoutModule))`, usually through its own governance.\n\n## Things to know\n\n- Status: **Stagnant** as an ERC, even though the module pattern itself is widely used around Safe accounts.\n- **Modules have absolute control** over the avatar. Only enable a module you would trust with the avatar's entire balance; a `DelegateCall` from a module can rewrite the avatar's storage.\n- Several modules acting at once can race each other.\n- Nothing stops you from disabling every module that controls an avatar. Do that and the avatar stops working and its funds are stuck.\n- Newer modular account standards for [ERC-4337](/eip-4337/) wallets include [ERC-7579](/eip-7579/) and [ERC-6900](/eip-6900/) (both drafts).\n"},"ja":{"lang":"ja","tldr":"スマートアカウントを、資産を保持する avatar と、何ができるかを決める差し替え可能な module・modifier・guard に分割する標準インターフェース（Zodiac）の提案。DAO がツールを組み合わせたり入れ替えたりできる。","tags":["dao","smart-accounts","modules","governance","safe"],"related":[165,7579,6900,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5005/","markdown":"## 何を解決するのか\n\nほとんどの DAO フレームワークやプログラマブルなアカウントはモノリシックです。トレジャリーを保持するコントラクトが、トランザクションを承認する特定の方法（特定の投票システム、マルチシグなど）と密に結合しています。ツールを切り替えるにはすべてを移行する必要があり、プロジェクトはロックインされます。\n\nEIP-5005（「Zodiac」設計）は、**資産を保持するもの**と**それを動かせる主体**を分離します。これにより DAO は複数の制御メカニズムを並行して運用し、後で入れ替え、チェーンをまたいでガバナンスを行い、段階的に分散化できます。\n\n## 仕組み\n\n4 つの役割があります。\n\n| 役割 | 内容 | インターフェース |\n| --- | --- | --- |\n| **Avatar** | アカウント本体。資金を保持し、コントラクトを所有し、トランザクションを実行する | `IAvatar` |\n| **Module** | avatar が有効化したコントラクトで、avatar にトランザクションの実行を依頼できる（例: 投票やブリッジの module） | 任意 |\n| **Modifier** | module と avatar の間に入り、挙動を変える。たとえば遅延を加えたり、範囲を制限したりする | `IAvatar` |\n| **Guard** | module や modifier が実行する各トランザクションの前後でチェックを行う | `IGuard` |\n\n`IAvatar` の主な関数:\n\n- `enableModule(module)` / `disableModule(prevModule, module)`: avatar 自身だけが呼べます。module は連結リストで保持されるため `prevModule` があります。\n- `execTransactionFromModule(to, value, data, operation)`: 有効化された module だけが呼べます。`operation` は `Call` か `DelegateCall` です。\n- 探索用の `isModuleEnabled`、`getModulesPaginated`。\n\nguard を設定できるコントラクトは `guard` アドレスを保持します。実行前に `checkTransaction(...)` を、実行後に `checkAfterExecution(txHash, success)` を呼びます。`setGuard` は [ERC-165](/eip-165/) で、その guard が本当に `IGuard` を実装しているかを確認します。\n\nインターフェースは、当時使われていた最も一般的なプログラマブルアカウントに合わせて設計されている（Safe の module インターフェースも同じ形）ため、既存のツールにはほとんど変更が要りません。\n\n## サンプルコード\n\n1 つのアドレスに avatar からの支払いを許可する最小限の module:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nenum Operation { Call, DelegateCall }\n\ninterface IAvatar {\n    function execTransactionFromModule(address to, uint256 value, bytes calldata data, Operation op)\n        external returns (bool success);\n}\n\ncontract PayoutModule {\n    IAvatar public immutable avatar;\n    address public immutable treasurer;\n\n    constructor(IAvatar _avatar, address _treasurer) {\n        avatar = _avatar;\n        treasurer = _treasurer;\n    }\n\n    function pay(address to, uint256 amount) external {\n        require(msg.sender == treasurer, \"not treasurer\");\n        bool ok = avatar.execTransactionFromModule(to, amount, \"\", Operation.Call);\n        require(ok, \"payout failed\");\n    }\n}\n```\n\navatar は事前に `enableModule(address(payoutModule))` を呼ぶ必要があります。通常は avatar 自身のガバナンスを通じて行います。\n\n## 知っておくべきこと\n\n- ステータス: ERC としては **Stagnant** ですが、module パターン自体は Safe アカウントまわりで広く使われています。\n- **module は avatar を絶対的に制御します**。avatar の残高全体を任せられると信頼できる module だけを有効化してください。module からの `DelegateCall` は avatar のストレージを書き換えられます。\n- 複数の module が同時に動くと、互いに競合することがあります。\n- avatar を制御するすべての module を無効化することを止める仕組みはありません。そうすると avatar は動かなくなり、資金は取り出せなくなります。\n- [ERC-4337](/eip-4337/) ウォレット向けの新しいモジュラーアカウント標準には [ERC-7579](/eip-7579/) と [ERC-6900](/eip-6900/)（どちらも Draft）があります。\n"},"ko":{"lang":"ko","tldr":"스마트 계정을 자산을 보유하는 avatar와, 무엇을 할 수 있는지 결정하는 교체 가능한 module, modifier, guard로 나누는 표준 인터페이스(Zodiac) 제안. DAO가 도구를 섞고 바꿔 쓸 수 있다.","tags":["dao","smart-accounts","modules","governance","safe"],"related":[165,7579,6900,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5005/","markdown":"## 어떤 문제를 해결하나요?\n\n대부분의 DAO 프레임워크와 프로그래머블 계정은 모놀리식입니다. 재무(treasury)를 보유한 컨트랙트가 트랜잭션을 승인하는 특정 방식(특정 투표 시스템, 멀티시그 등)과 강하게 결합되어 있습니다. 도구를 바꾸려면 모든 것을 이전해야 하므로 프로젝트가 종속됩니다.\n\nEIP-5005(\"Zodiac\" 설계)는 **자산을 보유하는 주체**와 **그것을 움직일 수 있는 주체**를 분리합니다. 덕분에 DAO는 여러 제어 메커니즘을 나란히 운영하고, 나중에 교체하고, 체인을 넘나들며 거버넌스를 하고, 단계적으로 탈중앙화할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n네 가지 역할이 있습니다.\n\n| 역할 | 설명 | 인터페이스 |\n| --- | --- | --- |\n| **Avatar** | 계정 자체. 자금을 보유하고, 컨트랙트를 소유하며, 트랜잭션을 실행한다 | `IAvatar` |\n| **Module** | avatar가 활성화한 컨트랙트로, avatar에 트랜잭션 실행을 요청할 수 있다(예: 투표나 브리지 module) | 제한 없음 |\n| **Modifier** | module과 avatar 사이에 놓여 동작을 바꾼다. 예를 들어 지연을 추가하거나 범위를 제한한다 | `IAvatar` |\n| **Guard** | module이나 modifier가 실행하는 각 트랜잭션 전후에 검사를 수행한다 | `IGuard` |\n\n`IAvatar`의 주요 함수:\n\n- `enableModule(module)` / `disableModule(prevModule, module)`: avatar 자신만 호출할 수 있습니다. module은 연결 리스트로 보관되므로 `prevModule`이 있습니다.\n- `execTransactionFromModule(to, value, data, operation)`: 활성화된 module만 호출할 수 있습니다. `operation`은 `Call` 또는 `DelegateCall`입니다.\n- 탐색용 `isModuleEnabled`, `getModulesPaginated`.\n\nguard를 설정할 수 있는 컨트랙트는 `guard` 주소를 저장합니다. 실행 전에 `checkTransaction(...)`을, 실행 후에 `checkAfterExecution(txHash, success)`를 호출합니다. `setGuard`는 [ERC-165](/eip-165/)로 해당 guard가 정말 `IGuard`를 구현하는지 확인합니다.\n\n인터페이스는 당시 가장 널리 쓰이던 프로그래머블 계정에 맞게 설계되었기 때문에(Safe의 module 인터페이스도 같은 형태), 기존 도구는 거의 바꿀 필요가 없습니다.\n\n## 샘플 코드\n\n한 주소가 avatar에서 대금을 지급하도록 허용하는 최소한의 module:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nenum Operation { Call, DelegateCall }\n\ninterface IAvatar {\n    function execTransactionFromModule(address to, uint256 value, bytes calldata data, Operation op)\n        external returns (bool success);\n}\n\ncontract PayoutModule {\n    IAvatar public immutable avatar;\n    address public immutable treasurer;\n\n    constructor(IAvatar _avatar, address _treasurer) {\n        avatar = _avatar;\n        treasurer = _treasurer;\n    }\n\n    function pay(address to, uint256 amount) external {\n        require(msg.sender == treasurer, \"not treasurer\");\n        bool ok = avatar.execTransactionFromModule(to, amount, \"\", Operation.Call);\n        require(ok, \"payout failed\");\n    }\n}\n```\n\navatar는 먼저 `enableModule(address(payoutModule))`을 호출해야 하며, 보통 자체 거버넌스를 통해 합니다.\n\n## 알아둘 점\n\n- 상태: ERC로서는 **Stagnant**이지만, module 패턴 자체는 Safe 계정 주변에서 널리 쓰입니다.\n- **Module은 avatar에 대한 절대적인 통제권을 가집니다**. avatar의 전체 잔액을 맡겨도 될 만큼 신뢰하는 module만 활성화하세요. module의 `DelegateCall`은 avatar의 스토리지를 덮어쓸 수 있습니다.\n- 여러 module이 동시에 동작하면 서로 경쟁 상태가 될 수 있습니다.\n- avatar를 제어하는 모든 module을 비활성화하는 것을 막는 장치는 없습니다. 그렇게 하면 avatar는 동작을 멈추고 자금은 갇힙니다.\n- [ERC-4337](/eip-4337/) 지갑을 위한 더 새로운 모듈형 계정 표준으로 [ERC-7579](/eip-7579/)와 [ERC-6900](/eip-6900/)이 있습니다(둘 다 Draft).\n"},"zh":{"lang":"zh","tldr":"建议的标准接口（Zodiac），把智能账户拆分为持有资产的 avatar，以及决定其能做什么的可插拔 module、modifier 和 guard，让 DAO 可以混用和更换工具。","tags":["dao","smart-accounts","modules","governance","safe"],"related":[165,7579,6900,4337],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5005/","markdown":"## 它解决什么问题？\n\n大多数 DAO 框架和可编程账户都是单体式的：持有金库的合约与某一种授权交易的方式（特定的投票系统、多签等）紧密耦合。更换工具意味着要迁移所有东西，这会把项目锁死。\n\nEIP-5005（\"Zodiac\"设计）把**持有资产的主体**与**谁能让它行动**分开。这样 DAO 可以并行运行多种控制机制，之后再更换，跨链治理，或者逐步去中心化。\n\n## 它如何运作\n\n四种角色：\n\n| 角色 | 说明 | 接口 |\n| --- | --- | --- |\n| **Avatar** | 账户本身：持有资金、拥有合约、执行交易 | `IAvatar` |\n| **Module** | avatar 已启用的合约，可以请求它执行交易（例如投票或跨链桥 module） | 任意 |\n| **Modifier** | 位于 module 与 avatar 之间并改变行为，例如增加延迟或限制范围 | `IAvatar` |\n| **Guard** | 在 module 或 modifier 执行的每笔交易前后运行检查 | `IGuard` |\n\n`IAvatar` 的关键函数：\n\n- `enableModule(module)` / `disableModule(prevModule, module)`：只有 avatar 自己可以调用。module 以链表形式保存，因此有 `prevModule`。\n- `execTransactionFromModule(to, value, data, operation)`：只有已启用的 module 可以调用。`operation` 为 `Call` 或 `DelegateCall`。\n- 用于发现的 `isModuleEnabled`、`getModulesPaginated`。\n\n可设置 guard 的合约会存储一个 `guard` 地址。执行前它们调用 `checkTransaction(...)`，执行后调用 `checkAfterExecution(txHash, success)`。`setGuard` 会通过 [ERC-165](/eip-165/) 检查该 guard 确实实现了 `IGuard`。\n\n这些接口是按照当时使用最广泛的可编程账户来设计的（Safe 的 module 接口形状相同），因此现有工具几乎不需要改动。\n\n## 示例代码\n\n一个最小的 module，让某个地址可以从 avatar 中支付款项：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nenum Operation { Call, DelegateCall }\n\ninterface IAvatar {\n    function execTransactionFromModule(address to, uint256 value, bytes calldata data, Operation op)\n        external returns (bool success);\n}\n\ncontract PayoutModule {\n    IAvatar public immutable avatar;\n    address public immutable treasurer;\n\n    constructor(IAvatar _avatar, address _treasurer) {\n        avatar = _avatar;\n        treasurer = _treasurer;\n    }\n\n    function pay(address to, uint256 amount) external {\n        require(msg.sender == treasurer, \"not treasurer\");\n        bool ok = avatar.execTransactionFromModule(to, amount, \"\", Operation.Call);\n        require(ok, \"payout failed\");\n    }\n}\n```\n\navatar 必须先调用 `enableModule(address(payoutModule))`，通常通过它自己的治理来完成。\n\n## 需要注意\n\n- 状态：作为 ERC 是 **Stagnant**，尽管 module 模式本身在 Safe 账户周围被广泛使用。\n- **Module 对 avatar 拥有绝对控制权**。只启用你愿意让其动用 avatar 全部余额的 module；module 发起的 `DelegateCall` 可以改写 avatar 的存储。\n- 多个 module 同时行动可能相互竞争。\n- 没有任何机制阻止你禁用控制某个 avatar 的所有 module。那样做之后，avatar 将无法工作，其资金也会被卡住。\n- 面向 [ERC-4337](/eip-4337/) 钱包的较新模块化账户标准包括 [ERC-7579](/eip-7579/) 和 [ERC-6900](/eip-6900/)（均为草案）。\n"}}}
