SplitMain :
Split recipients, ownerships, and keeper fees are stored onchain as calldata & re-passed as args / validated via hashing when needed. Each split gets its own address & proxy for maximum composability with other contracts onchain. For these proxies, we extended EIP-1167 Minimal Proxy Contract to avoid `DELEGATECALL` inside `receive()` to accept hard gas-capped `sends` & `transfers`.
distributeERC20(address,address,address[],uint32[],uint32,address) :
`accounts`, `percentAllocations`, and `distributorFee` are verified by hashing & comparing to the hash in storage associated with split `split`pernicious ERC20s may cause overflow in this function inside _scaleAmountByPercentage, but results do not affect ETH & other ERC20 balances
distributeETH(address,address[],uint32[],uint32,address) :
`accounts`, `percentAllocations`, and `distributorFee` are verified by hashing & comparing to the hash in storage associated with split `split`
transferControl(address,address) :
Two-step control transfer inspired by [dharma](https://github.com/dharma-eng/dharma-smart-wallet/blob/master/contracts/helpers/TwoStepOwnable.sol)
updateAndDistributeERC20(address,address,address[],uint32[],uint32,address) :
only callable by SplitControllerpernicious ERC20s may cause overflow in this function inside _scaleAmountByPercentage, but results do not affect ETH & other ERC20 balances
updateAndDistributeETH(address,address[],uint32[],uint32,address) :
only callable by SplitController
SplitWallet :
`SplitProxy` handles `receive()` itself to avoid the gas cost with `DELEGATECALL`.
sendERC20ToMain(address,uint256) :
payable reduces gas cost; no vulnerability to accidentally lock ETH introduced since fn call is restricted to SplitMain
sendETHToMain(uint256) :
payable reduces gas cost; no vulnerability to accidentally lock ETH introduced since fn call is restricted to SplitMain
ERC20 :
Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
SafeTransferLib :
Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.