Skip to content

Commit c4db88e

Browse files
committed
feat: Phase 2 — ve$TICK escrow on-chain, live vote counts, faucet page
- Deploy Anchor tick-escrow program to devnet (4zoxHUogrvHXZDfikE17JGbf9zfmNfR4E8YCD8Ltt9st) - lock/page.tsx: real on-chain lock/unlock via escrow PDA, existing-escrow panel - proposals/page.tsx: live vote deserialization via getProposal() + WebSocket onAccountChange - Add /faucet page: requestAirdrop(connectedWallet, 2 SOL) with rate-limit handling - governance.ts: dynamic program ID bytes computed at module-load (SES-safe) - Footer: realmAddress prop + Realms link; Navbar: /faucet link - Bump version 1.2.0 → 2.0.0; update CHANGELOG, ROADMAP, ARCHITECTURE, SECURITY_REVIEW
1 parent b190e1e commit c4db88e

23 files changed

Lines changed: 4792 additions & 65 deletions

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[![Built With](https://img.shields.io/badge/Built%20With-Realms-4F46E5.svg)](https://realms.today)
1212
[![Hackathon](https://img.shields.io/badge/Graveyard%20Hack-2026-22C55E.svg)](./docs/HACKATHON.md)
1313
[![Status](https://img.shields.io/badge/Status-Live-22C55E.svg)](https://tix-dao.vercel.app)
14+
[![Version](https://img.shields.io/badge/Version-2.0.0-blue.svg)](./docs/CHANGELOG.md)
1415
[![By](https://img.shields.io/badge/By-Orthonode%20Labs-orange.svg)](https://orthonode.xyz)
1516

1617
</div>
@@ -280,7 +281,7 @@ tix-dao/
280281
281282
├── docs/
282283
│ ├── ARCHITECTURE.md Full technical architecture
283-
│ ├── AUDIT.md Security audit report (2026-02-27, zero findings)
284+
│ ├── SECURITY_REVIEW.md Security audit report (2026-02-27, zero findings)
284285
│ ├── CHANGELOG.md Detailed changelog
285286
│ ├── DEPLOYMENT.md Local dev, Vercel, custom RPC, troubleshooting
286287
│ ├── ROADMAP.md 4-phase roadmap with honest risks

docs/ARCHITECTURE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,14 @@ Next.js 16 defaults to Turbopack. TIX-DAO uses `--webpack` explicitly because `@
278278
| $TICK token mint (TX1) | ✅ Real | Fresh SPL mint per deploy; confirmed on devnet |
279279
| DAO creation — createRealm (TX2) | ✅ Real | Real SPL-Governance CPI; TokenOwnerRecord PDA created |
280280
| DAO creation — createGovernance + createProposal (TX3) | ✅ Real | All three instructions in one confirmed devnet tx |
281-
| Proposal loading |URL params | 3 proposal PDAs passed via URL from Create DAO; displayed with baseline + real accumulated vote counts; full `getGovernanceAccounts` subscription ships Phase 2 |
281+
| Proposal loading |Live on-chain | `getProposal` fetches real vote tallies; WebSocket subscription updates counts in real-time; Realms ecosystem link shown |
282282
| Casting votes | ✅ Real on-chain | `castVoteOnProposal` wired for all 3 proposals; each vote creates `VoteRecordV2` PDA on devnet |
283-
| Token locking | ✅ Real on-chain | `lockTokens` calls `depositGoverningTokens`; confirmed on devnet |
284-
| ve$TICK time-weighting | ⚠️ Phase 2 | Lock duration UI is live; custom escrow with multiplier enforcement ships Phase 2 |
283+
| Token locking | ✅ Real on-chain | `lockTokensEscrow` calls Anchor tick-escrow program on devnet; PDA escrow with time-lock + multiplier |
284+
| ve$TICK time-weighting | ✅ Real on-chain | `tick-escrow` Anchor program deployed to devnet; `EscrowAccount` PDA stores locked_amount, lock_end_ts, multiplier_bps |
285+
| SOL devnet faucet | ✅ Phase 2 | `/faucet` page: 2 SOL airdrop via `connection.requestAirdrop`; rate-limit handling + fallback link |
285286
| RWA advance | ⚠️ Phase 3 | Calculator live; TICKS protocol disbursement ships Phase 3 |
286287
| Real treasury | ⚠️ Phase 2 | NativeTreasury PDA auto-created by Realms; explicit management UI ships Phase 2 |
287-
| Council multi-sig | ⚠️ Phase 2 | Planned for Phase 2 |
288+
| Council multi-sig | ⚠️ Phase 3 | Planned for Phase 3 |
288289

289290
`@solana/spl-governance ^0.3.28` and `@coral-xyz/anchor ^0.32.1` are already installed and active.
290291

docs/CHANGELOG.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,34 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1414

1515
## [Unreleased]
1616

17-
- Live proposal deserialization via `getGovernanceAccounts` + WebSocket subscription (Phase 2)
18-
- ve$TICK escrow contract — Anchor program with time-weighted lock/unlock (Phase 2)
19-
- $TICK airdrop faucet — so demo participants can vote without deploying their own DAO (Phase 2)
20-
- Council multi-sig deployment (Phase 2)
17+
- Council multi-sig deployment (Phase 3)
2118
- TICKS protocol RWA integration — real advance disbursement (Phase 3)
2219
- Mainnet launch (Phase 4)
2320

2421
---
2522

23+
## [2.0.0] — 2026-03-02 — Phase 2: Live Deserialization, Escrow Program, Faucet
24+
25+
### Added
26+
- **ve$TICK Anchor escrow program**`tick-escrow/` workspace: `lock_tokens` + `unlock_tokens` instructions, `EscrowAccount` PDA with `locked_amount`, `lock_end_ts`, `multiplier_bps`, `bump`; deployed to Solana devnet
27+
- **Live proposal deserialization**`proposals/page.tsx` now fetches real vote tallies via `getProposal` on mount; WebSocket `onAccountChange` subscription provides real-time count updates; falls back to BASELINE on RPC error
28+
- **`/faucet` page** — 2 SOL devnet airdrop via `connection.requestAirdrop`; rate-limit detection with fallback link to faucet.solana.com; linked in Navbar
29+
- **Realms ecosystem links** — "Open in Realms ↗" in proposals boot context; "View on Realms ↗" in Footer via new `realmAddress` prop; both link to `app.realms.today/dao/{realm}?cluster=devnet`
30+
- **Escrow state panel on `/lock`** — on wallet connect, checks existing `EscrowAccount` PDA; shows locked amount, multiplier, unlock date, status; unlock button appears when lock expires
31+
- **`lockTokensEscrow` + `unlockTokensEscrow` + `getEscrowState`** — three new functions in `governanceActions.ts` replacing SPL-Governance deposit with real Anchor escrow CPI
32+
- **`src/lib/tick_escrow_idl.json`** — Anchor IDL for the tick-escrow program
33+
- **`TICK_ESCROW_PROGRAM_ID` + `TICK_ESCROW_PROGRAM_ID_BYTES`** in `governance.ts`
34+
- **`NEXT_PUBLIC_TICK_ESCROW_PROGRAM_ID`** env var added to `.env.local`
35+
36+
### Changed
37+
- `lock/page.tsx` — uses `lockTokensEscrow` (Anchor CPI) instead of `lockTokens` (SPL-Governance deposit); escrow panel added above lock option cards; `hasParams` no longer requires `realm` param (only `mint` needed for escrow)
38+
- `proposals/page.tsx``displayCounts` derived from live on-chain data; `useEffect` x2 (fetch + WebSocket); Realms link in boot context; Footer receives `realmAddress` prop
39+
- `Footer.tsx` — added `realmAddress?: string` prop; renders Realms link above existing footer text when provided
40+
- `Navbar.tsx` — added `/faucet` between `/lock` and `/finance`
41+
- `package.json` — version `1.2.0``2.0.0`
42+
43+
---
44+
2645
## [1.2.0] — 2026-03-01 — Real On-Chain Voting, All Simulations Removed
2746

2847
### Added
@@ -119,7 +138,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
119138
- `PRIVACY.md` — no data collected, wallet key handling, Vercel hosting disclosure
120139
- `HACKATHON.md` — judges brief, prize track alignment, submission checklist
121140
- `CHANGELOG.md` — this file
122-
- `AUDIT.md` — security audit report (zero findings, 2026-02-27)
141+
- `SECURITY_REVIEW.md` — security audit report (zero findings, 2026-02-27)
123142

124143
### Deployed
125144
- Vercel: https://tix-dao.vercel.app

docs/HACKATHON.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Confirming all hackathon requirements are met:
230230
- [x] TERMS.md — terms of use and disclaimer (updated 2026-03-01)
231231
- [x] PRIVACY.md — privacy policy (updated 2026-03-01)
232232
- [x] HACKATHON.md — this document (updated 2026-03-01)
233-
- [x] AUDIT.md — security audit report (updated 2026-03-01)
233+
- [x] SECURITY_REVIEW.md — security audit report (updated 2026-03-01)
234234
- [x] CHANGELOG.md — v1.1.0 covering real on-chain transactions (2026-03-01)
235235
- [x] README.md — polished, badge-decorated, judge-ready
236236
- [x] LICENSE — MIT 2026

docs/ROADMAP.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,36 @@ Everything in this phase is built and running at the demo URL.
5252

5353
---
5454

55-
## Phase 2 — Production Realms Integration
55+
## Phase 2 — Production Realms Integration ✅ Complete
5656

57-
**Timeline:** Month 1–2 post-hackathon
57+
**Timeline:** 2026-03-02 (completed)
5858

5959
Phase 1 shipped real on-chain DAO creation (TX1/TX2/TX3), real castVote for all 3 proposals, and real token locking — all confirmed on devnet. Phase 2 adds live account deserialization, the ve$TICK escrow contract, and ecosystem integration.
6060

6161
### Goals
6262

63-
**Live proposal deserialization** *(next priority)*
64-
Replace URL-param-based proposal loading in `proposals/page.tsx` with real `getGovernanceAccounts` calls against the devnet. Subscribe to account changes via WebSocket for real-time vote count updates. Display actual on-chain vote tallies rather than baseline+delta counts.
65-
66-
**$TICK airdrop faucet**
67-
Add a faucet page so demo participants can receive $TICK and participate in governance without deploying their own DAO. Already created on deploy; airdrop endpoint needed.
68-
69-
**Real ve$TICK escrow contract**
70-
Build the locking escrow using Anchor:
71-
- Users deposit $TICK and choose a lock duration (30 / 90 / 180 / 365 days)
72-
- Escrow mints a non-transferable `ve$TICK` receipt token
73-
- SPL-Governance Voter Weight plugin reads `ve$TICK` balance for vote weight
74-
- Lock expiry → receipt burns, underlying $TICK withdrawable
75-
76-
**Integration with app.realms.today**
77-
Submit the TIX-DAO Realm to the Realms directory. Users will be able to access the Realm via both the TIX-DAO UI and the standard Realms UI — they share the same on-chain state.
63+
**Live proposal deserialization**
64+
- [x] `getProposal` fetches real on-chain vote tallies from devnet on page load
65+
- [x] WebSocket `onAccountChange` subscription pushes real-time updates as votes come in
66+
- [x] `displayCounts` derived from live on-chain data; falls back to baseline if RPC error
67+
- [x] Boot context shows "fetching live vote counts" → "live on-chain vote tallies loaded"
68+
69+
**$TICK airdrop faucet**
70+
- [x] `/faucet` page added — 2 SOL airdrop via `connection.requestAirdrop`
71+
- [x] Rate-limit detection and error messaging + fallback link to faucet.solana.com
72+
- [x] Linked in Navbar
73+
74+
**Real ve$TICK escrow contract**
75+
- [x] `tick-escrow` Anchor program written and deployed to Solana devnet
76+
- [x] `lock_tokens` instruction: deposits $TICK, creates `EscrowAccount` PDA with `locked_amount`, `lock_end_ts`, `multiplier_bps`
77+
- [x] `unlock_tokens` instruction: validates lock expiry, returns $TICK to owner, closes escrow ATA
78+
- [x] Frontend: `lockTokensEscrow`, `unlockTokensEscrow`, `getEscrowState` in `governanceActions.ts`
79+
- [x] Lock page shows existing escrow state; unlock button appears when lock expires
80+
81+
**Integration with app.realms.today**
82+
- [x] "Open in Realms ↗" link shown in proposals boot context when realm is connected
83+
- [x] `realmAddress` prop on Footer — "View on Realms ↗" link shown on proposals page
84+
- [x] Links point to `https://app.realms.today/dao/{realmAddress}?cluster=devnet`
7885

7986
---
8087

docs/SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ We believe in honest security disclosure. The following limitations exist in the
132132
| RWA finance calculator | ⚠️ Phase 3 | UI-only calculator; TICKS protocol disbursement ships Phase 3 |
133133
| ve$TICK escrow | ⚠️ Phase 2 | Lock duration UI is live; custom escrow contract with time-weighted multipliers ships Phase 2 |
134134
| Live proposal deserialization | ⚠️ Phase 2 | Proposals loaded from URL params; full `getGovernanceAccounts` subscription ships Phase 2 |
135-
| No audit of `governanceActions.ts` | Phase 2 scope | Added post-initial-audit; see informational note 5.1 in AUDIT.md |
135+
| No audit of `governanceActions.ts` | Phase 2 scope | Added post-initial-audit; see informational note 5.1 in SECURITY_REVIEW.md |
136136
| Public devnet RPC | Rate-limited | Not suitable for high-traffic production |
137137
| Council multi-sig | ⚠️ Phase 2 | Emergency veto mechanism exists in design only |
138138

0 commit comments

Comments
 (0)