Skip to content

About

Demo Org's onchain permissions as code: a live Zodiac constellation with seven DeFi roles, three members, and weekly onchain spending limits

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Demo Org constellation

This repository is the source of truth for the onchain permissions of Demo Org's Vault Manager Safe. The whole setup is written as a Zodiac constellation: TypeScript files declare the vault, the roles, the members, and the exact protocol permissions. Pushing the repository computes a diff against the chain, the change set gets reviewed in the Zodiac App, and nothing touches the chain until the Safe signs. Enforcement happens onchain, on every call, by the Zodiac Roles Modifier.

The setup is live on Ethereum mainnet since 2026-08-05:

Contract Address
Vault Manager (Safe) 0x80328fce56374e374ca1bafc02e8cdf83a82b207
Roles Modifier v2 0x3ba888c618a2bcf903892560e2d0446d43e7c3a7

How the pieces connect

Members never hold keys to the vault. They call the Roles Modifier, the modifier checks the call against their role's permissions, and only allowed calls pass through to the Safe. The Safe owns the modifier and can revoke any role at any time.

flowchart LR
    M[Org member] -->|"execTransactionWithRole(...)"| R["Roles Modifier v2<br/>checks every call onchain"]
    R -->|allowed calls only| S["Vault Manager Safe<br/>holds the assets"]
    S -.owns, configures, revokes.-> R
    X["anything not allowed"] -. reverts .-> R
Loading

Who can do what

Three org members, seven roles, one lane per DeFi use case. Felix runs ETH staking, Mara runs lending, Max runs stables and RWA. Morpho and Lido have two members each, so no single person is a bottleneck.

flowchart LR
    subgraph Members
        felix([Felix Blume])
        mara([Mara Mustermann])
        max([Max Mustermann])
    end

    subgraph Roles
        lido[lido_staking]
        rocket[rocketpool_staking]
        aave3[aave_v3_lending]
        aave4[aave_v4_lending]
        morpho[morpho]
        sky[sky_susds]
        ondo[ondo_usdy]
    end

    subgraph Protocols
        plido["Lido<br/>stETH, wstETH, withdrawal queue"]
        procket["Rocket Pool<br/>rETH deposit, burn, swap router"]
        paave3["Aave v3 Core<br/>USDC + WBTC supply/withdraw, rewards"]
        paave4["Aave v4 Main spoke<br/>USDC + WBTC supply/withdraw"]
        pmorpho["Morpho<br/>Steakhouse USDC + WBTC vaults,<br/>USDC/WBTC Blue market, MORPHO claims"]
        psky["Sky<br/>sUSDS savings via USDS/DAI/USDC"]
        pondo["Ondo<br/>USDY via CoW swap, rUSDY wrap"]
    end

    felix --> lido & rocket & morpho
    mara --> aave3 & aave4 & morpho
    max --> lido & sky & ondo

    lido --> plido
    rocket --> procket
    aave3 --> paave3
    aave4 --> paave4
    morpho --> pmorpho
    sky --> psky
    ondo --> pondo
Loading

The roles in detail

Role Members Allows Amount limits
lido_staking Felix, Max Stake ETH for stETH, wrap/unwrap wstETH, request and claim withdrawals none
rocketpool_staking Felix Deposit ETH for rETH, burn rETH, use the swap router at capacity none
aave_v3_lending Mara Supply/withdraw USDC and WBTC on the Core market, toggle collateral, claim incentives none
aave_v4_lending Mara Supply/withdraw USDC and WBTC on the Main spoke, toggle collateral 100,000 USDC and 2 WBTC per week
morpho Mara, Felix Deposit in Steakhouse USDC/WBTC vaults, supply/borrow the USDC/WBTC Blue market, claim MORPHO rewards none
sky_susds Max Deposit USDS, DAI, or USDC into sUSDS savings and redeem none
ondo_usdy Max Swap USDC to USDY and back on CoW Protocol, wrap USDY into rUSDY and unwrap 50,000 USDY wrapped per week

Spending limits refill onchain

The three limits are Roles allowances: onchain quotas that permissions consume and that refill weekly, with no roll-over. They live in constellation/allowances/index.ts and the contract enforces them per call.

Safety properties

  • Withdrawals only return to the vault. Every receiver and onBehalf parameter is pinned to the Safe. On Aave v4, withdraw pays msg.sender by construction, and the caller is the Safe.
  • Approvals are pinned to specific spenders. No role can approve tokens to an arbitrary address.
  • Everything else reverts. The Roles Modifier checks calldata onchain. A member who tries a transfer, a different protocol, or a different function gets a ConditionViolation revert.
  • The Safe stays in charge. It owns the modifier, signs every permission change, and one transaction revokes a member.

Design notes

  • Aave v4 has no DeFi Kit preset yet, so aave_v4_lending is authored by hand against the Main spoke (reserve 7 is USDC, reserve 3 is WBTC, read onchain). The spoke pulls tokens with transferFrom(msg.sender -> hub), so token approvals target the spoke and nothing else.
  • Ondo's primary mint/redeem is KYC gated, so USDY exposure runs through the secondary market: CoW swaps with pinned token lists, plus the permissionless rUSDY wrapper, metered weekly.
  • Morpho Midnight is out of scope for now: it launched on Base only, and this constellation lives on Ethereum mainnet.
  • Everything else uses tested DeFi Kit presets, which pin recipients to the vault by default.

Repository layout

constellation/
  index.ts               # the node graph: the vault + one Roles Modifier
  context.ts             # shared constellation instance
  allowances/            # weekly spending limits
  roles/<role>/
    index.ts             # combines members + permissions
    members.ts           # who holds the role
    permissions.ts       # what the role can call
zodiac.config.ts         # contracts the typed allow kit knows about
abis/                    # contract ABIs (see note below)

How changes ship

edit files  ->  bun push  ->  review the diff in the Zodiac App  ->  the Safe signs

A permission change is a pull request here first: reviewable TypeScript, not calldata. bun push sends the declared state to Zodiac, which computes the calls against the current chain state. The review shows exactly what changes before anyone signs.

Run it yourself

git clone https://github.com/jomoormann/zodiac-demo-constellation.git
cd zodiac-demo-constellation
bun install
bun pull        # authorizes against your own Zodiac OS workspace

Start from the constellation template for a fresh setup, and see the developer docs for the full model.

Notes for reproducers

  • Some ABIs in abis/ are placed by hand: block explorers return the proxy ABI for proxy contracts (USDC, the Aave v4 spoke, USDY, rUSDY), so the files carry the implementation ABIs instead. pull-contracts keeps hand-placed files.
  • The rocket_pool DeFi Kit preset reads chain state when it resolves and the package pins a single public RPC endpoint. If preset resolution hangs, that endpoint is down; an override is not supported yet.

About

Demo Org's onchain permissions as code: a live Zodiac constellation with seven DeFi roles, three members, and weekly onchain spending limits

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages