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
distributeETH
ordistributeERC20
and earn the distributor fee - Withdraw: Anyone can call
withdraw
at any time for any account, thereby pushing that account's balance out of SplitMain to the account