Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6153f1e
cleanup/initial
Ugo-X Jul 28, 2025
2c4f296
tailwind config cleanup
Dprof-in-tech Jul 29, 2025
9699935
file changes
Ugo-X Jul 29, 2025
062eb7e
feat: implemented layout components (#121)
Oshioke-Salaki Jul 30, 2025
37c2813
feat: swap page (#123)
Oshioke-Salaki Aug 1, 2025
a84eb06
feat: add burn/claim page (#122)
kaf-lamed-beyt Aug 3, 2025
f23cb4e
fix: fixed mismatched imports due to the recent PR (#128)
kaf-lamed-beyt Aug 3, 2025
806c7ac
Feat/lock tokens (#124)
Ayoazeez26 Aug 4, 2025
fbac532
feat: Coming soon page (#127)
YakshitAgarwal Aug 6, 2025
90faa42
coming-soon little fix
Ugo-X Aug 6, 2025
1a9ae2a
ui fixes
Ugo-X Aug 6, 2025
6a4c714
fixed build error
Ugo-X Aug 6, 2025
e074c1f
feat: add dashboard UI (#129)
kaf-lamed-beyt Aug 6, 2025
c64b9a1
Style fixes
Ugo-X Aug 6, 2025
2da780e
Feat/analytics page (#125)
icedoutskay Aug 10, 2025
80a31e2
Icedoutskay feat/analytics page (#132)
Ugo-X Aug 10, 2025
a6df082
fix: build errors (#133)
wheval Aug 12, 2025
ac9e6b0
fix: make mobile sidebar responsive across missing breakpoints (#160)
kaf-lamed-beyt Aug 14, 2025
d5fcd3a
refactor coming soon page to match Figma layout (#161)
kaf-lamed-beyt Aug 16, 2025
fa3d2d8
Revert "refactor coming soon page to match Figma layout (#161)" (#164)
Ugo-X Aug 16, 2025
5414900
chore: get sidebar updates into local and fix the layout issue (#165)
kaf-lamed-beyt Aug 17, 2025
9bf407a
fix: style inconsistencies on the dashboard (#163)
benedictfred Aug 17, 2025
824e8a3
feat: fix the swap page (#167)
JamesVictor-O Aug 18, 2025
7fc3729
Fix/analytics page (#169)
JamesVictor-O Aug 19, 2025
ca52788
Lock tokens page responsive (#162)
YakshitAgarwal Aug 19, 2025
36c7416
added the proloader to the dapp (#179)
Dprof-in-tech Aug 20, 2025
6c74fa9
governance
Ugo-X Aug 21, 2025
98d28bf
Add skeleton/shimmer states to the Swap page using mocked loading (#196)
Jayrodri088 Aug 21, 2025
5ab08ff
Fix-185 Add Mock Loading Skeletons – Claim/Burn (#207)
FreddyJ23 Aug 21, 2025
e91bac9
fix conflict error (#203)
raymondjoseph02 Aug 21, 2025
c0ff772
Fix-184: Add Mock Loading Skeletons – Dashboard (#208)
Sirvincee Aug 21, 2025
95b389f
feat: add internationalization support with i18next (#198)
martinvibes Aug 22, 2025
66dd0b8
add Mock Loading Skeletons – Lock Tokens #187 (#210)
CodexpathCommunity Aug 22, 2025
1e19b4a
support
Ugo-X Aug 22, 2025
c40f0f1
fix (#221)
Damigurl Aug 22, 2025
5d42aa5
Error pages upstream (#222)
respp Aug 23, 2025
22815b4
Added VotingProposals page in dapp/governance (#224)
Stealth-cloud-droid Aug 24, 2025
fa99abd
feat(ui): implemented the community-card component in the support fol…
jettechnologies Aug 24, 2025
753fd0b
feat: add NextAuth integration with Ethereum credentials provider (#181)
pushkarm029 Aug 24, 2025
61592af
Feat/design (#229)
best2025j Aug 24, 2025
d24ff5e
ANALYTICS PAGE (#234)
Henrichy Aug 25, 2025
0d154a0
feat: add Delegates component to governance page (#236)
FabianSanchezD Aug 26, 2025
d9afffb
feat: create helper for message signing (#233)
kabugatti Aug 26, 2025
9df2d0e
feat: implement Contact Us form (PC baseline) #230 (#239)
Sendi0011 Aug 26, 2025
c92383a
integrate registerUser flow for Starknet pubkey registration via Ethe…
tusharshah21 Aug 27, 2025
8c7f423
Fix issue 215 (#243)
tatianaborda Aug 27, 2025
a38ef3a
feat: add faqscard(215) (#246)
TheOphige Sep 3, 2025
e25b433
feat: make contact us page responsive across all breakpoints
Sendi0011 Sep 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions app/ThemeContext.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions app/about/page.tsx

This file was deleted.

165 changes: 165 additions & 0 deletions app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
import NextAuth from "next-auth";
import CredentialsProvider from "next-auth/providers/credentials";
import { ethers } from "ethers";
import { SiweMessage } from "siwe";

const handler = NextAuth({
providers: [
CredentialsProvider({
id: "ethereum",
name: "Ethereum",
credentials: {
address: { label: "Address", type: "text" },
signature: { label: "Signature", type: "text" },
message: { label: "Message (SIWE)", type: "text" },
nonce: { label: "Nonce", type: "text" },
},
async authorize(credentials, req) {
if (
!credentials?.address ||
!credentials?.signature ||
!credentials?.message ||
!credentials?.nonce
) {
return null;
}

try {
// Check if the address is an Ethereum address
const isEthAddress =
credentials.address.startsWith("0x") &&
credentials.address.length === 42;

// Check if the address is a Starknet address (starts with 0x and is 64 or 66 chars)
const isStarknetAddress =
credentials.address.startsWith("0x") &&
(credentials.address.length === 66 ||
credentials.address.length === 64);

if (isEthAddress) {
// Process Ethereum wallet authentication

// Input validation guards
// 1. Verify credentials.address is a valid EVM address
if (!ethers.isAddress(credentials.address)) {
console.error("Invalid EVM address format");
return null;
}

// 2. Ensure credentials.signature is a 65-byte hex string (0x-prefixed, 132 characters)
const signatureRegex = /^0x[a-fA-F0-9]{130}$/;
if (!signatureRegex.test(credentials.signature)) {
console.error(
"Invalid signature format - must be 65-byte hex string"
);
return null;
}

// 3. Enforce sane credentials.message length limit (max 1024 chars)
if (credentials.message.length > 1024) {
console.error("Message too long - exceeds 1024 character limit");
return null;
}

// Parse and verify SIWE message
const siwe = new SiweMessage(credentials.message);
const domain = new URL(
process.env.NEXTAUTH_URL ?? req.headers?.origin ?? ""
).host;

// Check message timing to prevent replay attacks
const now = new Date();
if (siwe.expirationTime && new Date(siwe.expirationTime) < now) {
console.error("SIWE message has expired");
return null;
}
if (siwe.issuedAt) {
const issuedAt = new Date(siwe.issuedAt);
const maxAge = 5 * 60 * 1000; // 5 minutes
if (now.getTime() - issuedAt.getTime() > maxAge) {
console.error("SIWE message is too old");
return null;
}
}

// Validate the signature and message fields
await siwe.verify({
signature: credentials.signature,
domain,
time: new Date().toISOString(),
});

// Compare recovered address with the provided one (canonicalize)
const recovered = ethers.getAddress(siwe.address);
const provided = ethers.getAddress(credentials.address);
if (recovered !== provided) {
console.error(
"Address mismatch between SIWE message and provided address"
);
return null;
}

return {
id: recovered,
name: recovered,
address: recovered,
};
} else if (isStarknetAddress) {
// Process Starknet wallet authentication

// For Starknet, we simply verify the message contains our expected format
// and trust the signature verification done by the wallet
if (
!credentials.message.includes(
"Sign this message to authenticate with ZeroXBridge"
)
) {
console.error(
"Invalid message format for Starknet authentication"
);
return null;
}

// For now, we'll simply authenticate Starknet users by their address
// In production, you'd want to implement proper Starknet signature verification
return {
id: credentials.address,
name: credentials.address,
address: credentials.address,
};
} else {
console.error("Invalid address format - neither ETH nor Starknet");
return null;
}
} catch (error) {
console.error("Signature verification failed:", error);
return null;
}
},
}),
],
session: {
strategy: "jwt",
},
callbacks: {
async jwt({ token, user }) {
if (user) {
token.address = user.address;
}
return token;
},
async session({ session, token }) {
if (token) {
session.user.address = token.address as string;
}
return session;
},
},
pages: {
signIn: "/auth/signin",
error: "/auth/error",
},
secret: process.env.NEXTAUTH_SECRET,
});

export { handler as GET, handler as POST };
32 changes: 32 additions & 0 deletions app/api/auth/csrf/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { NextRequest } from "next/server";
import { getCsrfToken } from "next-auth/react";

export async function GET(req: NextRequest) {
const csrfToken = await getCsrfToken();

if (!csrfToken) {
return new Response(
JSON.stringify({
error: "Failed to generate CSRF token",
}),
{
status: 500,
headers: {
"Content-Type": "application/json",
},
}
);
}

return new Response(
JSON.stringify({
csrfToken,
}),
{
status: 200,
headers: {
"Content-Type": "application/json",
},
}
);
}
103 changes: 0 additions & 103 deletions app/components/Ethereum-provider.tsx

This file was deleted.

Loading