-
Notifications
You must be signed in to change notification settings - Fork 1
Silvermist - TokenSale.sol#calculateMaxAllocation() Incorrect return values #158
Comments
Escalate Since the escalation period is coming to an end and there were no sponsor comments at all, I am escalating this issue because it's not clear if it's indended or not |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Had the same issue, sponsors weren't responding much so I was unable to confirm whether this was valid issue or design choice. |
I believe this statement continuously increases user allocation even beyond maximum.. thus the reason why the if statement above to regulate the max allocation |
The protocol team fixed this issue in the following PRs/commits: |
@Hash01011122 @Czar102 Just noticed this but my issue #172 is incorrectly marked a duplicate of #152 when it is a duplicate of this issue instead. Honestly thought all of these were duplicates until I took a closer look. |
@Hash01011122 Do I understand correctly that you want to make this report valid? |
@Evert0x Yeah this is a valid finding and sponsors have confirmed it too. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Planning to accept escalation and make issue family Medium |
@Evert0x Can you make sure to duplicate #172 with this? It is the same issue but was duplicated with something else incorrectly. @Hash01011122 please confirm |
@Hash01011122 revisiting the issue. It's unclear what the protocol intention is with this function. It's one of the two below.
Is there any code comment / discord message that indicates the intention of the protocol team? |
I believe it's clear that 2) is the case https://discord.com/channels/812037309376495636/1217849746845339678/1219806056625078313 Planning to reject escalation and keep issue invalid |
I think if the protocol intended it to exceed max. They won’t fix it as stated above. |
Result: |
Escalations have been resolved successfully! Escalation status:
|
The Lead Senior Watson signed off on the fix. |
Silvermist
medium
TokenSale.sol#calculateMaxAllocation() Incorrect return values
Summary
A user can have 0 allocations and get the
maxAllocation
or a user can exceed the maximum allocations.Vulnerability Detail
maxAllocation
is the max baseline a user can invest in a pool. However, swapped return values allow a user to have 0 allocations and get themaxAllocation
or to exceed the maximum allocations.Impact
A user can have 0 allocations and get the
maxAllocation
or a user can exceed the maximum allocationsCode Snippet
https://github.com/sherlock-audit/2024-03-zap-protocol/blob/c2ad35aa844899fa24f6ed0cbfcf6c7e611b061a/zap-contracts-labs/contracts/TokenSale.sol#L259-L267
Tool used
Manual Review
Recommendation
Duplicate of #152
The text was updated successfully, but these errors were encountered: