Deploy an immutable N-way fee splitter — recipients and basis-point shares fixed forever at deploy, no admin keys, native + ERC20, pull-based payouts anyone can trigger. Use when the user says "split fees between wallets", "revenue share 70/30", "route fees to N recipients", "pay three wallets automatically", or needs a trustless payout address. Deploys through the DeployerFactory on Base as ONE normal transaction (to + data) — no creation tx needed.
Recursos
12Instal·la
npx skillscat add jimbo530/mft-bnkr-sync/fee-router-n-way-splitter Instal·la des del registre de SkillsCat.
Fee Router — N-way FeeSplitter
The problem this solves
Bankr can split fees natively only inside its fixed token-launch flows. Anything
else — a 70/30 revenue share, a 3-way team split, a game tax routed to five
prize pools — needs a standalone router, and most routers ship with an owner
key that can re-point your money.
FeeSplitter is the no-key version: an immutable N-way splitter. You fix
the recipients and their basis-point shares once, at deploy, and that is the
entire contract. It accepts native ETH and any ERC20, and recipients pull
their share whenever they like. 2 recipients or 20 — same contract.
Trust model — the selling point
- NO admin. NO owner. NO pause. NO upgrade path. Nothing to renounce —
there was never a key in the first place. The constructor arguments are the
whole trust model. - The compiled ABI's only state-changing functions are
releaseandreleaseAll— both payout paths. There is no function that can change a
recipient, a share, or move funds anywhere but to the recipients. - Payouts are permissionless: anyone (a keeper, a bot, a recipient) can
trigger them, and funds always go to the configured recipients — never the
caller. - Proven by a 50-check local EVM suite (
test-fee-splitter.cjsin this
folder): constructor guards, exact pro-rata accounting across interleaved
inflows/releases, ERC20 + USDT-style tokens, rounding bounds, reentrancy.
Contract interface
constructor(address[] recipients, uint256[] sharesBps);
// require: equal lengths, >= 2 recipients, no zero address, no zero share,
// no duplicate recipient, sum(sharesBps) == 10000 exactly.
function release(address token, address account) returns (uint256 amount);
function releaseAll(address token) returns (uint256 totalPaid);
function pending(address token, address account) view returns (uint256);
function shares(address account) view returns (uint256); // bps, 0 = not a recipient
function released(address token, address account) view returns (uint256);
function totalReleased(address token) view returns (uint256);
function recipients() view returns (address[]);
function recipientCount() view returns (uint256);
function TOTAL_BPS() view returns (uint256); // 10000
event PaymentReceived(address indexed from, uint256 amount); // native inflows
event PaymentReleased(address indexed token, address indexed to, uint256 amount);
receive() external payable; // accepts plain ETHtoken = address(0) means native ETH everywhere.
Selectors (grounded from the compiled ABI):
release(address,address)=0x48b75044releaseAll(address)=0x580fc80apending(address,address)=0x19bc9ae8shares(address)=0xce7c2ac2totalReleased(address)=0xd79779b2released(address,address)=0x406072a9recipients()=0x0e57d4cePaymentReceivedtopic0 =0x6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be770PaymentReleasedtopic0 =0x8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429
How funds flow
- In: point any fee source at the splitter address. Plain ETH transfers
land viareceive(); ERC20s arrive by ordinarytransfer. No registration,
no deposit function — the splitter accounts by balance. - Out (pull):
release(token, account)paysaccountits owed share of
alltokenreceived to date. Per-(token, account) released amounts are
tracked, so repeated calls only ever pay new inflows. - Out (batch):
releaseAll(token)pushes every recipient's currently-owed
share in one call. - Check first:
pending(token, account)is exactly what a release would
pay right now.
Accounting identity: owed = (balance + totalReleased) * sharesBps / 10000 - released[account].
Deploy YOUR splitter through the DeployerFactory
The factory turns deployment into a normal to + data transaction — this is
how a Bankr agent (whose tooling requires a to field) ships a contract.
| Chain | DeployerFactory |
|---|---|
| Base (8453) | 0xCF4357aFdC26fa028e77291CE2F97C9dAF93F75D (live + verified) |
Three steps:
- Encode the constructor:
ctorTail = abi.encode(address[] recipients, uint256[] sharesBps). - Build the initCode:
initCode = FeeSplitter creation bytecode ++ ctorTail
(creation bytecode =creation-bytecode.txtin this folder, 3,284 bytes,
pinned compiler — see "Reproduce the build"). - Send ONE transaction:
to= the factory,value=fee()(0 at
launch — read it, don't assume; the FeeSplitter constructor is NOT payable,
so send exactly the fee),data= ABI encoding ofdeploy(initCode)
(selector0x00774360). The new splitter's address is in the receipt'sDeployedevent: topic00x78c9d1e385f0bb7d4dd0237eb7ab708b0780c73031080977cd5469bab04ed690,topics[2]= the address (last 20 bytes). You can alsoeth_callthe same
calldata first — the return value is the address the real tx will produce.
Measured on the local suite: a 2-way deploy through the factory used
703,728 gas — far under any per-tx cap.
Prefer a predictable address? Use the factory'sdeployDeterministic(initCode, salt) and precompute withcomputeAddress(keccak256(initCode), salt) (both initCode hashes for the
worked examples are printed below).
viem
import { encodeFunctionData, encodeAbiParameters, parseAbi } from "viem";
const FACTORY = "0xCF4357aFdC26fa028e77291CE2F97C9dAF93F75D";
const abi = parseAbi([
"function deploy(bytes initCode) payable returns (address)",
"function fee() view returns (uint256)",
"event Deployed(address indexed deployer, address indexed addr, uint256 feePaid)",
]);
const ctorTail = encodeAbiParameters(
[{ type: "address[]" }, { type: "uint256[]" }],
[RECIPIENTS, SHARES_BPS], // sharesBps MUST sum to exactly 10000n
);
const initCode = (CREATION_BYTECODE + ctorTail.slice(2)) as `0x${string}`;
const hash = await wallet.sendTransaction({
to: FACTORY,
value: await pub.readContract({ address: FACTORY, abi, functionName: "fee" }),
data: encodeFunctionData({ abi, functionName: "deploy", args: [initCode] }),
});
const receipt = await pub.waitForTransactionReceipt({ hash });
const log = receipt.logs.find((l) => l.address.toLowerCase() === FACTORY.toLowerCase());
const splitter = ("0x" + log!.topics[2]!.slice(26)) as `0x${string}`;Worked example (a) — 2-way 50/50 split
Recipients below are PLACEHOLDERS (
0x1111…,0x2222…). Replace them
with YOUR addresses and re-encode before any real deploy — a splitter's
recipients can never be changed.
recipients=[0x1111111111111111111111111111111111111111, 0x2222222222222222222222222222222222222222]sharesBps=[5000, 5000]
ABI-encoded constructor tail — abi.encode(address[],uint256[]) (note the
layout: two offsets, then each array as length + items; shares 0x1388 = 5000):
0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000011111111111111111111111111111111111111110000000000000000000000002222222222222222222222222222222222222222000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000001388Full initCode (creation bytecode ++ tail, 3,540 bytes):
0x60806040523461038b57610cd480380380610019816103b0565b92833981019060408183031261038b5780516001600160401b03811161038b5781019082601f8301121561038b57815161005a610055826103d5565b6103b0565b9260208085848152019260051b8201019085821161038b57602001915b818310610390575050506020810151906001600160401b03821161038b57019180601f8401121561038b5782516100b0610055826103d5565b9360208086848152019260051b82010192831161038b57602001905b82821061037b57505050600160045580518251036103445760028151106102ff57600091825b82518410156102a3576001600160a01b0361010d85856103ec565b511661011985846103ec565b5190801561026d57811561023b578060005260016020526040600020546101f657600054680100000000000000008110156101e05760018101806000558110156101ca577f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b03191682179055600090815260016020526040902081905581019081106101b4576001909301926100f2565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152601360248201527f6475706c696361746520726563697069656e74000000000000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600a6024820152697a65726f20736861726560b01b6044820152606490fd5b60405162461bcd60e51b815260206004820152600e60248201526d1e995c9bc81c9958da5c1a595b9d60921b6044820152606490fd5b612710036102ba576040516108d390816104018239f35b60405162461bcd60e51b815260206004820152601860248201527f736861726573206d7573742073756d20746f20313030303000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601a60248201527f6e656564206174206c65617374203220726563697069656e74730000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e0d8cadccee8d040dad2e6dac2e8c6d608b1b6044820152606490fd5b81518152602091820191016100cc565b600080fd5b82516001600160a01b038116810361038b57815260209283019201610077565b6040519190601f01601f191682016001600160401b038111838210176101e057604052565b6001600160401b0381116101e05760051b60200190565b80518210156101ca5760209160051b01019056fe6080806040526004361015610049575b50361561001b57600080fd5b6040513481527f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77060203392a2005b60003560e01c9081630e57d4ce146103865750806319bc9ae81461035257806322eabb8e14610334578063406072a9146102e357806348b7504414610237578063580fc80a1461014f578063ce7c2ac214610115578063d3cd52bc146100f85763d79779b2146100b9573861000f565b346100f35760203660031901126100f3576001600160a01b036100da61044e565b1660005260026020526020604060002054604051908152f35b600080fd5b346100f35760003660031901126100f35760206040516127108152f35b346100f35760203660031901126100f3576001600160a01b0361013661044e565b1660005260016020526020604060002054604051908152f35b346100f35760203660031901126100f35761016861044e565b6101766001600454146104b2565b6002600455600080546000925b8184106101a5576020836101988115156104ea565b6001600455604051908152f35b909160005484101561022157600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5638401546001600160a01b0316906101ed8284610547565b918215610216579161020b91610206826001958761061e565b610524565b935b01929190610183565b50936001915061020d565b634e487b7160e01b600052603260045260246000fd5b346100f35760403660031901126100f35761025061044e565b610258610464565b6102666001600454146104b2565b60026004556001600160a01b038116600090815260016020526040902054156102ac576101988261029983602095610547565b9283916102a78315156104ea565b61061e565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd0818481c9958da5c1a595b9d608a1b6044820152606490fd5b346100f35760403660031901126100f3576102fc61044e565b610304610464565b6001600160a01b039182166000908152600360209081526040808320949093168252928352819020549051908152f35b346100f35760003660031901126100f3576020600054604051908152f35b346100f35760403660031901126100f357602061037e61037061044e565b610378610464565b90610547565b604051908152f35b346100f35760003660031901126100f35760005490818152602081018092600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639060005b81811061042f57505050816103e391038261047a565b6040519182916020830190602084525180915260408301919060005b81811061040d575050500390f35b82516001600160a01b03168452859450602093840193909201916001016103ff565b82546001600160a01b03168452602090930192600192830192016103cd565b600435906001600160a01b03821682036100f357565b602435906001600160a01b03821682036100f357565b90601f8019910116810190811067ffffffffffffffff82111761049c57604052565b634e487b7160e01b600052604160045260246000fd5b156104b957565b60405162461bcd60e51b81526020600482015260096024820152681c99595b9d1c985b9d60ba1b6044820152606490fd5b156104f157565b60405162461bcd60e51b815260206004820152600b60248201526a6e6f7468696e672064756560a81b6044820152606490fd5b9190820180921161053157565b634e487b7160e01b600052601160045260246000fd5b9060018060a01b038116600052600160205260406000205480156105d657610592610571846107ee565b6001600160a01b039094166000818152600260205260409020549094610524565b81810291818304149015171561053157612710900491600052600360205260406000209060018060a01b031660005260205260406000205481039081116105315790565b505050600090565b3d15610619573d9067ffffffffffffffff821161049c576040519161060d601f8201601f19166020018461047a565b82523d6000602084013e565b606090565b9060018060a01b03821691826000526003602052604060002060018060a01b0383166000526020526040600020610656858254610524565b90558260005260026020526040600020610671858254610524565b9055826107025750600080808086855af161068a6105de565b50156106c85760207f8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429915b6040519485526001600160a01b031693a3565b60405162461bcd60e51b81526020600482015260126024820152711b985d1a5d99481cd95b990819985a5b195960721b6044820152606490fd5b6000809160405182602082019163a9059cbb60e01b835260018060a01b03871660248201528860448201526044815261073c60648261047a565b51925af16107486105de565b816107b6575b501561077d5760207f8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429916106b5565b60405162461bcd60e51b81526020600482015260116024820152701d1bdad95b881cd95b990819985a5b1959607a1b6044820152606490fd5b80518015925082156107cb575b50503861074e565b81925090602091810103126100f3576020015180151581036100f35738806107c3565b6001600160a01b03811615610898576000809160405160208101906370a0823160e01b82523060248201526024815261082860448261047a565b51915afa6108346105de565b908061088c575b15610854576020818051810103126100f3576020015190565b60405162461bcd60e51b815260206004820152601060248201526f18985b185b98d953d98819985a5b195960821b6044820152606490fd5b5060208151101561083b565b50479056fea2646970667358221220b7acc83225b1b24ac146b7d7b13f519463cdb1240685a1c71e6a9becd1cf8b7e64736f6c63430008230033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000011111111111111111111111111111111111111110000000000000000000000002222222222222222222222222222222222222222000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000001388keccak256(initCode) (for CREATE2 computeAddress):0x3a8158886596dc6e4d3222aad2ae4e3ac6042677fe399b653a7f0dfbcbbfd858
The complete deploy(initCode) calldata — this is the entire data field of
the tx you send to the factory (to = 0xCF4357aFdC26fa028e77291CE2F97C9dAF93F75D,value = fee()):
0x0077436000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000dd460806040523461038b57610cd480380380610019816103b0565b92833981019060408183031261038b5780516001600160401b03811161038b5781019082601f8301121561038b57815161005a610055826103d5565b6103b0565b9260208085848152019260051b8201019085821161038b57602001915b818310610390575050506020810151906001600160401b03821161038b57019180601f8401121561038b5782516100b0610055826103d5565b9360208086848152019260051b82010192831161038b57602001905b82821061037b57505050600160045580518251036103445760028151106102ff57600091825b82518410156102a3576001600160a01b0361010d85856103ec565b511661011985846103ec565b5190801561026d57811561023b578060005260016020526040600020546101f657600054680100000000000000008110156101e05760018101806000558110156101ca577f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b03191682179055600090815260016020526040902081905581019081106101b4576001909301926100f2565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152601360248201527f6475706c696361746520726563697069656e74000000000000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600a6024820152697a65726f20736861726560b01b6044820152606490fd5b60405162461bcd60e51b815260206004820152600e60248201526d1e995c9bc81c9958da5c1a595b9d60921b6044820152606490fd5b612710036102ba576040516108d390816104018239f35b60405162461bcd60e51b815260206004820152601860248201527f736861726573206d7573742073756d20746f20313030303000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601a60248201527f6e656564206174206c65617374203220726563697069656e74730000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e0d8cadccee8d040dad2e6dac2e8c6d608b1b6044820152606490fd5b81518152602091820191016100cc565b600080fd5b82516001600160a01b038116810361038b57815260209283019201610077565b6040519190601f01601f191682016001600160401b038111838210176101e057604052565b6001600160401b0381116101e05760051b60200190565b80518210156101ca5760209160051b01019056fe6080806040526004361015610049575b50361561001b57600080fd5b6040513481527f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77060203392a2005b60003560e01c9081630e57d4ce146103865750806319bc9ae81461035257806322eabb8e14610334578063406072a9146102e357806348b7504414610237578063580fc80a1461014f578063ce7c2ac214610115578063d3cd52bc146100f85763d79779b2146100b9573861000f565b346100f35760203660031901126100f3576001600160a01b036100da61044e565b1660005260026020526020604060002054604051908152f35b600080fd5b346100f35760003660031901126100f35760206040516127108152f35b346100f35760203660031901126100f3576001600160a01b0361013661044e565b1660005260016020526020604060002054604051908152f35b346100f35760203660031901126100f35761016861044e565b6101766001600454146104b2565b6002600455600080546000925b8184106101a5576020836101988115156104ea565b6001600455604051908152f35b909160005484101561022157600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5638401546001600160a01b0316906101ed8284610547565b918215610216579161020b91610206826001958761061e565b610524565b935b01929190610183565b50936001915061020d565b634e487b7160e01b600052603260045260246000fd5b346100f35760403660031901126100f35761025061044e565b610258610464565b6102666001600454146104b2565b60026004556001600160a01b038116600090815260016020526040902054156102ac576101988261029983602095610547565b9283916102a78315156104ea565b61061e565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd0818481c9958da5c1a595b9d608a1b6044820152606490fd5b346100f35760403660031901126100f3576102fc61044e565b610304610464565b6001600160a01b039182166000908152600360209081526040808320949093168252928352819020549051908152f35b346100f35760003660031901126100f3576020600054604051908152f35b346100f35760403660031901126100f357602061037e61037061044e565b610378610464565b90610547565b604051908152f35b346100f35760003660031901126100f35760005490818152602081018092600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639060005b81811061042f57505050816103e391038261047a565b6040519182916020830190602084525180915260408301919060005b81811061040d575050500390f35b82516001600160a01b03168452859450602093840193909201916001016103ff565b82546001600160a01b03168452602090930192600192830192016103cd565b600435906001600160a01b03821682036100f357565b602435906001600160a01b03821682036100f357565b90601f8019910116810190811067ffffffffffffffff82111761049c57604052565b634e487b7160e01b600052604160045260246000fd5b156104b957565b60405162461bcd60e51b81526020600482015260096024820152681c99595b9d1c985b9d60ba1b6044820152606490fd5b156104f157565b60405162461bcd60e51b815260206004820152600b60248201526a6e6f7468696e672064756560a81b6044820152606490fd5b9190820180921161053157565b634e487b7160e01b600052601160045260246000fd5b9060018060a01b038116600052600160205260406000205480156105d657610592610571846107ee565b6001600160a01b039094166000818152600260205260409020549094610524565b81810291818304149015171561053157612710900491600052600360205260406000209060018060a01b031660005260205260406000205481039081116105315790565b505050600090565b3d15610619573d9067ffffffffffffffff821161049c576040519161060d601f8201601f19166020018461047a565b82523d6000602084013e565b606090565b9060018060a01b03821691826000526003602052604060002060018060a01b0383166000526020526040600020610656858254610524565b90558260005260026020526040600020610671858254610524565b9055826107025750600080808086855af161068a6105de565b50156106c85760207f8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429915b6040519485526001600160a01b031693a3565b60405162461bcd60e51b81526020600482015260126024820152711b985d1a5d99481cd95b990819985a5b195960721b6044820152606490fd5b6000809160405182602082019163a9059cbb60e01b835260018060a01b03871660248201528860448201526044815261073c60648261047a565b51925af16107486105de565b816107b6575b501561077d5760207f8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429916106b5565b60405162461bcd60e51b81526020600482015260116024820152701d1bdad95b881cd95b990819985a5b1959607a1b6044820152606490fd5b80518015925082156107cb575b50503861074e565b81925090602091810103126100f3576020015180151581036100f35738806107c3565b6001600160a01b03811615610898576000809160405160208101906370a0823160e01b82523060248201526024815261082860448261047a565b51915afa6108346105de565b908061088c575b15610854576020818051810103126100f3576020015190565b60405162461bcd60e51b815260206004820152601060248201526f18985b185b98d953d98819985a5b195960821b6044820152606490fd5b5060208151101561083b565b50479056fea2646970667358221220b7acc83225b1b24ac146b7d7b13f519463cdb1240685a1c71e6a9becd1cf8b7e64736f6c63430008230033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000011111111111111111111111111111111111111110000000000000000000000002222222222222222222222222222222222222222000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000001388000000000000000000000000Worked example (b) — 3-way 50/30/20 split
recipients=[0x1111…1111, 0x2222…2222, 0x3333…3333](placeholders — replace)sharesBps=[5000, 3000, 2000]
ABI-encoded constructor tail:
0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000111111111111111111111111111111111111111100000000000000000000000022222222222222222222222222222222222222220000000000000000000000003333333333333333333333333333333333333333000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000007d0Full initCode (3,604 bytes):
0x60806040523461038b57610cd480380380610019816103b0565b92833981019060408183031261038b5780516001600160401b03811161038b5781019082601f8301121561038b57815161005a610055826103d5565b6103b0565b9260208085848152019260051b8201019085821161038b57602001915b818310610390575050506020810151906001600160401b03821161038b57019180601f8401121561038b5782516100b0610055826103d5565b9360208086848152019260051b82010192831161038b57602001905b82821061037b57505050600160045580518251036103445760028151106102ff57600091825b82518410156102a3576001600160a01b0361010d85856103ec565b511661011985846103ec565b5190801561026d57811561023b578060005260016020526040600020546101f657600054680100000000000000008110156101e05760018101806000558110156101ca577f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b03191682179055600090815260016020526040902081905581019081106101b4576001909301926100f2565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152601360248201527f6475706c696361746520726563697069656e74000000000000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600a6024820152697a65726f20736861726560b01b6044820152606490fd5b60405162461bcd60e51b815260206004820152600e60248201526d1e995c9bc81c9958da5c1a595b9d60921b6044820152606490fd5b612710036102ba576040516108d390816104018239f35b60405162461bcd60e51b815260206004820152601860248201527f736861726573206d7573742073756d20746f20313030303000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601a60248201527f6e656564206174206c65617374203220726563697069656e74730000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e0d8cadccee8d040dad2e6dac2e8c6d608b1b6044820152606490fd5b81518152602091820191016100cc565b600080fd5b82516001600160a01b038116810361038b57815260209283019201610077565b6040519190601f01601f191682016001600160401b038111838210176101e057604052565b6001600160401b0381116101e05760051b60200190565b80518210156101ca5760209160051b01019056fe6080806040526004361015610049575b50361561001b57600080fd5b6040513481527f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77060203392a2005b60003560e01c9081630e57d4ce146103865750806319bc9ae81461035257806322eabb8e14610334578063406072a9146102e357806348b7504414610237578063580fc80a1461014f578063ce7c2ac214610115578063d3cd52bc146100f85763d79779b2146100b9573861000f565b346100f35760203660031901126100f3576001600160a01b036100da61044e565b1660005260026020526020604060002054604051908152f35b600080fd5b346100f35760003660031901126100f35760206040516127108152f35b346100f35760203660031901126100f3576001600160a01b0361013661044e565b1660005260016020526020604060002054604051908152f35b346100f35760203660031901126100f35761016861044e565b6101766001600454146104b2565b6002600455600080546000925b8184106101a5576020836101988115156104ea565b6001600455604051908152f35b909160005484101561022157600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5638401546001600160a01b0316906101ed8284610547565b918215610216579161020b91610206826001958761061e565b610524565b935b01929190610183565b50936001915061020d565b634e487b7160e01b600052603260045260246000fd5b346100f35760403660031901126100f35761025061044e565b610258610464565b6102666001600454146104b2565b60026004556001600160a01b038116600090815260016020526040902054156102ac576101988261029983602095610547565b9283916102a78315156104ea565b61061e565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd0818481c9958da5c1a595b9d608a1b6044820152606490fd5b346100f35760403660031901126100f3576102fc61044e565b610304610464565b6001600160a01b039182166000908152600360209081526040808320949093168252928352819020549051908152f35b346100f35760003660031901126100f3576020600054604051908152f35b346100f35760403660031901126100f357602061037e61037061044e565b610378610464565b90610547565b604051908152f35b346100f35760003660031901126100f35760005490818152602081018092600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639060005b81811061042f57505050816103e391038261047a565b6040519182916020830190602084525180915260408301919060005b81811061040d575050500390f35b82516001600160a01b03168452859450602093840193909201916001016103ff565b82546001600160a01b03168452602090930192600192830192016103cd565b600435906001600160a01b03821682036100f357565b602435906001600160a01b03821682036100f357565b90601f8019910116810190811067ffffffffffffffff82111761049c57604052565b634e487b7160e01b600052604160045260246000fd5b156104b957565b60405162461bcd60e51b81526020600482015260096024820152681c99595b9d1c985b9d60ba1b6044820152606490fd5b156104f157565b60405162461bcd60e51b815260206004820152600b60248201526a6e6f7468696e672064756560a81b6044820152606490fd5b9190820180921161053157565b634e487b7160e01b600052601160045260246000fd5b9060018060a01b038116600052600160205260406000205480156105d657610592610571846107ee565b6001600160a01b039094166000818152600260205260409020549094610524565b81810291818304149015171561053157612710900491600052600360205260406000209060018060a01b031660005260205260406000205481039081116105315790565b505050600090565b3d15610619573d9067ffffffffffffffff821161049c576040519161060d601f8201601f19166020018461047a565b82523d6000602084013e565b606090565b9060018060a01b03821691826000526003602052604060002060018060a01b0383166000526020526040600020610656858254610524565b90558260005260026020526040600020610671858254610524565b9055826107025750600080808086855af161068a6105de565b50156106c85760207f8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429915b6040519485526001600160a01b031693a3565b60405162461bcd60e51b81526020600482015260126024820152711b985d1a5d99481cd95b990819985a5b195960721b6044820152606490fd5b6000809160405182602082019163a9059cbb60e01b835260018060a01b03871660248201528860448201526044815261073c60648261047a565b51925af16107486105de565b816107b6575b501561077d5760207f8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429916106b5565b60405162461bcd60e51b81526020600482015260116024820152701d1bdad95b881cd95b990819985a5b1959607a1b6044820152606490fd5b80518015925082156107cb575b50503861074e565b81925090602091810103126100f3576020015180151581036100f35738806107c3565b6001600160a01b03811615610898576000809160405160208101906370a0823160e01b82523060248201526024815261082860448261047a565b51915afa6108346105de565b908061088c575b15610854576020818051810103126100f3576020015190565b60405162461bcd60e51b815260206004820152601060248201526f18985b185b98d953d98819985a5b195960821b6044820152606490fd5b5060208151101561083b565b50479056fea2646970667358221220b7acc83225b1b24ac146b7d7b13f519463cdb1240685a1c71e6a9becd1cf8b7e64736f6c63430008230033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000111111111111111111111111111111111111111100000000000000000000000022222222222222222222222222222222222222220000000000000000000000003333333333333333333333333333333333333333000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000007d0keccak256(initCode):0xd11937fd36bf8b0dfde790ba9cb10a61aaebf12de24b685ce70dfdd2a8721af9
Full deploy(initCode) calldata:
0x0077436000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000e1460806040523461038b57610cd480380380610019816103b0565b92833981019060408183031261038b5780516001600160401b03811161038b5781019082601f8301121561038b57815161005a610055826103d5565b6103b0565b9260208085848152019260051b8201019085821161038b57602001915b818310610390575050506020810151906001600160401b03821161038b57019180601f8401121561038b5782516100b0610055826103d5565b9360208086848152019260051b82010192831161038b57602001905b82821061037b57505050600160045580518251036103445760028151106102ff57600091825b82518410156102a3576001600160a01b0361010d85856103ec565b511661011985846103ec565b5190801561026d57811561023b578060005260016020526040600020546101f657600054680100000000000000008110156101e05760018101806000558110156101ca577f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b03191682179055600090815260016020526040902081905581019081106101b4576001909301926100f2565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b60405162461bcd60e51b815260206004820152601360248201527f6475706c696361746520726563697069656e74000000000000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600a6024820152697a65726f20736861726560b01b6044820152606490fd5b60405162461bcd60e51b815260206004820152600e60248201526d1e995c9bc81c9958da5c1a595b9d60921b6044820152606490fd5b612710036102ba576040516108d390816104018239f35b60405162461bcd60e51b815260206004820152601860248201527f736861726573206d7573742073756d20746f20313030303000000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601a60248201527f6e656564206174206c65617374203220726563697069656e74730000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e0d8cadccee8d040dad2e6dac2e8c6d608b1b6044820152606490fd5b81518152602091820191016100cc565b600080fd5b82516001600160a01b038116810361038b57815260209283019201610077565b6040519190601f01601f191682016001600160401b038111838210176101e057604052565b6001600160401b0381116101e05760051b60200190565b80518210156101ca5760209160051b01019056fe6080806040526004361015610049575b50361561001b57600080fd5b6040513481527f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77060203392a2005b60003560e01c9081630e57d4ce146103865750806319bc9ae81461035257806322eabb8e14610334578063406072a9146102e357806348b7504414610237578063580fc80a1461014f578063ce7c2ac214610115578063d3cd52bc146100f85763d79779b2146100b9573861000f565b346100f35760203660031901126100f3576001600160a01b036100da61044e565b1660005260026020526020604060002054604051908152f35b600080fd5b346100f35760003660031901126100f35760206040516127108152f35b346100f35760203660031901126100f3576001600160a01b0361013661044e565b1660005260016020526020604060002054604051908152f35b346100f35760203660031901126100f35761016861044e565b6101766001600454146104b2565b6002600455600080546000925b8184106101a5576020836101988115156104ea565b6001600455604051908152f35b909160005484101561022157600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5638401546001600160a01b0316906101ed8284610547565b918215610216579161020b91610206826001958761061e565b610524565b935b01929190610183565b50936001915061020d565b634e487b7160e01b600052603260045260246000fd5b346100f35760403660031901126100f35761025061044e565b610258610464565b6102666001600454146104b2565b60026004556001600160a01b038116600090815260016020526040902054156102ac576101988261029983602095610547565b9283916102a78315156104ea565b61061e565b60405162461bcd60e51b815260206004820152600f60248201526e1b9bdd0818481c9958da5c1a595b9d608a1b6044820152606490fd5b346100f35760403660031901126100f3576102fc61044e565b610304610464565b6001600160a01b039182166000908152600360209081526040808320949093168252928352819020549051908152f35b346100f35760003660031901126100f3576020600054604051908152f35b346100f35760403660031901126100f357602061037e61037061044e565b610378610464565b90610547565b604051908152f35b346100f35760003660031901126100f35760005490818152602081018092600080527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5639060005b81811061042f57505050816103e391038261047a565b6040519182916020830190602084525180915260408301919060005b81811061040d575050500390f35b82516001600160a01b03168452859450602093840193909201916001016103ff565b82546001600160a01b03168452602090930192600192830192016103cd565b600435906001600160a01b03821682036100f357565b602435906001600160a01b03821682036100f357565b90601f8019910116810190811067ffffffffffffffff82111761049c57604052565b634e487b7160e01b600052604160045260246000fd5b156104b957565b60405162461bcd60e51b81526020600482015260096024820152681c99595b9d1c985b9d60ba1b6044820152606490fd5b156104f157565b60405162461bcd60e51b815260206004820152600b60248201526a6e6f7468696e672064756560a81b6044820152606490fd5b9190820180921161053157565b634e487b7160e01b600052601160045260246000fd5b9060018060a01b038116600052600160205260406000205480156105d657610592610571846107ee565b6001600160a01b039094166000818152600260205260409020549094610524565b81810291818304149015171561053157612710900491600052600360205260406000209060018060a01b031660005260205260406000205481039081116105315790565b505050600090565b3d15610619573d9067ffffffffffffffff821161049c576040519161060d601f8201601f19166020018461047a565b82523d6000602084013e565b606090565b9060018060a01b03821691826000526003602052604060002060018060a01b0383166000526020526040600020610656858254610524565b90558260005260026020526040600020610671858254610524565b9055826107025750600080808086855af161068a6105de565b50156106c85760207f8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429915b6040519485526001600160a01b031693a3565b60405162461bcd60e51b81526020600482015260126024820152711b985d1a5d99481cd95b990819985a5b195960721b6044820152606490fd5b6000809160405182602082019163a9059cbb60e01b835260018060a01b03871660248201528860448201526044815261073c60648261047a565b51925af16107486105de565b816107b6575b501561077d5760207f8ac5b3c2902b21b6bbb4d99ec195e28a242cb6a1777804db10b84d91e2006429916106b5565b60405162461bcd60e51b81526020600482015260116024820152701d1bdad95b881cd95b990819985a5b1959607a1b6044820152606490fd5b80518015925082156107cb575b50503861074e565b81925090602091810103126100f3576020015180151581036100f35738806107c3565b6001600160a01b03811615610898576000809160405160208101906370a0823160e01b82523060248201526024815261082860448261047a565b51915afa6108346105de565b908061088c575b15610854576020818051810103126100f3576020015190565b60405162461bcd60e51b815260206004820152601060248201526f18985b185b98d953d98819985a5b195960821b6044820152606490fd5b5060208151101561083b565b50479056fea2646970667358221220b7acc83225b1b24ac146b7d7b13f519463cdb1240685a1c71e6a9becd1cf8b7e64736f6c63430008230033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000003000000000000000000000000111111111111111111111111111111111111111100000000000000000000000022222222222222222222222222222222222222220000000000000000000000003333333333333333333333333333333333333333000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000013880000000000000000000000000000000000000000000000000000000000000bb800000000000000000000000000000000000000000000000000000000000007d0000000000000000000000000Both examples are regenerated verbatim by node compile-fee-splitter.cjs
(also written to example-2way-50-50.txt / example-3way-50-30-20.txt).
Split shapes we actually use (why this exists)
| Shape | recipients / sharesBps |
|---|---|
| Ship tax — captain keeps 90%, 10% flows upstream to the kingdom | [captain, kingdom] / [9000, 1000] |
| Court prize-pool split — the 10/20/20/20/20 shape our live game tax runs | [a, b, c, d, e] / [1000, 2250, 2250, 2250, 2250] |
| Creator / charity / ops | [creator, charity, ops] / [7000, 2000, 1000] |
Any N, any bps mix — the only rule is the shares sum to exactly 10000.
Gotchas — read before your first deploy
- Immutable means immutable. A typo'd recipient can never be fixed —
deploy a new splitter instead. Funds already inside a mis-configured
splitter follow ITS shares forever. Check every address twice. sum(sharesBps) != 10000(or any zero address, zero share, duplicate
recipient, length mismatch, < 2 recipients) makes the deploy revert —
the factory surfaces it ascreate failed.- Native shares need a payable recipient. A recipient CONTRACT with no
receive()/fallback cannot take its native share — itsrelease()reverts
(other recipients are unaffected). Use EOAs or receive()-capable contracts
for native flows. ERC20 shares always deliver. releaseAllis all-or-nothing — one failing transfer reverts the whole
batch. Per-accountrelease()is the path a single bad recipient can never
block.- Rounding dust: floor division can leave < N wei (N = recipient count)
of a token in the contract at any moment; later inflows reabsorb it. Never
more than that, never claimable by a third party. - Fee-on-transfer tokens split what the splitter actually received;
a transfer-out fee is borne by that recipient. Rebasing-DOWN tokens are
unsupported (accounting reverts if the balance shrinks underneath it). - The splitter has no owner concept at all, so the usual factory gotcha
("msg.sender in the constructor is the factory") is harmless here.
Reproduce the build
{ "language": "Solidity",
"settings": { "viaIR": true, "optimizer": { "enabled": true, "runs": 200 },
"evmVersion": "paris" } }solc 0.8.35+commit.47b9dedd over FeeSplitter.sol → matchescreation-bytecode.txt (3,284 bytes) and FeeSplitter-abi.json byte for byte
(node compile-fee-splitter.cjs checks the compiler pin and rebuilds all
artifacts + examples). Runtime size 2,259 bytes — nowhere near the 24,576
EIP-170 cap. evmVersion: paris means the identical bytecode also works on
other EVM chains (e.g. Robinhood Chain 4663) via the factory twin there.