Skip to content

Commit 70e10fb

Browse files
authored
Merge branch 'main' into replace_panic_with_contracterror
2 parents 0e7931b + f75c34a commit 70e10fb

209 files changed

Lines changed: 44452 additions & 6787 deletions

File tree

Some content is hidden

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

‎.claude/settings.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash",
5+
"Read",
6+
"Edit",
7+
"Write",
8+
"WebFetch",
9+
"Grep",
10+
"Glob",
11+
"LS",
12+
"MultiEdit",
13+
"NotebookRead",
14+
"NotebookEdit",
15+
"TodoRead",
16+
"TodoWrite",
17+
"WebSearch"
18+
]
19+
}
20+
}

‎.env.local.example‎

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,41 @@
66

77
# ─── Stellar contract ─────────────────────────────────────────────────────────
88

9-
# Deployed streaming contract address on Stellar.
9+
# Deployed streaming contract addresses on Stellar.
1010
#
11-
# When this is set, FlowStar talks to the live Soroban contract on testnet.
12-
# When it is empty (or this file is not copied), the app falls back to an
13-
# in-memory MOCK mode — streams are stored in memory only and reset on reload.
11+
# When a contract ID is set for the active network, FlowStar talks to the live
12+
# Soroban contract on that network. When no contract ID is configured, the app
13+
# falls back to an in-memory MOCK mode — streams are stored in memory only and
14+
# reset on reload.
1415
#
1516
# Deploy your own with `./scripts/deploy.sh --update-env` (see DEPLOYMENT.md),
1617
# or use the public testnet deployment below to get started immediately.
17-
NEXT_PUBLIC_STREAM_CONTRACT_ID=CBNDCZTRFNTDAPQLPK2ESOKO4XFMSC4PX37QE75BBYFOYIEWIPMHAKFV
18+
NEXT_PUBLIC_STREAM_CONTRACT_ID_TESTNET=CBNDCZTRFNTDAPQLPK2ESOKO4XFMSC4PX37QE75BBYFOYIEWIPMHAKFV
19+
NEXT_PUBLIC_STREAM_CONTRACT_ID_MAINNET=
20+
21+
# ─── Staging environment ──────────────────────────────────────────────────────
22+
#
23+
# Used by the staging branch / PR preview deployments (see .github/workflows/staging.yml).
24+
# Set these as GitHub Actions secrets (STAGING_CONTRACT_ID_TESTNET, VERCEL_TOKEN,
25+
# VERCEL_ORG_ID, VERCEL_PROJECT_ID) in the "staging" environment in your repo settings.
26+
#
27+
# NEXT_PUBLIC_APP_ENV is set to "staging" automatically by the CI workflow; you
28+
# can set it here to simulate a staging build locally.
29+
#
30+
# NEXT_PUBLIC_APP_ENV=staging
31+
32+
# ─── WalletConnect (LOBSTR mobile) ───────────────────────────────────────────
33+
#
34+
# Required for LOBSTR wallet connection via WalletConnect (enables mobile users).
35+
# Get a free project ID at https://cloud.walletconnect.com
36+
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
37+
38+
# ─── Error tracking (Sentry) ──────────────────────────────────────────────────
39+
# Get your DSN from https://sentry.io → Project → Client Keys.
40+
# The NEXT_PUBLIC_ prefix makes it available in the browser bundle.
41+
# Keep SENTRY_AUTH_TOKEN server-only (used for source map uploads in CI).
42+
NEXT_PUBLIC_SENTRY_DSN=
43+
SENTRY_DSN=
44+
SENTRY_ORG=
45+
SENTRY_PROJECT=
46+
SENTRY_AUTH_TOKEN=

‎.github/lighthouse-budget.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"path": "/*",
4+
"assertions": {
5+
"categories:performance": ["warn", { "minScore": 0.7 }],
6+
"categories:accessibility": ["warn", { "minScore": 0.85 }],
7+
"categories:best-practices": ["warn", { "minScore": 0.8 }],
8+
"categories:seo": ["warn", { "minScore": 0.8 }]
9+
}
10+
}
11+
]

‎.github/workflows/ci.yml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: npm
20+
21+
- run: npm install --legacy-peer-deps
22+
23+
- run: npm test
24+
25+
- run: npm run build

‎.github/workflows/contract-ci.yml‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Contract CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'contracts/**'
8+
- '.github/workflows/contract-ci.yml'
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- 'contracts/**'
13+
- '.github/workflows/contract-ci.yml'
14+
15+
jobs:
16+
contract:
17+
runs-on: ubuntu-latest
18+
defaults:
19+
run:
20+
working-directory: contracts
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install Rust
25+
uses: dtolnay/rust-toolchain@stable
26+
with:
27+
# Change this from 1.84 to 'stable' to support Edition 2024
28+
toolchain: stable
29+
targets: wasm32v1-none
30+
31+
- name: Build Contracts
32+
run: cargo build --target wasm32v1-none --release
33+
34+
- name: Test
35+
run: cargo test

