Matador Docs
DAO Treasury Ops

Tutorial - Real-World Integration

Setting up a DAO Grant workflow.

Tutorial: Setting up a DAO Grant Workflow

In this tutorial, we will configure a Safe (Gnosis) with the Matador module to manage a "Community Grants Program."

Goal: Allow the "Grants Committee" wallet to spend up to 10,000 USDC per month from the Main Treasury.

Prerequisites

  • A Safe (the Treasury).
  • Matador CLI.
  • Committee Address (the spender).

Budget rails reduce governance load

Once installed, committees can move quickly while the treasury stays within approved limits.

Step 1: Write the Budget Policy

budget.matador:

    permission BudgetGuard -> 1.0.0 {
        parameters: {
            token: address,
            maxAmount: uint256,
            windowStart: uint256,
            windowEnd: uint256
        }

        when: {
            calldata.token == parameters.token,
            calldata.amount <= parameters.maxAmount,
            context.timestamp >= parameters.windowStart,
            context.timestamp <= parameters.windowEnd
        }
    }

Step 2: Compile & Deploy

matador compile budget.matador --out ./out

Step 3: Configure the Safe

We use the Zodiac-compliant Matador Module for Safe.

// 1. Enable Module on Safe
await safeSdk.enableModule(MATADOR_MODULE);

// 2. Install Policy
// Authorize the Committee Address to execute this policy
await matadorModule.setPolicy(
    policyId,
    bytecode,
    COMMITTEE_ADDRESS
);

Step 4: Execute

The Committee wants to pay a grantee 500 USDC.

  1. Committee: Sends tx to Safe -> Matador Module -> execute(USDC.transfer(grantee, 500)).
  2. Matador:
    • Checks Token (USDC? Yes.)
    • Checks Budget (Spent 0 + 500 <= 10000? Yes.)
    • Approved.
  3. State Update: spent_amount becomes 500.

If they try to spend 15,000 USDC, it reverts.

Result

The DAO Main Treasury remains secure. The Committee has autonomy to move fast, but the "Blast Radius" of a mistake is capped at $10k/month.

On this page