IRevenueDistributor
Title: IRevenueDistributor
Interface for simple revenue distribution to configured recipients
Non-upgradeable contract implementing EIP-2981 royalty standard
Pure distribution logic - payment timing and penalties handled by calling contracts (e.g., Marketplace)
Functions
configureSplit
Configures revenue split for an IP asset
Only callable by IP asset owner or CONFIGURATOR_ROLE
function configureSplit(uint256 ipAssetId, address[] memory recipients, uint256[] memory shares) external;
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset ID |
recipients | address[] | Array of recipient addresses |
shares | uint256[] | Array of share amounts in basis points (must sum to 10000) |
distributePayment
Distributes a payment according to configured splits
Deducts platform fee then splits remainder among recipients
function distributePayment(uint256 ipAssetId, uint256 amount, address seller, bool isPrimarySale) external payable;
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset ID |
amount | uint256 | Payment amount to distribute |
seller | address | Address of the seller (receives remainder for secondary sales) |
isPrimarySale | bool | True for primary sales (100% to split), false for secondary (royalty to split, remainder to seller) |
withdraw
Withdraws accumulated funds
All recipients (including platform treasury) use this function to withdraw
function withdraw() external;
getBalance
Gets the principal balance for a recipient
function getBalance(address recipient) external view returns (uint256 balance);
Parameters
| Name | Type | Description |
|---|---|---|
recipient | address | Address to query |
Returns
| Name | Type | Description |
|---|---|---|
balance | uint256 | Principal amount available for withdrawal |
setDefaultRoyalty
Sets the default royalty rate
Only callable by admin
function setDefaultRoyalty(uint256 basisPoints) external;
Parameters
| Name | Type | Description |
|---|---|---|
basisPoints | uint256 | Royalty rate in basis points |
setAssetRoyalty
Configure royalty rate for a specific IP asset
Only callable by CONFIGURATOR_ROLE
function setAssetRoyalty(uint256 ipAssetId, uint256 basisPoints) external;
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset ID |
basisPoints | uint256 | Royalty rate in basis points (e.g., 1000 = 10%) |
getAssetRoyalty
Get royalty rate for an IP asset (custom or default)
function getAssetRoyalty(uint256 ipAssetId) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset ID |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Royalty rate in basis points |
grantConfiguratorRole
Grants CONFIGURATOR_ROLE to the IPAsset contract
Only callable by admin. Should be called after IPAsset deployment.
function grantConfiguratorRole(address ipAssetContract) external;
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetContract | address | Address of the IPAsset contract |
ipSplits
Gets the configured split for an IP asset
function ipSplits(uint256 ipAssetId) external view returns (address[] memory recipients, uint256[] memory shares);
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset ID |
Returns
| Name | Type | Description |
|---|---|---|
recipients | address[] | Array of recipient addresses |
shares | uint256[] | Array of share amounts |
isSplitConfigured
Checks if a split is configured for an IP asset
function isSplitConfigured(uint256 ipAssetId) external view returns (bool configured);
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset ID |
Returns
| Name | Type | Description |
|---|---|---|
configured | bool | True if split exists, false otherwise |
Events
PaymentDistributed
Emitted when a payment is distributed
event PaymentDistributed(uint256 indexed ipAssetId, uint256 amount, address indexed seller, bool isPrimarySale);
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset the payment is for |
amount | uint256 | Total payment amount |
seller | address | Address of the seller |
isPrimarySale | bool | Whether this is a primary sale (seller is in split recipients) |
SplitConfigured
Emitted when a revenue split is configured
event SplitConfigured(uint256 indexed ipAssetId, address[] recipients, uint256[] shares);
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset ID |
recipients | address[] | Array of recipient addresses |
shares | uint256[] | Array of share amounts |
Withdrawal
Emitted when a recipient withdraws funds
event Withdrawal(address indexed recipient, uint256 principal);
Parameters
| Name | Type | Description |
|---|---|---|
recipient | address | Address withdrawing |
principal | uint256 | Principal amount withdrawn |
RoyaltyUpdated
Emitted when default royalty rate is updated
event RoyaltyUpdated(uint256 newRoyaltyBasisPoints);
Parameters
| Name | Type | Description |
|---|---|---|
newRoyaltyBasisPoints | uint256 | New royalty rate in basis points |
AssetRoyaltyUpdated
Emitted when a per-asset royalty rate is updated
event AssetRoyaltyUpdated(uint256 indexed ipAssetId, uint256 basisPoints);
Parameters
| Name | Type | Description |
|---|---|---|
ipAssetId | uint256 | The IP asset ID |
basisPoints | uint256 | New royalty rate in basis points |
Errors
ArrayLengthMismatch
Thrown when array lengths don't match
error ArrayLengthMismatch();
NoRecipientsProvided
Thrown when no recipients are provided
error NoRecipientsProvided();
InvalidRecipient
Thrown when a recipient address is zero
error InvalidRecipient();
InvalidSharesSum
Thrown when shares don't sum to 10000 basis points
error InvalidSharesSum();
IncorrectPaymentAmount
Thrown when msg.value doesn't match amount parameter
error IncorrectPaymentAmount();
InvalidIPAsset
Thrown when IP asset does not exist
error InvalidIPAsset();
NoBalanceToWithdraw
Thrown when attempting to withdraw with zero balance
error NoBalanceToWithdraw();
TransferFailed
Thrown when ETH transfer fails during withdrawal
error TransferFailed();
InvalidTreasuryAddress
Thrown when treasury address is zero
error InvalidTreasuryAddress();
InvalidPlatformFee
Thrown when platform fee exceeds 100%
error InvalidPlatformFee();
InvalidRoyalty
Thrown when royalty rate exceeds 100%
error InvalidRoyalty();
InvalidIPAssetAddress
Thrown when IPAsset contract address is zero
error InvalidIPAssetAddress();
InvalidBasisPoints
Thrown when basis points exceeds 10000 (100%)
error InvalidBasisPoints();
InvalidRoyaltyRate
Thrown when royalty rate exceeds 100%
error InvalidRoyaltyRate();
Structs
Split
Revenue split configuration for an IP asset
struct Split {
address[] recipients;
uint256[] shares;
}
Properties
| Name | Type | Description |
|---|---|---|
recipients | address[] | Array of addresses to receive revenue shares |
shares | uint256[] | Array of share amounts in basis points (must sum to 10000) |