Repository navigation
Feature/rebates claimer cap - #141
Merged
Merged
Conversation
Collaborator
Author
|
@claude review |
Collaborator
Author
|
/gemini review |
avernikoz
previously approved these changes
Sep 24, 2026
Update admin and unsettled-fees docs for the third capability, and add scripts to mint and rotate the claimer cap. Co-authored-by: Cursor <cursoragent@cursor.com>
avernikoz
approved these changes
Sep 24, 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.
Problem / goal
Empty
FeeManagerbag entries (makeruser_unsettled_feesand takerprotocol_unsettled_fees) can only be cleaned up today by theFeeManagerowner or by the admin multisig. At scale, that maintenance is too frequent for multisig and too operationally awkward to leave to individual users. This PR adds a delegatedRebatesClaimerCapso a designated operator can claim those storage rebates without being either party.Approach
Same pattern as
LoyaltyAdminCap: a shared object with anownerfield, not an owned capability. Unlike loyalty, it is not created ininit. Admin + initializedMultisigConfigmint it later viacreate_rebates_claimer_cap, and can mint more than one to avoid singleton plumbing.Owner transfer is admin+multisig only (
update_rebates_claimer_cap_owner), same as loyalty — the current cap owner cannot reassign it. Claimer methods wrap the existing rebate cores:claim_user_unsettled_fee_storage_rebate_claimer(maker bag)claim_protocol_unsettled_fee_storage_rebate_claimer(taker bag)Existing user and
*_adminpaths are unchanged. Auth is sender ==cap.owner; rebate SUI still goes to the tx sender.Why this way: a shared cap with an owner field matches loyalty, is discoverable, and keeps transfer under governance. An owned
key + storecap would be simpler to pass around but easier to lose/lock and inconsistent withLoyaltyAdminCap.Caveats / non-goals: multiple caps can exist by design (no on-chain singleton). Docs (
admin.md,unsettled-fees.md) are not updated in this PR.create/updatedo not check treasury version (loyalty admin ops don’t either); claimer claim paths do, same as the other rebate functions.Risk & blast radius
Low fund risk: these functions only destroy empty bag entries; non-empty still aborts. Blast radius is
fee_managerrebate cleanup only — no trading, settlement, or treasury withdrawal changes. Operational risk is minting a cap to the wrong address; governance can rotateowner. Extra shared caps are consensus objects; minting many is possible but gated by multisig.How to verify
sui move test claimer(with test-fork deps inMove.toml)FeeManagerowner / random sender cannot use the claimer pathowner; old owner can no longer claim; new owner can*_adminrebate paths still workDocs
Not updated. Behavior matches existing rebate-claim docs plus a new delegated actor;
docs/admin.mdstill says the package is managed by two caps. Follow-up should addRebatesClaimerCapthere and mention the third claimer indocs/unsettled-fees.md.