Skip to content

Commit 18c96bd

Browse files
authored
Merge branch 'main' into feat/verifiable-and-privacy-preserving-delegated-onchain-execution
2 parents e1670dd + 25464f8 commit 18c96bd

68 files changed

Lines changed: 5014 additions & 1577 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Test and Build
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '22.12.0'
22+
23+
# Frontend Linting
24+
- name: Install frontend dependencies
25+
working-directory: packages/demo-app-frontend
26+
run: npm ci
27+
28+
- name: Run ESLint (Frontend)
29+
working-directory: packages/demo-app-frontend
30+
run: npm run lint
31+
32+
- name: Check Prettier formatting (Frontend)
33+
working-directory: packages/demo-app-frontend
34+
run: npx prettier --check .
35+
36+
# Solidity Linting
37+
- name: Install contract dependencies
38+
working-directory: packages/trust-anchor-did-ethr
39+
run: npm ci
40+
41+
- name: Run Solhint (Contracts)
42+
working-directory: packages/trust-anchor-did-ethr
43+
run: npx solhint 'contracts/**/*.sol'
44+
45+
test:
46+
name: Test
47+
needs: lint
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: '22.12.0'
58+
cache: 'npm'
59+
cache-dependency-path: packages/trust-anchor-did-ethr/package-lock.json
60+
61+
- name: Install dependencies
62+
working-directory: packages/trust-anchor-did-ethr
63+
run: npm ci
64+
65+
- name: Run Hardhat tests
66+
working-directory: packages/trust-anchor-did-ethr
67+
run: npx hardhat test
68+
69+
build:
70+
name: Build
71+
needs: test
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- name: Checkout code
76+
uses: actions/checkout@v4
77+
78+
- name: Setup Node.js
79+
uses: actions/setup-node@v4
80+
with:
81+
node-version: '22.12.0'
82+
83+
# Compile Contracts
84+
- name: Install contract dependencies
85+
working-directory: packages/trust-anchor-did-ethr
86+
run: npm ci
87+
88+
- name: Compile smart contracts
89+
working-directory: packages/trust-anchor-did-ethr
90+
run: npx hardhat compile
91+
92+
# Build Frontend
93+
- name: Install frontend dependencies
94+
working-directory: packages/demo-app-frontend
95+
run: npm ci
96+
97+
- name: Build frontend
98+
working-directory: packages/demo-app-frontend
99+
run: npm run build
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Docs Validation
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- 'docs/**'
8+
pull_request:
9+
branches: [ "main" ]
10+
paths:
11+
- 'docs/**'
12+
13+
jobs:
14+
lint-docs:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
20+
- name: Lint markdown files
21+
uses: davidanson/markdownlint-cli2-action@v15
22+
with:
23+
globs: |
24+
docs/**/*.md

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd packages/demo-app-frontend && npx lint-staged

.markdownlint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"default": true,
3+
"MD013": false,
4+
"MD033": false,
5+
"MD041": false
6+
}

AGENTS.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# AI Agent Instructions for On-Chain SSI
2+
3+
## Project Context
4+
This is an On-Chain Self-Sovereign Identity (SSI) architecture project. It enables organizations to issue and verify decentralized digital identities anchored on the blockchain using the `did:ethr` standard and CRSet (Credential Revocation Set) management.
5+
The repository is a **monorepo** containing smart contracts, frontend, and backend packages.
6+
7+
## Tech Stack & Global Rules
8+
- **Node.js**: Strict requirement of `>= 22.12.0` (Do NOT use Node 20.x due to Hardhat 3 and Vite 7 constraints).
9+
- **Package Manager**: `npm` (version `>= 10.0.0`). Do not use `yarn` or `pnpm`.
10+
- **Language**: TypeScript is used everywhere (contracts and frontend).
11+
12+
## Package-Specific Guidelines
13+
14+
### 1. Smart Contracts (`packages/trust-anchor-did-ethr`)
15+
- **Framework**: Hardhat 3 with Viem (`@nomicfoundation/hardhat-toolbox-viem`).
16+
- **Solidity Version**: `0.8.28`.
17+
- **Deployment**: We use **Hardhat Ignition** (`@nomicfoundation/hardhat-ignition`). Do not use the legacy `hardhat-deploy` plugins.
18+
- **Testing**: Tests are written using Hardhat and Viem.
19+
- **Commands**:
20+
- Compile: `npm run compile` (or `npx hardhat compile`)
21+
- Test: `npx hardhat test`
22+
- Local Node: `npx hardhat node`
23+
24+
### 2. Frontend (`packages/demo-app-frontend`)
25+
- **Framework**: React 19 + Vite 7.
26+
- **Blockchain Interaction**: `wagmi` (v3) + `viem` (v2).
27+
- **Styling**: Tailwind CSS + Vanilla CSS (`index.css`). Use modern, clean aesthetics.
28+
- **Linting/Formatting**: ESLint and Prettier are strictly enforced via Husky pre-commit hooks. Ensure code passes `npm run lint` before committing.
29+
- **Commands**:
30+
- Dev server: `npm run dev`
31+
- Build: `npm run build`
32+
33+
## Workflows
34+
35+
### Git & Code Commits
36+
- We use Husky pre-commit hooks to lint and format code automatically. Do not bypass them unless explicitly instructed.
37+
- When generating Markdown documentation, ensure compliance with `markdownlint` (we ignore MD013 / line lengths by default).
38+
39+
### Implementation Steps (For AI Agents)
40+
1. **Plan Mode**: Analyze the file structure, specifically checking the `package.json` in the respective sub-package before importing new libraries. Ask for clarification if unsure about the system architecture.
41+
2. **Build Mode**: Write clean, modular TypeScript code. Document any new smart contract functions with NatSpec comments.
42+
3. **Verification**: Always double-check your output against the specific Vite or Hardhat versions we are using.

0 commit comments

Comments
 (0)