# Cookie jar
![](https://hackmd.io/_uploads/Sy-1Ds2xT.png)
DAO slush fund, uses v3 membership (balanceOf erc20) for allowlist, has daily withdraw limits from a Safe, and keeps short reason strings for accountability. This lowers governance overhead and increases agency of members with the need for speed
## DEMO
https://hackmd.io/@6dNOI9lFQYGC280d09lkqg/BkdVSOnxa
## use case
gas refunds
taking out the trash
content
![](https://i.imgur.com/e8fbTlz.png)
## spec notes
- Amount
- Allowlist
- Accountability
Safe module
https://github.com/safe-global/safe-modules/tree/master/allowances
Could:
- Replace Delegates with DAO token holders
- Remove mapping for allowances and reduce to timestamp for 1-day timeframes
- Set all allowances once for every member
### Cookie jar; DAO gas refundfund
* MolochV3 membership
* some threshold of erc20
* transferable could be bad
* snaphsot based or time of claim
* Members get voting share token
* Governance
* allow list management happens through DAO
* new members, ragekick members
* other random governance
* module is owned by the DAO or DAO safe it could admin functions
* things like size of cookie and time period
* Spin up the DAO; use DAO treasury
* Stretch: get Safe instance
### Zodiac Module
exec example
https://github.com/HausDAO/Baal/blob/feat/baalZodiac/contracts/Baal.sol#L570
L13 and L14 ( is Module )
https://github.com/HausDAO/Baal/blob/feat/baalZodiac/contracts/Baal.sol#L13
potential simple transfer of native token
```
exec(
multisendLibrary, // reciever address (ERC20 contract)
0, // value of transfer (cookie) or 0 if erc20
_initializationMultisendData, // 0x0 (transferFrom(from, to, amount))
Enum.Operation.DelegateCall // true
),
```
First build with native token
## Accountability
need to save short string
[poster.sol](https://github.com/onPoster/contract/blob/main/contracts/Poster.sol)
poster (signal example)
https://github.com/HausDAO/dao-app-starter-vite
poster contract address
https://github.com/HausDAO/dao-app-starter-vite/blob/8fc4e108007ae7179dae4d8c35d8e47ce90b35c8/src/legos/contract.ts#L6
tag needs to be "cookie.jar.molochV3.[address]"
????
post content is based on json schema
From Sam:
> original spec:
https://hackmd.io/Z9X2yRlhSbaurnP5FVA-LQ#v3
here are the schemas we currently support - if you are adding a new table you should pr a new schema into here
https://github.com/HausDAO/monorepo/tree/develop/libs/moloch-v3-data/src/subgraph/json-schemas
for dao database record you use 1 of 3 tags:
https://github.com/HausDAO/monorepo/blob/develop/libs/utils/src/constants/posterTags.ts#L5
>these tags help mappings figure out validation:
>- daohaus.proposal.database requires execution by baal
>- daohaus.shares.database requires a member with shares
>- daohaus.member.database requires share or loot
on the schema, indexing will fail if there isn't a daoID, table or queryType
"required": [
"daoId",
"table",
"queryType"
]
https://github.com/HausDAO/dao-app-starter-vite/blob/main/src/legos/forms.ts#L9
## Cookie dough
1. Pre-existing DAO
* V3 DAO address; add new-shaman
* Cookie Jar; with DAO for treasury management
## Contract pseudo
```
string constant TAG;
reachInJar(address DAO, string calldata reason) {
checkIf(msg.sender, block.timestamp); // shares token balance of
giveCookie(); // module exec
emit Poster(reason, TAG);
}
```
poster schema
```{
"$schema": "http://json-schema.org/schema#",
"$id": "https://raw.githubusercontent.com/HausDAO/daohaus-monorepo/develop/libs/moloch-v3-data/src/subgraph/json-schema/dao-profile.json",
"title": "Signal",
"description": "A signal message ratified by a DAO proposal",
"type": "object",
"properties": {
"daoId": {
"description": "The unique identifier and contract address for a DAO",
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"table": {
"description": "Table field on the Record entity indexed in the DAOhaus subgraph",
"type": "string",
"enum": ["signal"]
},
"queryType": {
"description": "Indicates if the Record entities indexed in the DAOhaus subgraph should be queried for latest or as a list",
"type": "string",
"enum": ["list"]
},
"title": {
"description": "Title of the signal",
"type": "string"
},
"description": {
"description": "Short description of the singal",
"type": "string"
},
"body": {
"description": "Longer text description of the singal",
"type": "string"
},
"link": {
"description": "Link to more content related to the signal",
"properties": {
"callbackUrl": { "$ref": "#/definitions/saneUrl" }
}
}
},
"required": ["daoId", "title", "description", "table", "queryType"],
"definitions": {
"saneUrl": { "format": "uri", "pattern": "^https?://" }
}
}
```
example
```
{"daoId":"0x59cd41f7d0c488d2ad95bf378eb0e1833b9a8b7f","table":"reason","queryType":"list","title":"to eat a cookie","description":"I'm easting a cookie woot"}
```
![](https://i.imgur.com/Y9vRJp5.png)