From 6a4c115a27a10623aeb6b35bbe9f8de2392146e8 Mon Sep 17 00:00:00 2001 From: mikewheeleer Date: Tue, 30 Jun 2026 02:16:33 +0530 Subject: [PATCH] feat: add set/get_admin_emergency_contact entrypoint (#738) --- contracts/predictify-hybrid/src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contracts/predictify-hybrid/src/lib.rs b/contracts/predictify-hybrid/src/lib.rs index 0ded06ce..17b02abd 100644 --- a/contracts/predictify-hybrid/src/lib.rs +++ b/contracts/predictify-hybrid/src/lib.rs @@ -7379,6 +7379,21 @@ impl PredictifyHybrid { pub fn get_snapshot_envelope(env: Env) -> Result { reporting::ReportingManager::get_snapshot_envelope(&env) } + + /// Set an emergency contact address for security advisories (admin-only). + pub fn set_admin_emergency_contact(env: Env, admin: Address, contact: Address) { + admin.require_auth(); + env.storage() + .instance() + .set(&Symbol::new(&env, "emerg_contact"), &contact); + } + + /// Get the currently configured emergency contact address. + pub fn get_admin_emergency_contact(env: Env) -> Option
{ + env.storage() + .instance() + .get(&Symbol::new(&env, "emerg_contact")) + } } // ===== TESTS =====