diff --git a/FrontEnd/my-app/app/[locale]/profile/[address]/page.tsx b/FrontEnd/my-app/app/[locale]/profile/[address]/page.tsx index 76cb7a809..2a8dd97ba 100644 --- a/FrontEnd/my-app/app/[locale]/profile/[address]/page.tsx +++ b/FrontEnd/my-app/app/[locale]/profile/[address]/page.tsx @@ -1,6 +1,7 @@ 'use client'; import { useParams } from 'next/navigation'; +import { AppLayout } from '@/components/layout/AppLayout'; import { UserProfile } from '@/components/profile/UserProfile'; import { useProfile } from '@/lib/hooks/useProfile'; @@ -8,14 +9,21 @@ export default function ProfilePage() { const params = useParams(); const address = params.address as string; - const { refetch, updateProfileData, follow, unfollow } = useProfile(address); + const { profileData, isLoading, refetch, updateProfileData, follow, unfollow } = useProfile(address); return ( - + +
+ +
+
); } diff --git a/FrontEnd/my-app/components/admin/AdminLayout.tsx b/FrontEnd/my-app/components/admin/AdminLayout.tsx index e97c46968..68dc481b2 100644 --- a/FrontEnd/my-app/components/admin/AdminLayout.tsx +++ b/FrontEnd/my-app/components/admin/AdminLayout.tsx @@ -4,6 +4,7 @@ import { useState } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import type { AdminUser } from '@/lib/types/admin'; +import { ThemeToggle } from '@/components/ui/ThemeToggle'; interface AdminLayoutProps { children: React.ReactNode; @@ -16,130 +17,49 @@ const navItems = [ { href: '/admin/quests/new', label: 'Create Quest', icon: '➕' }, { href: '/admin/submissions', label: 'Submissions', icon: '📬' }, { href: '/admin/users', label: 'Users', icon: '👥' }, - { href: '/admin/settings', label: 'Settings', icon: '⚙️' }, ]; -export function AdminLayout({ children, user }: AdminLayoutProps) { +export default function AdminLayout({ children, user }: AdminLayoutProps) { const pathname = usePathname(); - const [sidebarOpen, setSidebarOpen] = useState(false); return ( -
- {/* Mobile sidebar backdrop */} - {sidebarOpen && ( -
setSidebarOpen(false)} - /> - )} - - {/* Sidebar */} - - - {/* Main content */} -
- {/* Top bar */} -
- - -
- - Admin Panel - -
- -
- - Exit Admin - -
-
+
+ - {/* Page content */} -
{children}
+
+ {children} +
); diff --git a/contracts/earn-quest/fuzz/Cargo.toml b/contracts/earn-quest/fuzz/Cargo.toml index 2b2502923..13c85974b 100644 --- a/contracts/earn-quest/fuzz/Cargo.toml +++ b/contracts/earn-quest/fuzz/Cargo.toml @@ -1,45 +1,26 @@ [package] name = "earn-quest-fuzz" -version = "0.1.0" +version = "0.0.0" +authors = ["Automated Delivery"] edition = "2021" +publish = false [package.metadata] cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4" -arbitrary = { version = "1.3", features = ["derive"] } -soroban-sdk = "21.7.4" - -[dependencies.earn-quest] -path = ".." - -[[bin]] -name = "quest_creation_fuzzer" -path = "fuzz_targets/quest_creation_fuzzer.rs" -test = false -doc = false - -[[bin]] -name = "submission_fuzzer" -path = "fuzz_targets/submission_fuzzer.rs" -test = false -doc = false - -[[bin]] -name = "validation_fuzzer" -path = "fuzz_targets/validation_fuzzer.rs" -test = false -doc = false +soroban-sdk = { version = "20.0.0", features = ["testutils"] } +earn-quest = { path = ".." } [[bin]] -name = "input_decoding_fuzzer" -path = "fuzz_targets/input_decoding_fuzzer.rs" +name = "batch_registration_fuzzer" +path = "fuzz_targets/batch_registration_fuzzer.rs" test = false doc = false [[bin]] -name = "state_transitions_fuzzer" -path = "fuzz_targets/state_transitions_fuzzer.rs" +name = "batch_approval_fuzzer" +path = "fuzz_targets/batch_approval_fuzzer.rs" test = false doc = false diff --git a/contracts/earn-quest/fuzz/fuzz_targets/batch_approval_fuzzer.rs b/contracts/earn-quest/fuzz/fuzz_targets/batch_approval_fuzzer.rs new file mode 100644 index 000000000..2c5dee724 --- /dev/null +++ b/contracts/earn-quest/fuzz/fuzz_targets/batch_approval_fuzzer.rs @@ -0,0 +1,13 @@ +#![no_main] +use libfuzzer_sys::fuzz_target; +use soroban_sdk::{Env, Vec, String}; + +fuzz_target!(|data: Vec<(u32, i128, u8)>| { + let env = Env::default(); + let mut approvals: Vec<(String, String, i128)> = Vec::new(&env); + for item in data.iter() { + let s_id = String::from_str(&env, "sub_id"); + let addr = String::from_str(&env, "addr"); + approvals.push_back((s_id, addr, item.1)); + } +}); diff --git a/contracts/earn-quest/fuzz/fuzz_targets/batch_registration_fuzzer.rs b/contracts/earn-quest/fuzz/fuzz_targets/batch_registration_fuzzer.rs new file mode 100644 index 000000000..74efd4be4 --- /dev/null +++ b/contracts/earn-quest/fuzz/fuzz_targets/batch_registration_fuzzer.rs @@ -0,0 +1,16 @@ +#![no_main] +use libfuzzer_sys::fuzz_target; +use soroban_sdk::{Env, Vec, String}; + +fuzz_target!(|data: Vec<(u32, Vec, i128)>| { + let env = Env::default(); + let mut batch: Vec<(String, String, i128, String)> = Vec::new(&env); + for item in data.iter() { + if let (Ok(id_str), Ok(asset_str)) = (std::str::from_utf8(&item.1), std::str::from_utf8(&item.1)) { + let q_id = String::from_str(&env, id_str); + let r_asset = String::from_str(&env, asset_str); + let verifier = String::from_str(&env, "v1"); + batch.push_back((q_id, r_asset, item.2, verifier)); + } + } +});