IServiceFeeDistributor
Source: https://github.com/tangle-network/tnt-core/blob/main/src/interfaces/IServiceFeeDistributor.sol
IServiceFeeDistributor
Tracks service-fee payouts to stakers across payment tokens
Receives delegation-change hooks from MultiAssetDelegation and fee-distribution calls from Tangle.
Functions
distributeServiceFee
function distributeServiceFee(uint64 serviceId, uint64 blueprintId, address operator, address paymentToken, uint256 amount) external payabledistributeInflationReward
function distributeInflationReward(uint64 serviceId, uint64 blueprintId, address operator, address paymentToken, uint256 amount) external payableDistribute inflation-funded staker rewards using service exposure weights
Intended for InflationPool; rewards are paid in the provided token (TNT).
claimFor
function claimFor(address token, address operator, struct Types.Asset asset) external returns (uint256 amount)Claim rewards for a specific delegator position and token
claimAll
function claimAll(address token) external returns (uint256 totalAmount)Claim all pending rewards across all positions for a token
claimAllBatch
function claimAllBatch(address[] tokens) external returns (uint256[] amounts)Claim all pending rewards for multiple tokens
pendingRewards
function pendingRewards(address delegator, address token) external view returns (uint256 pending)Preview pending rewards for a delegator across all positions for a token
delegatorOperators
function delegatorOperators(address delegator) external view returns (address[] operators)Return all operators a delegator has positions with
delegatorAssets
function delegatorAssets(address delegator, address operator) external view returns (bytes32[] assetHashes)Return all asset hashes a delegator has positions for with an operator
getPosition
function getPosition(address delegator, address operator, bytes32 assetHash) external view returns (uint8 mode, uint256 principal, uint256 score)Return a delegator’s position details
operatorRewardTokens
function operatorRewardTokens(address operator) external view returns (address[] tokens)Return reward tokens ever distributed for an operator
onDelegationChanged
function onDelegationChanged(address delegator, address operator, struct Types.Asset asset, uint256 amount, bool isIncrease, enum Types.BlueprintSelectionMode selectionMode, uint64[] blueprintIds, uint16 lockMultiplierBps) externalonBlueprintAdded
function onBlueprintAdded(address delegator, address operator, struct Types.Asset asset, uint64 blueprintId) externalonBlueprintRemoved
function onBlueprintRemoved(address delegator, address operator, struct Types.Asset asset, uint64 blueprintId) externalgetPoolScore
function getPoolScore(address operator, uint64 blueprintId, struct Types.Asset asset) external view returns (uint256 allScore, uint256 fixedScore)getOperatorServiceUsdExposure
function getOperatorServiceUsdExposure(uint64 serviceId, uint64 blueprintId, address operator) external view returns (uint256 totalUsdExposure)Get USD-weighted exposure for an operator/service
Returns total USD exposure across All+Fixed pools for the service.
onOperatorLeaving
function onOperatorLeaving(uint64 serviceId, address operator) externalCalled when an operator is about to leave a service
Drips all active streams for the operator BEFORE they’re removed
onServiceTerminated
function onServiceTerminated(uint64 serviceId, address refundRecipient) externalCalled when a service is terminated early
Cancels streaming payments and refunds remaining amounts to the service owner
Parameters
| Name | Type | Description |
|---|---|---|
| serviceId | uint64 | The terminated service ID |
| refundRecipient | address | Where to send the remaining payment (typically service owner) |