# Native $LILITH Token Service

Coordinates the governance and utility token launch for the Lilith platform by
planning supply, deploying contracts, minting across networks, allocating
treasury balances, scheduling emissions, enforcing governance, and recording
compliance artifacts.

## Pipeline

1. **Supply planner** – derives minted supply distribution across allocations.
2. **Deployment manager** – deploys ERC-20 contracts across configured networks.
3. **Token minter** – mints initial supply per network/contract.
4. **Treasury allocator** – routes allocations with lockups to target addresses.
5. **Emission scheduler** – builds long-term release schedule for remaining
   supply.
6. **Governance configurator** – sets quorum, timelock, and guardian policies.
7. **Compliance auditor** – validates regulatory and treasury controls.
8. **Token ledger** – records immutable launch snapshot for auditing.
9. **Analytics reporter** – publishes dashboards and telemetry for the launch.

## Usage

```ts
import { createNativeTokenService } from './service';

const service = createNativeTokenService({
  supplyPlanner,
  deploymentManager,
  tokenMinter,
  treasuryAllocator,
  emissionScheduler,
  governanceConfigurator,
  complianceAuditor,
  tokenLedger,
  analyticsReporter,
});

const launch = await service.launchToken({
  tokenName: 'Lilith Token',
  tokenSymbol: 'LILITH',
  decimals: 18,
  totalSupply: '1000000000000000000000000000',
  allocations: [
    { bucket: 'Treasury', percentage: 30, destination: '0xTreasure' },
    { bucket: 'Community', percentage: 25, destination: '0xCommunity' },
  ],
  networks: [
    {
      chainId: 137,
      networkName: 'polygon',
      deployer: '0xDeployer',
      treasuryAddress: '0xTreasure',
    },
  ],
  emissionSchedule: [
    {
      epoch: 1,
      amount: '12000000000000000000000000',
      startDateIso: '2025-01-01T00:00:00Z',
      endDateIso: '2025-12-31T23:59:59Z',
      releaseType: 'linear',
    },
  ],
  governance: {
    quorumPercentage: 12,
    votingPeriodDays: 5,
    proposalThreshold: '200000000000000000000000',
    timelockHours: 72,
    guardianMultisig: '0xGuardian',
  },
  complianceTags: ['erc20', 'kyc-required'],
});
```

## Tests

```bash
npx jest --config apps/lilith/svc-native-token/jest.config.cjs --runInBand
```
