Core contracts

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.

Flow of funds

  1. Receive: ETH and ERC20 tokens flow into the contract via send, transfer, or call and the contract's balance increases
  2. Distribute: Once a contract has a positive balance, anyone can call distributeETH or distributeERC20 and earn the distributor fee
  3. Withdraw: Anyone can call withdraw at any time for any account, thereby pushing that account's balance out of SplitMain to the account