Problem
The assetsup contract sets an admin address at initialization but provides no way to transfer admin rights to a new address. If the admin key is compromised, the contract is permanently stuck with the compromised admin.
Proposed Solution
Create contracts/opsce/src/admin_transfer.rs. Implement a two-step admin transfer: the current admin proposes a new admin, and the new admin must accept.
Acceptance Criteria
Problem
The
assetsupcontract sets an admin address at initialization but provides no way to transfer admin rights to a new address. If the admin key is compromised, the contract is permanently stuck with the compromised admin.Proposed Solution
Create
contracts/opsce/src/admin_transfer.rs. Implement a two-step admin transfer: the current admin proposes a new admin, and the new admin must accept.Acceptance Criteria
propose_admin_transfer(env, new_admin)stores the pending admin (current admin only)accept_admin_transfer(env)— caller must match the pending admin stored in step 1cancel_admin_transfer(env)removes the pending admin (current admin only)get_pending_admin(env)returns the address awaiting acceptance, orNoneadmin_transfer_proposedandadmin_transfer_completedevents