Skip to content

feat(contracts): implement notification revocation mechanism and auth safeguards (#176) - #208

Merged
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Abdullahi-Code9:feature/notification-revocation
Jun 24, 2026
Merged

feat(contracts): implement notification revocation mechanism and auth safeguards (#176)#208
Abd-Standard merged 1 commit into
Core-Foundry:mainfrom
Abdullahi-Code9:feature/notification-revocation

Conversation

@Abdullahi-Code9

@Abdullahi-Code9 Abdullahi-Code9 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Closes #176

Summary

Addresses #176 by adding a secure notification revocation mechanism to the core smart contract layer. This feature allows authorized entities (the notification creator or the contract admin) to permanently invalidate scheduled notifications before a recipient interacts with them, keeping a transparent on-chain history for auditing.

Key Changes

  • State Extension: Updated ScheduledNotification in types.rs to track revocation vectors via revoked_by: Option<Address> and revoked_at: Option<u64>.
  • Access Control & Safety: Introduced strict authorization checks in autoshare_logic.rs. Unauthorized revoke attempts trigger a custom Error::NotAuthorizedToRevoke error code.
  • State Locks: Prevented any downstream interactions (cancellations or expirations) on already-revoked notifications by throwing Error::NotificationRevoked.
  • Event-Driven Framework: Added the high-priority NotificationRevoked event matrix to events.rs so that downstream indexers can efficiently detect revocations.
  • Testing Matrix: Extended revocation_test.rs to safely include extern crate std; for test boundaries, running 14 comprehensive functional scenarios capturing execution paths, edge cases, and permission overrides.

Verification Results

Verified implementation boundaries and event emissions against structural state changes via local Cargo framework.
cargo test revocation
Result: 14 passed, 0 failed.

@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

@Abdullahi-Code9 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

@Abd-Standard
Abd-Standard merged commit 19f0f09 into Core-Foundry:main Jun 24, 2026
1 of 3 checks passed
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.

[Contracts] Add Notification Revocation Mechanism

2 participants