Skip to content

[SC] Oracle admin rotation without contract redeploy #41

Description

@Cbiux

Summary

Implement admin rotation for the score-registry oracle — extend #27 pause with transfer_admin(new_admin) so production keys can be rotated without redeploying the contract.


Background

#27 added pause/unpause. Production still needs a safe path to rotate ORACLE_SECRET_KEY / admin address when keys are compromised or team members change.


Proposed contract API

File: Contracts/score-registry/src/lib.rs

pub fn transfer_admin(env: Env, new_admin: Address) {
    let admin = /* current admin */;
    admin.require_auth();
    env.storage().instance().set(&ADMIN_KEY, &new_admin);
    // emit AdminTransferred event
}

Two-step variant (recommended):

pub fn propose_admin(env, candidate: Address)  // stores pending
pub fn accept_admin(env)                       // candidate.require_auth()

Server changes

  • Admin CLI script: scripts/rotate-oracle-admin.ts
  • Document rotation runbook in Docs/vercel-deploy.md

Acceptance criteria

  • transfer_admin or two-step flow implemented
  • Only current admin can initiate
  • Unit tests for happy path and unauthorized caller
  • Event emitted on successful rotation
  • Runbook documented (no secrets in git)
  • Pause must be active during rotation (optional safety)

Related


Out of scope

  • Multi-sig admin
  • On-chain admin timelock

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSPart of the GrantFox OSS programMaybe RewardedThis issue may receive a reward or bountyOfficial CampaignPart of an official ZCore campaignenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions