Skip to content

feat: implement action-specific pause controls#397

Merged
Cedarich merged 2 commits intoPulsefy:mainfrom
Amarjeet325:feat/action-specific-pause-310
Apr 28, 2026
Merged

feat: implement action-specific pause controls#397
Cedarich merged 2 commits intoPulsefy:mainfrom
Amarjeet325:feat/action-specific-pause-310

Conversation

@Amarjeet325
Copy link
Copy Markdown

feat: implement action-specific pause controls

Closes #310


Summary

This PR introduces granular pause controls for the smart contract, allowing specific actions to be paused independently instead of relying on a global pause mechanism. This improves security response while minimizing disruption to unaffected functionality.


✨ Changes Implemented

  • ✅ Added independent pause flags for:

    • create
    • claim
    • withdraw
  • 🔒 Restricted pause/unpause operations to admin-only authorization

  • 📡 Introduced new events:

    • ActionPausedEvent
    • ActionUnpausedEvent
  • 🛠️ Updated core contract functions to enforce pause checks:

    • create
    • claim
    • withdraw
  • 🧪 Added comprehensive unit tests covering:

    • Paused actions correctly reverting
    • Unaffected actions continuing to function normally
    • Admin-only access control for pause/unpause operations

🎯 Why This Change?

Previously, the contract relied on a global pause mechanism, which was too broad and could unnecessarily halt all operations. This update enables:

  • Targeted mitigation of vulnerabilities
  • Reduced system downtime
  • Improved user experience during incidents
  • Safer and more flexible contract management

⚙️ Behavior Example

If claim is paused:

  • claim() → fails
  • create() → works
  • withdraw() → works

🏷️ Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Security fix
  • Refactor
  • Documentation update
  • Tests only
  • Configuration / DevOps change

🧪 Test Evidence

  • New unit tests added
  • All tests pass
  • Coverage maintained or improved

🔒 Notes

  • Ensures fine-grained control over contract operations during emergencies
  • Designed to be extensible for additional actions in the future
  • Fully backward compatible (no breaking changes)

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 27, 2026

@Amarjeet325 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

@Amarjeet325
Copy link
Copy Markdown
Author

Hello @Cedarich please check my PR and close issue #310

@Cedarich Cedarich merged commit 2f3edf6 into Pulsefy:main Apr 28, 2026
1 check 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.

Action-Specific Pause Controls

3 participants