Closed sherlock-admin2 closed 1 year ago
Note on Sponsor Disputed tag:
See lines 17-18 of contracts/claim/abstract/CrosschainMerkleDistributor.sol
:
* @notice Distributes funds to beneficiaries listed in a merkle proof on Connext-compatible chains. Every beneficiary
* must be included in exactly one merkle leaf.
If the admin constructing the merkle root follows these instructions this problem cannot occur. I agree that it would be fun to change the mapping(address => DistributionRecord) internal records;
to mapping(hashOfAddressAndDomain => DistributionRecord)
, and we considered making this update, but it's not needed for any actual use cases.
If i got it right: Simply put ,this contract is not intended to allow to have the same address on different chains as a beneficiary?
@Shogoki - exactly: this would be a bug if we had thought this was possible, but it's not an intended use case and that comment is there to warn potential users.
Gonna close this, as it is a design decision.
n33k
high
If the same user address have claimables on different chains, he will lose tokens
Summary
records
in Distributor.sol is a mapping from address to claim records. If one address have claimables on different chains, the records could overlap, resulting in user loss.Vulnerability Detail
We can see that in Distributor.sol that
records
is a mapping from address to claim records.The same address will share a same record with a same
claimed
field. This field is increasing only, so user will lossing he claimables because of the overlapping.Impact
User lose claimables if he has claimables on different chains.
Code Snippet
https://github.com/sherlock-audit/2023-06-tokensoft/blob/main/contracts/contracts/claim/abstract/Distributor.sol#L47-L85
Tool used
Manual Review
Recommendation
Add a mapping key of domain in records in CrosschainDistributor.