-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Milestone
Description
Feature Request: Operator-Scoped Incentives Hooks
Context
FilecoinPayV1 v1.0.0 is stable on mainnet. Experiments like incentivized uploads need logic inside payment execution to guarantee "no pay → no rewards." Currently requires forks, breaking composability. Example fork - HavenCTO@e03f13a
Problem
A global incentives hook creates a bottleneck and protocol-wide risk. Incentives should be operator-controlled and isolated.
Request
Add operator-scoped hooks so each operator can opt-in independently, minting rewards only when payments execute.
Proposed Design
Option A (recommended): Per-rail hook
- Extend
createRailwith optionalincentivesHookaddress (or addsetRailIncentivesHook(railId, hook)callable only byrail.operator) - Store on Rail struct
- During payment execution:
hook.onPayment(railId, token, operator, payee, netPayeeAmount)
Option B: Per-operator registry
- Add mapping
operatorIncentivesHook[operator] - Add
setOperatorIncentivesHook(hook)(msg.sender only) - Look up by
rail.operatorduring payment execution
Hook Semantics
- Called during
settleRail(post-fees/pre-credit) and one-time payments - Pass
netPayeeAmountto enforce "no pay → no rewards" deterministically - Reverts only affect the operator/rail using that hook
Benefits
Operators can independently:
- Mint per-operator reward tokens on bonding curves
- Blacklist users
- Experiment without FilecoinPay deployer coordination
Acceptance Criteria
- No behavior change when hooks unset
- Invoked on settlement and one-time payments
- Operator-scoped isolation
- Tests: unset hook no-op, invocation paths, limited revert propagation
Note: This adds a generic extension point, not a specific incentives scheme.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels