A small ERC-20 payment splitter in Solidity. Create a split once, then anyone can pay into it and every recipient is paid in the same transaction.
Useful for revenue sharing, group payments and team payouts, and it is the same idea as the payout routing in GemJar's prize pool.
createSplit(recipients, shares)registers a split. Shares are in basis points and must sum to 10,000. Splits are immutable.pay(id, token, amount)pullsamountoftokenfrom the caller and pays each recipient their share in the same transaction.- Rounding dust goes to the last recipient, so the contract never holds a balance.
- Fee-on-transfer tokens: the contract distributes the balance it actually received, not the nominal amount.
- Non-standard ERC-20s: transfers use low-level calls and accept tokens that return no value.
- No admin, no upgrade path, no stored funds. The contract is a stateless router once a payment completes.
- Recipients are limited to 50 per split to keep gas bounded. Duplicates and zero addresses are rejected.
git clone --recurse-submodules https://github.com/DevVichy/split-pay.git cd split-pay forge build forge test
- 14 unit tests cover validation, event emission, exact splits, rounding dust, missing allowance and a fee-on-transfer token.
- 3 fuzz tests (512 runs each) check that all funds are distributed, nothing stays in the contract, and the last recipient absorbs at most
n - 1wei of dust.
Not audited and not deployed. Treat it as a reference implementation.
MIT