Description
Directly setting a new admin address risks permanently locking the contract if the wrong address is provided. A two-step handover process — where the incoming admin must accept before the transfer completes — prevents accidental lockout.
Technical Context
Add pending_admin: Option<Address> to storage::instance in contracts/split/src/lib.rs. Add propose_admin_transfer(new_admin: Address) (current admin only) and accept_admin_transfer() (must be called by new_admin with require_auth). Only accept_admin_transfer writes the new admin as the active one. Emit AdminTransferProposed and AdminTransferCompleted from events.rs.
Acceptance Criteria
Description
Directly setting a new admin address risks permanently locking the contract if the wrong address is provided. A two-step handover process — where the incoming admin must accept before the transfer completes — prevents accidental lockout.
Technical Context
Add
pending_admin: Option<Address>tostorage::instanceincontracts/split/src/lib.rs. Addpropose_admin_transfer(new_admin: Address)(current admin only) andaccept_admin_transfer()(must be called bynew_adminwithrequire_auth). Onlyaccept_admin_transferwrites the new admin as the active one. EmitAdminTransferProposedandAdminTransferCompletedfromevents.rs.Acceptance Criteria
propose_admin_transferstores the pending admin and emitsAdminTransferProposedaccept_admin_transferaccept_admin_transferis calledcancel_admin_transferAdminTransferCompleted(old_admin, new_admin)event is emitted on acceptance