Skip to content

Add admin function to rotate the protocol fee recipient address #395

@Chucks1093

Description

@Chucks1093

Summary

The protocol fee recipient address is set once at initialization and currently has no way to be updated. In practice teams rotate treasury addresses for security, move to multisig wallets, or migrate to a new setup. Without an update path, the only option is to abandon and redeploy the contract. An admin-only function to rotate the fee recipient solves this safely with a clear audit trail via event emission.

Scope

  • Add update_protocol_fee_recipient(new_recipient: Address) function
    • Only callable by the current protocol admin address
    • new_recipient must not be the zero address
    • Updates the stored fee recipient in protocol config
    • Emits a ProtocolFeeRecipientUpdated { old_recipient, new_recipient } event
  • Add corresponding update for creator fee recipient: update_creator_fee_recipient(creator_id, new_recipient: Address)
    • Only callable by the current fee recipient for that creator (self-rotation)
    • Emits CreatorFeeRecipientUpdated { creator_id, old_recipient, new_recipient }

Acceptance Criteria

  • Protocol admin can update the fee recipient; new address receives fees on subsequent trades
  • Non-admin call to update_protocol_fee_recipient is rejected with Unauthorized
  • Zero address is rejected
  • ProtocolFeeRecipientUpdated event emitted with correct old and new addresses
  • Creator can rotate their own fee recipient; new address receives creator fees on next trade
  • Non-current-recipient call to update_creator_fee_recipient is rejected
  • Unit tests cover: successful rotation, unauthorized caller, zero address rejection, fee routing after rotation

Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions