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 - https://github.com/HavenCTO/filecoin-pay/commit/e03f13a31241866f6141023735fe235bc7c7b342
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
createRail with optional incentivesHook address (or add setRailIncentivesHook(railId, hook) callable only by rail.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.operator during payment execution
Hook Semantics
- Called during
settleRail (post-fees/pre-credit) and one-time payments
- Pass
netPayeeAmount to 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.
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 - https://github.com/HavenCTO/filecoin-pay/commit/e03f13a31241866f6141023735fe235bc7c7b342
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
createRailwith optionalincentivesHookaddress (or addsetRailIncentivesHook(railId, hook)callable only byrail.operator)hook.onPayment(railId, token, operator, payee, netPayeeAmount)Option B: Per-operator registry
operatorIncentivesHook[operator]setOperatorIncentivesHook(hook)(msg.sender only)rail.operatorduring payment executionHook Semantics
settleRail(post-fees/pre-credit) and one-time paymentsnetPayeeAmountto enforce "no pay → no rewards" deterministicallyBenefits
Operators can independently:
Acceptance Criteria
Note: This adds a generic extension point, not a specific incentives scheme.