Skip to content

Add admin function to rotate fee recipient addresses#401

Open
JamesVictor-O wants to merge 2 commits into
accesslayerorg:mainfrom
JamesVictor-O:feat/rotate-fee-recipients
Open

Add admin function to rotate fee recipient addresses#401
JamesVictor-O wants to merge 2 commits into
accesslayerorg:mainfrom
JamesVictor-O:feat/rotate-fee-recipients

Conversation

@JamesVictor-O

Copy link
Copy Markdown
Contributor

Summary

Closes #395

  • Add update_protocol_fee_recipient(admin, new_recipient) — only callable by the stored protocol admin, rejects zero address, emits ProtocolFeeRecipientUpdated event
  • Add update_creator_fee_recipient(creator, caller, new_recipient) — only callable by the current fee recipient for that creator (self-rotation), rejects zero address, emits CreatorFeeRecipientUpdated event
  • Add Unauthorized error variant (discriminant 17, appended to end of enum per ABI stability rules)

Test plan

  • Protocol admin can successfully rotate the fee recipient; new address is stored
  • Non-admin call to update_protocol_fee_recipient is rejected with Unauthorized
  • Zero address is rejected with ZeroAddress
  • ProtocolFeeRecipientUpdated event emitted with correct old and new addresses
  • Creator's current fee recipient can rotate their own fee recipient
  • Non-current-recipient call to update_creator_fee_recipient is rejected with Unauthorized
  • Unregistered creator is rejected with NotRegistered
  • CreatorFeeRecipientUpdated event emitted with correct creator, old, and new addresses
  • Fee routing continues working after both protocol and creator fee recipient rotation
  • Chained rotation (A → B → C) works; original address loses rotation authority
  • All existing tests pass (no regressions)

…sses

Closes accesslayerorg#395

- Add `update_protocol_fee_recipient` callable only by stored protocol admin
- Add `update_creator_fee_recipient` callable only by current fee recipient (self-rotation)
- Both reject zero address and emit structured events
- Add `Unauthorized` error variant (discriminant 17)
- Add `ProtocolFeeRecipientUpdated` and `CreatorFeeRecipientUpdated` events
- Add comprehensive tests: successful rotation, unauthorized caller, zero address rejection, fee routing after rotation, chained rotation
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 function to rotate the protocol fee recipient address

1 participant