update_admin

Function update_admin 

Source
pub fn update_admin<K>(env: &Env, admin_key: &K, new_admin: &Address)
where K: IntoVal<Env, Val> + TryFromVal<Env, Val> + Clone,
Expand description

Update the contract administrator

Changes the admin address to a new address. Only the current admin can call this function.

§Arguments

  • env - The Soroban environment
  • admin_key - Storage key for the admin address (e.g., DataKey::Admin)
  • new_admin - Address of the new administrator

§Panics

Panics if the caller is not the current admin