GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DevVichy/split-pay: ERC-20 payment splitter in Solidity with fuzz tests (Foundry)

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
lib
lib
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
foundry.toml
foundry.toml
 
 

Repository files navigation

split-pay

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.

How it works

  1. createSplit(recipients, shares) registers a split. Shares are in basis points and must sum to 10,000. Splits are immutable.
  2. pay(id, token, amount) pulls amount of token from the caller and pays each recipient their share in the same transaction.
  3. Rounding dust goes to the last recipient, so the contract never holds a balance.

Design notes

  • 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.

Usage

git clone --recurse-submodules https://github.com/DevVichy/split-pay.git
cd split-pay
forge build
forge test

Tests

  • 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 - 1 wei of dust.

Status

Not audited and not deployed. Treat it as a reference implementation.

License

MIT

About

ERC-20 payment splitter in Solidity with fuzz tests (Foundry)

Topics

erc20foundrypaymentssolidity

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.