‎.github/workflows/lighthouse.yml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Lighthouse CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
lighthouse:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 22
17+
cache: npm
18+
19+
- run: npm install --legacy-peer-deps
20+
21+
- run: npm run build
22+
env:
23+
NEXT_PUBLIC_STREAM_CONTRACT_ID: ${{ secrets.NEXT_PUBLIC_STREAM_CONTRACT_ID }}
24+
25+
- name: Start Next.js server
26+
run: npm run start &
27+
env:
28+
PORT: 3000
29+
30+
- name: Wait for server
31+
run: npx wait-on http://localhost:3000 --timeout 30000
32+
33+
- name: Run Lighthouse CI
34+
uses: treosh/lighthouse-ci-action@v12
35+
with:
36+
urls: |
37+
http://localhost:3000
38+
uploadArtifacts: true
39+
temporaryPublicStorage: true
40+
runs: 1
41+
budgetPath: .github/lighthouse-budget.json

‎.github/workflows/security.yml‎

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Security Scan
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
contract-audit:
9+
name: Rust / Soroban Audit
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write # Required to comment on issues
13+
pull-requests: write
14+
defaults:
15+
run:
16+
working-directory: contracts
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: dtolnay/rust-toolchain@stable
22+
with:
23+
components: clippy
24+
25+
- uses: Swatinem/rust-cache@v2
26+
with:
27+
workspaces: contracts
28+
29+
- name: clippy
30+
run: cargo clippy --all-targets -- -D warnings
31+
32+
- name: cargo audit
33+
run: |
34+
cargo install cargo-audit --locked --quiet
35+
cargo audit 2>&1 | tee /tmp/audit-output.txt
36+
exit ${PIPESTATUS[0]}
37+
38+
- name: Soroban pattern check
39+
run: node ../scripts/soroban-security-check.mjs 2>&1 | tee /tmp/soroban-output.txt
40+
41+
- name: Post contract audit summary
42+
if: always()
43+
uses: actions/github-script@v7
44+
with:
45+
script: |
46+
const fs = require('fs')
47+
const audit = fs.existsSync('/tmp/audit-output.txt')
48+
? fs.readFileSync('/tmp/audit-output.txt', 'utf8').trim()
49+
: '(no output)'
50+
const soroban = fs.existsSync('/tmp/soroban-output.txt')
51+
? fs.readFileSync('/tmp/soroban-output.txt', 'utf8').trim()
52+
: '(no output)'
53+
const body = [
54+
'## 🔐 Contract Security Scan',
55+
'',
56+
'<details><summary>cargo audit</summary>',
57+
'',
58+
'```',
59+
audit,
60+
'```',
61+
'',
62+
'</details>',
63+
'',
64+
'<details><summary>Soroban pattern check</summary>',
65+
'',
66+
'```',
67+
soroban,
68+
'```',
69+
'',
70+
'</details>',
71+
].join('\n')
72+
await github.rest.issues.createComment({
73+
owner: context.repo.owner,
74+
repo: context.repo.repo,
75+
issue_number: context.issue.number,
76+
body,
77+
})
78+
79+
frontend-audit:
80+
name: Frontend Audit
81+
runs-on: ubuntu-latest
82+
83+
steps:
84+
- uses: actions/checkout@v4
85+
86+
- uses: actions/setup-node@v4
87+
with:
88+
node-version: 22
89+
cache: npm
90+
91+
- run: npm ci
92+
93+
- name: npm audit
94+
run: npm audit --audit-level=high 2>&1 | tee /tmp/npm-audit.txt; exit ${PIPESTATUS[0]}
95+
96+
- name: ESLint security
97+
run: npm run lint 2>&1 | tee /tmp/eslint-output.txt; exit ${PIPESTATUS[0]}
98+
99+
- name: Check for hardcoded secrets
100+
run: |
101+
node scripts/check-secrets.mjs 2>&1 | tee /tmp/secrets-output.txt
102+
exit ${PIPESTATUS[0]}
103+
104+
- name: Post frontend audit summary
105+
if: always()
106+
uses: actions/github-script@v7
107+
with:
108+
script: |
109+
const fs = require('fs')
110+
const read = (p) => fs.existsSync(p) ? fs.readFileSync(p, 'utf8').trim() : '(no output)'
111+
const body = [
112+
'## 🛡️ Frontend Security Scan',
113+
'',
114+
'<details><summary>npm audit</summary>',
115+
'',
116+
'```',
117+
read('/tmp/npm-audit.txt'),
118+
'```',
119+
'',
120+
'</details>',
121+
'',
122+
'<details><summary>ESLint</summary>',
123+
'',
124+
'```',
125+
read('/tmp/eslint-output.txt'),
126+
'```',
127+
'',
128+
'</details>',
129+
'',
130+
'<details><summary>Hardcoded secrets check</summary>',
131+
'',
132+
'```',
133+
read('/tmp/secrets-output.txt'),
134+
'```',
135+
'',
136+
'</details>',
137+
].join('\n')
138+
await github.rest.issues.createComment({
139+
owner: context.repo.owner,
140+
repo: context.repo.repo,
141+
issue_number: context.issue.number,
142+
body,
143+
})

0 commit comments

Comments
 (0)