IRegistrableModule
Title: IRegistrableModule
Author: amser
Canonical registration interface for all registrable modules.
This interface allows PaymentProcessor to register any module type (subscriptions, credits, hybrid, etc.) without understanding module semantics. The processor only enforces:
- Permit2 signature validation
- Permit binding to module requirements
- Signature consumption Modules define:
- What permit parameters are required
- How to initialize execution state
- What registration means for their module type
Functions
registrationContext
Returns the expected permit parameters for registration.
Used by PaymentProcessor to validate Permit2 binding. Module defines what token and minimum amount are required.
function registrationContext(
uint256 planId,
address subscriber
)
external
view
returns (address token, uint256 minAmount);
Parameters
| Name | Type | Description |
|---|---|---|
planId | uint256 | Module-specific plan identifier (e.g., subscription plan ID) |
subscriber | address | Address of the subscriber/owner |
Returns
| Name | Type | Description |
|---|---|---|
token | address | Token address that must be permitted |
minAmount | uint256 | Minimum amount that must be permitted |
registerExecution
Registers a new executable entity in the module.
Called after Permit2 signature is consumed and validated. Module initializes execution state but does not perform any payment.
function registerExecution(
address subscriber,
uint256 planId,
uint256 executionBudget,
uint256 allowanceExpiry
)
external
returns (uint256 id);
Parameters
| Name | Type | Description |
|---|---|---|
subscriber | address | Address of the subscriber/owner |
planId | uint256 | Module-specific plan identifier |
executionBudget | uint256 | Number of executions allowed |
allowanceExpiry | uint256 | When the delegated allowance expires |
Returns
| Name | Type | Description |
|---|---|---|
id | uint256 | Module-specific execution identifier |