---
eip: 5005
label: ERC-5005
title: Zodiac Modular Accounts
status: Stagnant
type: Standards Track
category: ERC
created: 2022-04-14
requires: 165
official: https://eips.ethereum.org/EIPS/eip-5005
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5005.md
canonical: https://eips.huatuo.xyz/eip-5005/
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]
---

# ERC-5005: Zodiac Modular Accounts

> Composable interoperable programmable accounts

**TL;DR:** 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.

## What problem does it solve?

Most 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.

EIP-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.

## How it works

Four roles:

| Role | What it is | Interface |
| --- | --- | --- |
| **Avatar** | The account itself: holds funds, owns contracts, executes transactions | `IAvatar` |
| **Module** | A contract the avatar has enabled that can ask it to execute transactions (e.g. a voting or bridge module) | any |
| **Modifier** | Sits between a module and the avatar and changes behaviour, e.g. adds a delay or limits scope | `IAvatar` |
| **Guard** | Runs checks before and after each transaction a module or modifier executes | `IGuard` |

Key `IAvatar` functions:

- `enableModule(module)` / `disableModule(prevModule, module)`: only the avatar itself can call these. Modules are kept as a linked list, hence `prevModule`.
- `execTransactionFromModule(to, value, data, operation)`: callable only by an enabled module. `operation` is `Call` or `DelegateCall`.
- `isModuleEnabled`, `getModulesPaginated` for discovery.

Guardable 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`.

The 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.

## Sample code

A minimal module that lets one address pay out from the avatar:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

enum Operation { Call, DelegateCall }

interface IAvatar {
    function execTransactionFromModule(address to, uint256 value, bytes calldata data, Operation op)
        external returns (bool success);
}

contract PayoutModule {
    IAvatar public immutable avatar;
    address public immutable treasurer;

    constructor(IAvatar _avatar, address _treasurer) {
        avatar = _avatar;
        treasurer = _treasurer;
    }

    function pay(address to, uint256 amount) external {
        require(msg.sender == treasurer, "not treasurer");
        bool ok = avatar.execTransactionFromModule(to, amount, "", Operation.Call);
        require(ok, "payout failed");
    }
}
```

The avatar must first call `enableModule(address(payoutModule))`, usually through its own governance.

## Things to know

- Status: **Stagnant** as an ERC, even though the module pattern itself is widely used around Safe accounts.
- **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.
- Several modules acting at once can race each other.
- Nothing stops you from disabling every module that controls an avatar. Do that and the avatar stops working and its funds are stuck.
- Newer modular account standards for [ERC-4337](/eip-4337/) wallets include [ERC-7579](/eip-7579/) and [ERC-6900](/eip-6900/) (both drafts).


---

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