-
Notifications
You must be signed in to change notification settings - Fork 32
feat: Add two-step ownership transfer and admin events (#80) #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add two-step ownership transfer and admin events (#80) #81
Conversation
📝 WalkthroughWalkthroughAdded a two-step ownership transfer flow (initiate, accept, cancel), new ownership-related errors and events, and updated admin setters to emit events. Tests covering ownership flows and admin event emissions were added. Changes
Sequence Diagram(s)sequenceDiagram
participant Owner as Owner (current)
participant Contract as Chainvoice (contract)
participant Pending as PendingOwner
Owner->>Contract: initiateOwnershipTransfer(newOwner)
activate Contract
Contract-->>Owner: OwnershipTransferInitiated event
Contract-->>Pending: pendingOwner set\n(pendingOwner = newOwner)
deactivate Contract
Pending->>Contract: acceptOwnership()
activate Contract
alt caller == pendingOwner
Contract-->>Owner: OwnershipTransferred event (previousOwner->newOwner)
Contract-->>Pending: owner updated, pendingOwner cleared
else not pending
Contract-->>Pending: revert OwnershipNotPending()
end
deactivate Contract
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
This PR hardens ownership management and improves observability of admin state changes in the
Chainvoicesmart contract.Fixes #80
Problem
Solution
pendingOwnerstate variableTechnical Details
Status
I just started contributing to StabilityNexus. Requesting review @Zahnentferner 🙏
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.