Skip to content

Feature Request: Operator-Scoped Incentives Hooks #256

@HavenCTO

Description

@HavenCTO

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 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📌 Triage

    Status

    📌 Triage

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions