feat: two-step admin/role transfer across all six contracts (#20) - #68
Open
malaysiaonelove wants to merge 1 commit into
Open
feat: two-step admin/role transfer across all six contracts (#20)#68malaysiaonelove wants to merge 1 commit into
malaysiaonelove wants to merge 1 commit into
Conversation
…qirox#20) Implements the propose/accept/cancel flow for every admin key and wiring address exposed by the Orivex-Contracts platform. ## Shared module - contracts/common/src/two_step.rs: new PendingTransfer struct and three shared events (TransferProposed, TransferAccepted, TransferCancelled). Soft timelock semantics per Kqirox#20 acceptance criteria. ## Per-contract additions | Contract | Roles covered | | -------------- | ------------------------------------------ | | reward-pool | Admin | | badge-nft | Admin | | stake-vault | Admin | | course-registry| Admin, RewardPoolAddress, BadgeNftAddress | | quest-engine | Admin, RewardPool, StakeVault | | governance | Admin, BadgeContractAddress | For each role we add: - propose_new_<role>(current_admin, proposed): admin-only stage 1 - accept_<role>(acceptor): only the proposed address may call - cancel_<role>(caller): caller == proposed address OR caller == current admin (typo recovery) Single-step setters (set_reward_pool_address, set_badge_nft_address, quest-engine set_*_address, etc.) are kept for the initial bootstrap. Subsequent rotations go through the two-step flow. ## Dependencies Added contracts-common to reward-pool, badge-nft, stake-vault, quest-engine, governance (course-registry already had it). ## Tests Per role, ~10 tests covering happy-path propose→accept, event emission, unauthorized-propose, wrong-acceptor panic, no-pending panics, typo recovery (admin cancel AND self cancel), random-cancel panic. ## Docs Top-level contracts/README.md plus per-contract READMEs document the new auth flow. Closes Kqirox#20
Contributor
|
@malaysiaonelove resolve conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #20
See commit b258c3d for the full description. Adds propose/accept/cancel methods for every admin key and wiring address across reward-pool, badge-nft, stake-vault, course-registry, quest-engine, and governance. New shared contracts/common::two_step module exposes PendingTransfer struct and TransferProposed/TransferAccepted/TransferCancelled events.