Core contracts
This section describes the various smart contract building blocks upon which all payment flows are built.
Flow of funds
We recommend reading the flow of funds page if you haven't already. The below diagram shows the different methods for moving funds through the system. Though each contract's distribution logic is unique, the general three steps are the same.
- Receive: ETH and ERC20 tokens flow into the contract via
send
,transfer
, orcall
and the contract's balance increases. - Distribute: Once a contract has a positive balance, anyone can call
distribute
,distributeETH
ordistributeERC20
depending on the version of the split and earn the distributor fee. - Withdraw: Anyone can call
withdraw
at any time for any account, thereby pushing that account's balance out of SplitWarehouse or SplitMain to the account.