Appendices
/Test Coverage
Test Coverage
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines |
---|---|---|---|---|---|
contracts/ | 100 | 100 | 100 | 100 | |
SplitMain.sol | 100 | 100 | 100 | 100 | |
SplitWallet.sol | 100 | 100 | 100 | 100 | |
contracts/interfaces/ | 100 | 100 | 100 | 100 | |
ISplitMain.sol | 100 | 100 | 100 | 100 | |
contracts/libraries/ | 100 | 75 | 100 | 100 | |
Clones.sol | 100 | 75 | 100 | 100 | |
All files | 100 | 97.37 | 100 | 100 |
Files
Output
SplitMain
base
✓ Should create a SplitWallet on deployment
✓ Should be able to receive ETH
createSplit
immutable
✓ Should emit CreateSplit event with expected args
✓ Should revert if recreating split (44ms)
✓ Should set the hash
✓ Should set the controller
✓ Should leave newPotentialController blank
mutable
✓ Should emit CreateSplit event with expected args
✓ Should not revert if recreating mutable split (310ms)
✓ Should set the hash
✓ Should set the controller
✓ Should leave newPotentialController blank
validSplit
✓ Should revert if less than two accounts provided
✓ Should check array lengths match
✓ Should check all allocations sum to 100% (41ms)
✓ Should check accounts are ordered properly
✓ Should check all allocations are non-zero
✓ Should overflow if an allocation is negative
✓ Should revert if distributorFee is above 10%
predictImmutableSplitAddress
base
✓ Correctly predicts the address
validSplit
✓ Should revert if less than two accounts provided
✓ Should check array lengths match
✓ Should check all allocations sum to 100%
✓ Should check accounts are ordered properly
✓ Should check all allocations are non-zero
✓ Should overflow if an allocation is negative
✓ Should revert if distributorFee is above 10%
updateSplit
UpdateSplit
✓ Should emit UpdateSplit event with expected split address
✓ Correctly updates the hash
✓ Should revert if a non-controller sends tx
validSplit
✓ Should revert if less than two accounts provided
✓ Should check array lengths match
✓ Should check all allocations sum to 100% (38ms)
✓ Should check accounts are ordered properly
✓ Should check all allocations are non-zero
✓ Should overflow if an allocation is negative
✓ Should revert if distributorFee is above 10%
transferControl
✓ Should set newPotentialController
✓ Should emit InitiateControlTransfer with the expected args
✓ Should revert if transfer is attempted to Address(0)
✓ Should revert if a non-controller sends tx
cancelControlTransfer
✓ Should delete newPotentialController
✓ Should emit CancelControlTransfer with the expected args
✓ Should revert if a non-controller sends tx
acceptControl
✓ Should emit ControlTransfer event with the expected splitAddress, previousController, and newController
✓ Should transfer control
✓ Should delete newPotentialController
✓ Should revert if a non-newPotentialController sends tx
makeSplitImmutable
✓ Should emit ControlTransfer event with the expected splitAddress, previousController, and newController
✓ Should transfer control to AddressZero
✓ Should delete newPotentialController
✓ Should revert if a non-controller sends tx
distributeETH
Proxy balance = 0 & SplitMain balance = 0
✓ Should emit DistributeETH event with the expected args
Proxy balance = 0 & SplitMain balance = 1
✓ Should emit DistributeETH event with the expected args
Proxy balance > 1 & SplitMain balance > 1
DistributorFee > 0
✓ Should send ETH to SplitMain
✓ Should emit DistributeETH event with the expected args
✓ Shouldn't leak funds (111ms)
✓ Should check for a valid split hash
validSplit
✓ Should revert if less than two accounts provided
✓ Should check array lengths match
✓ Should check all allocations sum to 100%
✓ Should check accounts are ordered properly
✓ Should check all allocations are non-zero
✓ Should overflow if an allocation is negative
✓ Should revert if distributorFee is above 10%
DistributorFee = 0
✓ Shouldn't leak funds (70ms)
updateAndDistributeETH
UpdateSplit
✓ Should emit UpdateSplit event with expected split address
✓ Correctly updates the hash
✓ Should revert if a non-controller sends tx
distributeETH
Proxy balance = 0 & SplitMain balance = 0
✓ Should emit DistributeETH event with the expected args
Proxy balance = 0 & SplitMain balance = 1
✓ Should emit DistributeETH event with the expected args
Proxy balance > 1 & SplitMain balance > 1
DistributorFee > 0
✓ Should send ETH to SplitMain (43ms)
✓ Should emit DistributeETH event with the expected args (38ms)
✓ Shouldn't leak funds (87ms)
DistributorFee = 0
✓ Shouldn't leak funds (42ms)
validSplit
✓ Should revert if less than two accounts provided
✓ Should check array lengths match
✓ Should check all allocations sum to 100%
✓ Should check accounts are ordered properly
✓ Should check all allocations are non-zero
✓ Should overflow if an allocation is negative
✓ Should revert if distributorFee is above 10%
distributeERC20
Proxy & SplitMain balances = 0
✓ Should emit DistributeERC20 event with the expected args
Proxy balance = 1 & SplitMain balance = 0
✓ Should emit DistributeERC20 event with the expected args
Proxy balance = 0 & SplitMain balance = 1
✓ Should emit DistributeERC20 event with the expected args
Proxy balance > 1 & SplitMain balance > 1
DistributorFee > 0
✓ Should send ERC20 to SplitMain when balance > 1 (334ms)
✓ Should emit DistributeERC20 event with the expected args (321ms)
✓ Shouldn't leak funds (314ms)
✓ Should check for a valid split hash
validSplit
✓ Should revert if less than two accounts provided
✓ Should check array lengths match
✓ Should check all allocations sum to 100%
✓ Should check accounts are ordered properly
✓ Should check all allocations are non-zero
✓ Should overflow if an allocation is negative
✓ Should revert if distributorFee is above 10%
DistributorFee = 0
✓ Shouldn't leak funds (391ms)
updateAndDistributeERC20
UpdateSplit
✓ Should emit UpdateSplit event with expected split address (315ms)
✓ Correctly updates the hash (356ms)
✓ Should revert if a non-controller sends tx
distributeERC20
Proxy & SplitMain balances = 0
✓ Should emit DistributeERC20 event with the expected args
Proxy balance = 1 & SplitMain balance = 0
✓ Should emit DistributeERC20 event with the expected args
Proxy balance = 0 & SplitMain balance = 1
✓ Should emit DistributeERC20 event with the expected args
Proxy balance > 1 & SplitMain balance > 1
DistributorFee > 0
✓ Should send ERC20 to SplitMain when balance > 1 (347ms)
✓ Should emit DistributeERC20 event with the expected args (323ms)
✓ Shouldn't leak funds (324ms)
DistributorFee = 0
✓ Shouldn't leak funds (310ms)
validSplit
✓ Should revert if less than two accounts provided
✓ Should check array lengths match
✓ Should check all allocations sum to 100% (39ms)
✓ Should check accounts are ordered properly
✓ Should check all allocations are non-zero
✓ Should overflow if an allocation is negative
✓ Should revert if distributorFee is above 10%
withdraw
✓ Should send ETH to account (1036ms)
✓ Should revert if account fails to receive ETH (1483ms)
✓ Should send ERC20 to account (1921ms)
✓ Should revert if token transfer returns false (1387ms)
✓ Should revert if token transfer reverts (1457ms)
Should send ETH & ERC20 to account
✓ ETH
✓ ERC20 (45ms)
✓ Should emit Withdrawal event with expected args
Should revert if balance = 0
✓ ETH
✓ ERC20
SplitProxy
✓ Should be able to receive ETH
✓ Should emit ReceiveETH event with the expected args
SplitWallet
✓ Should store SplitMain's address (814ms)
sendETHToMain
✓ Should send ETH to SplitMain
✓ Should revert if not-SplitMain sends tx
sendERC20ToMain
✓ Should emit 'Transfer' from ERC20 with the expected args (380ms)
✓ Should change the token balances (307ms)
✓ Should revert if not-SplitMain sends tx
132 passing (3m)