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:
import "abis/ERC20.json" as Token;
permission BudgetGuard -> 1.0.0 {
parameters: {
token: address,
maxAmount: uint256
}
fn main() -> bool {
if (context.target != parameters.token) {
return false;
}
if (context.selector == Token.transfer) {
return Token.transfer.amount == parameters.maxAmount;
}
return false;
}
}Step 2: Compile & Deploy
matador compile budget.matador --out ./outStep 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.
- Committee: Sends tx to Safe -> Matador Module ->
execute(USDC.transfer(grantee, 500)). - Matador:
- Checks Token (USDC? Yes.)
- Checks Budget (
Spent 0 + 500 <= 10000? Yes.) - Approved.
- State Update:
spent_amountbecomes 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.