Repository navigation
chore: Add authorizedThirdPartyBonders mapping - #669
Open
SidestreamCrunchyCarrot wants to merge 2 commits into
Open
SidestreamCrunchyCarrot wants to merge 2 commits into
SidestreamCrunchyCarrot wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the delegator-controlled authorization registry change.
No open issues 🎉
What changed in this PR
Adds a delegator-controlled authorization registry to BondingManager for third-party bonders. This PR records authorization preferences only; it does not change bonding enforcement.
Changes:
- Adds a private authorization mapping, a pause-guarded setter, and a public getter.
- Exposes the functions and authorization-change event through
IBondingManager, emitting events only when authorization changes. - Adds six unit tests covering pause behavior, default values, granting, revocation, redundant grants, and multiple bonders.
| File | Description |
|---|---|
test/unit/BondingManager.js |
Adds six authorization registry tests. |
contracts/bonding/IBondingManager.sol |
Declares the authorization event, setter, and getter. |
contracts/bonding/BondingManager.sol |
Implements authorization storage and access functions. |
Review effort: Balanced
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## delta #669 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 29 29
Lines 1349 1355 +6
Branches 226 227 +1
===============================================
+ Hits 1349 1355 +6
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
SidestreamSweatyPumpkin
approved these changes
Nov 19, 2026
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.
What does this pull request do? Explain your changes. (required)
A setter-only PR that adds an on-chain authorization registry to
BondingManager. It lets a delegator explicitly allow specific addresses to act as third-party bonders on their behalf.Specific updates (required)
authorizedThirdPartyBondersprivatemapping(address => mapping(address => bool))onBondingManager, keyed by delegator then authorized bonder.setThirdPartyBonderAuthorization(address _bonder, bool _authorized). Letsmsg.sender(the delegator) grant or revoke authorization for_bonder. The write and the event are guarded behind a change check, so repeating the current value is a no-op and emits nothing.isThirdPartyBonderAuthorized(address _delegator, address _bonder)getter over the private mappingThirdPartyBonderAuthorization(address indexed delegator, address indexed bonder, bool authorized)event inIBondingManager, alongside the existingRewardCallerSet.setThirdPartyBonderAuthorizationunit test block totest/unit/BondingManager.js(6 cases).How did you test each of these updates (required)
test/unit/BondingManager.js, underdescribe("setThirdPartyBonderAuthorization"):should fail if system is pausedcovering thewhenSystemNotPausedmodifier.should return false for an address that was never authorizedchecks zero-value default for an untouched pair.should authorize a third party bonderasserts that the event is emitted with(delegator, bonder, true)and that the getter then returnstrue.should revoke a previously granted authorizationauthorizes, then revokes; asserts the event fires withfalseand the getter returnsfalseshould not emit an event when authorizing an already authorized bonderasserts no event is emitted on a redundant write while state staystrueshould allow a delegator to authorize multiple bondersauthorizes two bonders, then revokes one, asserting the other is untouched. Confirms the mapping is keyed per bonderDoes this pull request close any open issues?
No.
Checklist:
yarn testpass