Open sherlock-admin3 opened 5 months ago
Yes, can confirm, this seems like an issue.
ContinuousVestingInitializable
, TrancheVestingInitializable
— the getVestedFraction()
doesn't care about data
PerAddressContinuousVestingInitializable
, PerAddressTrancheVestingInitializable
— the getVestedFraction()
does care about data
The protocol team fixed this issue in the following PRs/commits: https://github.com/SoftDAO/contracts/pull/47
An additional PR covering a case that I didn't cover in PR 47 above: https://github.com/SoftDAO/contracts/pull/51
PR covering a case for PACVM https://github.com/SoftDAO/contracts/pull/52
The Lead Senior Watson signed off on the fix.
jkoppel
medium
AdvancedDistributorInitializable sets claim data to empty, making claims fail
Summary
AdvancedDistributorInitializable.claim overrides the passed-in data with new bytes(0). This data is needed by both PerAddressTrancheVestingMerkleDistributor and PerAddressContinuousVestingMerkleDistributor for claims to work. Therefore, claims do not work.
Vulnerability Detail
Impact
Claims do not work
Both PerAddressTrancheVestingMerkleDistributor and PerAddressContinuousVestingMerkleDistributor also pass in
new bytes(0)
to this argument, causing the same issue. However, this is a separate issue per my understanding of Sherlock rules; it is in separate code, and will stay broken if the others are fixed.Code Snippet
AdvancedDistributorInitializable calls DistributorInitializable._executeClaim with data=new bytes(0)
https://github.com/sherlock-audit/2024-05-tokensoft-distributor-contracts-update/blob/main/contracts/packages/hardhat/contracts/claim/factory/AdvancedDistributorInitializable.sol#L106-L113
DistributorInitializable._executeClaim forwards this data to getClaimableAmount, which forwards it to getVestedFraction
https://github.com/sherlock-audit/2024-05-tokensoft-distributor-contracts-update/blob/main/contracts/packages/hardhat/contracts/claim/factory/DistributorInitializable.sol#L75 https://github.com/sherlock-audit/2024-05-tokensoft-distributor-contracts-update/blob/main/contracts/packages/hardhat/contracts/claim/factory/DistributorInitializable.sol#L113
Many implementations of getVestedFraction attempt to decode this data in ways that break if the data is empty.
E.g.:
https://github.com/sherlock-audit/2024-05-tokensoft-distributor-contracts-update/blob/main/contracts/packages/hardhat/contracts/claim/factory/PerAddressContinuousVestingInitializable.sol#L30-L35
Putting these together, attempting to claim will be a lot like this Chisel section.
Tool used
Manual Review
Recommendation
Pass the data parameter along properly