hopper-distribute
Dust-safe proportional splits and fee extraction for Hopper programs.
Largest-remainder distribution, basis-point fees, flat fees, and exact
conservation. Pure functions, no_std, no_alloc, and BPF-safe.
Part of the Hopper framework.
The math is integer-only: split outputs always sum to the input, and fee
extraction always returns (net, fee) where net + fee == amount.
use ;
let shares = ;
let mut out = ;
proportional_split?;
// out == [100, 300, 600], sum == 1_000
let = extract_fee?; // 30 bps == 0.30%
Docs: https://docs.rs/crate/hopper-distribute/0.2.0
Support: solanadevdao.sol / F42ZovBoRJZU4av5MiESVwJWnEx8ZQVFkc1RM29zMxNT.
License: Apache-2.0.