Skip to main content

Overview

ContributorSplit manages revenue distribution among app contributors. The app owner configures share percentages, and contributors pull their earned amounts on demand.

Key Functions

Read

FunctionReturnsDescription
getShares(address contributor)uint256Contributor’s share (basis points)
totalShares()uint256Sum of all shares
releasable(address contributor, address token)uint256Claimable balance for a token
released(address contributor, address token)uint256Already-claimed amount
contributors()address[]List of all contributors

Write

FunctionAccessDescription
setShares(address[] calldata addrs, uint256[] calldata shares)App ownerSet contributor shares
release(address token)ContributorClaim earned tokens
releaseAll(address[] calldata tokens)ContributorClaim across multiple tokens

Share Mechanics

  • Shares are in basis points (10000 = 100%)
  • Sum of all shares must not exceed 10000
  • When fees arrive, they are split proportionally
  • Contributors call release() to pull their share

Events

EventEmitted When
SharesUpdated(address contributor, uint256 shares)Shares configured
PaymentReleased(address contributor, address token, uint256 amount)Funds claimed

Usage Example

// Check claimable amount
const claimable = await client.readContract({
  address: SPLIT_ADDRESS,
  abi: ContributorSplitABI,
  functionName: 'releasable',
  args: [contributorAddress, ELTA_ADDRESS]
})

// Claim
await writeContract({
  address: SPLIT_ADDRESS,
  abi: ContributorSplitABI,
  functionName: 'release',
  args: [ELTA_ADDRESS]
})