@@ -7,17 +7,20 @@ pub enum DataKey {
77 Admin ,
88 Token ,
99 Oracle ,
10- Booking ( u64 ) , // Booking ID -> BookingRecord
11- BookingCounter , // Counter for generating unique booking IDs
10+ RegistryAddress ,
11+ Booking ( u64 ) , // Booking ID -> BookingRecord
12+ BookingCounter , // Counter for generating unique booking IDs
13+ UserBookings ( Address ) , // User Address -> Vec<u64> of booking IDs
14+ ExpertBookings ( Address ) , // Expert Address -> Vec<u64> of booking IDs
15+ IsPaused , // Circuit breaker flag
1216 // ── Indexed User Booking List ──────────────────────────────────────────
1317 // Replaces the old Vec<u64> approach with O(1) per-write composite keys.
1418 UserBooking ( Address , u32 ) , // (user, index) -> booking_id
1519 UserBookingCount ( Address ) , // user -> total count (u32)
1620 // ── Indexed Expert Booking List ────────────────────────────────────────
1721 ExpertBooking ( Address , u32 ) , // (expert, index) -> booking_id
1822 ExpertBookingCount ( Address ) , // expert -> total count (u32)
19- IsPaused , // Circuit breaker flag
20- ExpertRate ( Address ) , // Expert Address -> rate per second (i128)
23+ ExpertRate ( Address ) , // Expert Address -> rate per second (i128)
2124}
2225
2326// --- Admin ---
@@ -52,6 +55,15 @@ pub fn get_oracle(env: &Env) -> Address {
5255 env. storage ( ) . instance ( ) . get ( & DataKey :: Oracle ) . unwrap ( )
5356}
5457
58+ // --- Registry (Identity) ---
59+ pub fn set_registry_address ( env : & Env , registry : & Address ) {
60+ env. storage ( ) . instance ( ) . set ( & DataKey :: RegistryAddress , registry) ;
61+ }
62+
63+ pub fn get_registry_address ( env : & Env ) -> Option < Address > {
64+ env. storage ( ) . instance ( ) . get ( & DataKey :: RegistryAddress )
65+ }
66+
5567// --- Pause (Circuit Breaker) ---
5668pub fn set_paused ( env : & Env , paused : bool ) {
5769 env. storage ( ) . instance ( ) . set ( & DataKey :: IsPaused , & paused) ;
0 commit comments