The function predictSplitterAddress from HATPaymentSplitterFactory uses Clones.predictDeterministicAddress to predict the deployment address of a HATPaymentSplitter.
The issue is that HATPaymentSplitter.__PaymentSplitter_init has input validation that prevents the creation of certain payment splitters:
function __PaymentSplitter_init_unchained(address[] memory payees, uint256[] memory shares_) internal onlyInitializing {
require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch");
require(payees.length > 0, "PaymentSplitter: no payees");
for (uint256 i = 0; i < payees.length; i++) {
_addPayee(payees[i], shares_[i]);
}
}
This means that certain HATPaymentSplitterFactory.predictSplitterAddress addresses may never be created, if the input validation fails. As a result, if a user relies solely on HATPaymentSplitterFactory.predictSplitterAddress, and sends funds to this address before the payment splitter is deployed, the funds will be forever lost.
Recommendation
Add the input validation from HATPaymentSplitter.__PaymentSplitter_init on HATPaymentSplitterFactory.predictSplitterAddress so that the function reverts if an invalid input would result a revert.
Github username: @aviggiano Submission hash (on-chain): 0xc2da62902c49f6013d1ffe9aebfc1ab1a44aba778215d6208bde9d9edd2095d8 Severity: low
Description: Description
The function
predictSplitterAddress
fromHATPaymentSplitterFactory
usesClones.predictDeterministicAddress
to predict the deployment address of aHATPaymentSplitter
.The issue is that
HATPaymentSplitter.__PaymentSplitter_init
has input validation that prevents the creation of certain payment splitters:This means that certain
HATPaymentSplitterFactory.predictSplitterAddress
addresses may never be created, if the input validation fails. As a result, if a user relies solely onHATPaymentSplitterFactory.predictSplitterAddress
, and sends funds to this address before the payment splitter is deployed, the funds will be forever lost.Recommendation
Add the input validation from
HATPaymentSplitter.__PaymentSplitter_init
onHATPaymentSplitterFactory.predictSplitterAddress
so that the function reverts if an invalid input would result a revert.