Skip to content

Conversation

@patidarmanoj10
Copy link

What?

  • Add CallIntervalEnforcer contract to enforce a minimum interval between consecutive calls for a given delegation.
  • Includes unit tests for interval enforcement logic.

Why?

  • To provide a reusable enforcer that restricts the frequency of delegation usage, improving security and flexibility for delegation-based systems.
  • Enables use cases such as rate-limiting actions or enforcing cooldown periods on delegated permissions.

How?

  • Implements a beforeHook that checks if the required interval has passed since the last call for a (delegationManager, delegationHash) pair.
  • Stores the last execution timestamp in a mapping.
  • Decodes the interval from _terms (32 bytes, uint256 seconds).
  • Adds comprehensive unit tests to verify correct enforcement, including edge cases and independent tracking for different managers and delegations.

@patidarmanoj10 patidarmanoj10 requested a review from a team as a code owner June 11, 2025 05:28
@patidarmanoj10 patidarmanoj10 changed the title Call Interval Enforcer feat: Call Interval Enforcer Jun 11, 2025
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.

1 participant