Skip to content

fix: emit admin transfer events and add multi-admin support#159

Open
stellajose wants to merge 1 commit into
Tx-wat:mainfrom
stellajose:fix/admin-transfer-event-and-multi-admin
Open

fix: emit admin transfer events and add multi-admin support#159
stellajose wants to merge 1 commit into
Tx-wat:mainfrom
stellajose:fix/admin-transfer-event-and-multi-admin

Conversation

@stellajose
Copy link
Copy Markdown

Closes #7
Closes #22

Summary

#7 — transfer_admin emits no event (both contracts)

  • alert-registry: emit ("admin","transfer") event in transfer_admin
  • watcher-registry: same event added
  • Also fixed two latent bugs in alert-registry: update_webhook and
    remove_alert referenced undefined variable owner (param is caller)
  • New tests: transfer event emitted, old admin rejected after transfer

#22 — Single-admin SPOF (watcher-registry)

  • Replaced single-admin model with Vec admin set under DataKey::Admins
  • Fixes broken split between "ADMIN"/"ADMINS" keys that silently broke after transfer
  • add_admin(caller, new_admin) — any admin can add another; idempotent
  • remove_admin(caller, target_admin) — refuses to remove last admin (LastAdmin error)
  • get_admins() returns full set; get_admin() kept for backwards compat
  • ContractError::LastAdmin = 4 added
  • ("admin","add"), ("admin","remove"), ("watcher","remove") events added
  • 10 new tests covering all multi-admin paths

Closes Tx-wat#7, closes Tx-wat#22

alert-registry:
- emit (admin, transfer) event in transfer_admin for on-chain audit trail
- fix update_webhook and remove_alert referencing undefined variable owner
- add tests for transfer event and old-admin rejection after transfer

watcher-registry:
- replace single-admin model with Vec<Address> admin set under DataKey::Admins
- fixes broken split between ADMIN and ADMINS keys that broke after transfer
- add add_admin: any existing admin can add another (closes Tx-wat#22)
- add remove_admin: refuses to remove last admin to prevent lockout
- emit (admin, transfer) event in transfer_admin (closes Tx-wat#7)
- emit (admin, add) and (admin, remove) events for full audit trail
- emit (watcher, remove) event that was previously missing
- add get_admins returning full admin set, keep get_admin for compat
- add ContractError::LastAdmin = 4
- add 10 new tests covering all multi-admin paths
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@stellajose Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Feature: Add multi-admin support to WatcherRegistry Bug: transfer_admin emits no event — admin changes are unauditable

1 participant