Coordinates Lilith DAO proposal lifecycles, including creation, voting, timelock queueing, and execution while enforcing compliance and notifications.
Pipeline#
- Proposal registry – persists proposals and tallies.
- Snapshot service – records snapshot block for voting power.
- Voting eligibility – validates voter weight and access.
- Vote aggregator – updates tallies per support option.
- Timelock scheduler – queues succeeded proposals for execution.
- Execution engine – submits proposal actions on-chain.
- Notification service – emits governance lifecycle notifications.
- Compliance guard – checks creation and execution policies.
Usage#
ts
import { createGovernanceService } from './service';
const service = createGovernanceService({
registry,
snapshotService,
votingEligibility,
voteAggregator,
timelockScheduler,
executionEngine,
notificationService,
complianceGuard,
lifecycleDefaults: {
votingDelaySeconds: 3600,
votingPeriodSeconds: 172800,
executionDelaySeconds: 86400,
quorumPercentage: 10,
approvalThresholdPercentage: 60,
},
});
const { proposal } = await service.createProposal({
metadata: {
title: 'Initiate Meditation Council',
summary: 'Formalize governance for sacred content curation.',
discussionUrl: 'https://dao.lilith.ai/proposals/42',
createdBy: '0xLilith',
tags: ['governance'],
},
actions: [
{
target: '0xCouncilMultisig',
signature: 'grantRole(bytes32,address)',
calldata: '0xfeedface',
description: 'Grant council role.',
},
],
lifecycleConfig: {
votingDelaySeconds: 7200,
votingPeriodSeconds: 259200,
executionDelaySeconds: 172800,
quorumPercentage: 12,
approvalThresholdPercentage: 66,
},
});
Tests#
bash
npx jest --config apps/lilith/svc-dao-governance/jest.config.cjs --runInBand