Skip to content

Feature/admin role rotation#143

Merged
Cybermaxi7 merged 8 commits intoMarketXpress:mainfrom
Abrahamojobo:feature/admin-role-rotation
Mar 28, 2026
Merged

Feature/admin role rotation#143
Cybermaxi7 merged 8 commits intoMarketXpress:mainfrom
Abrahamojobo:feature/admin-role-rotation

Conversation

@Abrahamojobo
Copy link
Copy Markdown
Contributor

Closes #124

What changed

  • Storage: Added ProposedAdmin to types.rs DataKey to track pending administrative transfer requests.
  • Events: Added AdminTransferredEvent to emit a trace whenever the role is safely rotated.
  • Error Handling: Added NotProposedAdmin to errors.rs to enforce strict security checks during acceptance.
  • Implementation: Replaced statically assigned initialization-only admin logic with a robust, two-step rotation flow in lib.rs:
    • transfer_admin(new_admin): Requires the current admin's signature to securely cast a proposal.
    • accept_admin(): Requires the new admin's signature to execute the swap and clean up the proposal, eradicating the risk of locking the contract due to typographical errors.
  • Testing: Added rigorous MockAuth test coverage mimicking Soroban SDK v25 security traps to guarantee unauthorized proposals or acceptances fail organically.

@Cybermaxi7 Cybermaxi7 merged commit 2302cbb into MarketXpress:main Mar 28, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Admin Role Rotation

3 participants