Documentation

Payment Splitter

Route incoming payments to multiple recipients by percentage. Configure once with recipients and their shares, then anyone can split tokens through the contract.

Use Cases

  • Revenue sharing between team members
  • Royalty distribution for creators
  • Automated payment routing for organizations

Init Parameters

ParameterTypeDescription
nameStringSplitter name
recipientsVec<Recipient>List of recipients with share percentages

Shares are expressed in basis points (100 bps = 1%). All shares must total exactly 10,000 bps (100%).

Execute Methods

MethodParametersDescription
initializename, recipientsSet up recipients and shares. Only callable once. Shares must total 10,000.
splittoken_id: TokenId, amount: u128Split the specified amount among all recipients by their share.

Query Methods

MethodParametersReturnsDescription
get_config--SplitterConfigFull configuration with all recipients

Key Types

Recipient

pub struct Recipient {
    pub address: Address,
    pub share_bps: u64,  // basis points (100 = 1%)
}

SplitterConfig

pub struct SplitterConfig {
    pub name: String,
    pub creator: Address,
    pub recipients: Vec<Recipient>,
    pub created_at: u64,
}

Example

A 3-way split for a team:

RecipientShare
Alice5,000 bps (50%)
Bob3,000 bps (30%)
Charlie2,000 bps (20%)

When 1,000 NORN is split: Alice receives 500, Bob receives 300, Charlie receives 200.

CLI Usage

# Deploy
norn wallet deploy-loom --name my-splitter
 
# Upload bytecode
norn wallet upload-bytecode --loom-id <LOOM_ID> \
  --bytecode splitter.wasm
 
# Execute (borsh-encoded input)
norn wallet execute-loom --loom-id <LOOM_ID> --input <HEX>
 
# Query config
norn wallet query-loom --loom-id <LOOM_ID>