the shares value might be incorrect if the _tokenamount was 0
Summary
the shares value might be incorrect if the _tokenamount was 0
Vulnerability Detail
if the _tokenamount was zero it will cause such problems as division by zero because uint shares = _tokenAmount * _sharesTotalSupply / _supplied;
0*x = 0 / y => division by zero scenario
Impact
it can cause wrong logic calculations in shares value and can cause certain issues.
Avci
high
the shares value might be incorrect if the _tokenamount was 0
Summary
the shares value might be incorrect if the _tokenamount was 0
Vulnerability Detail
if the _tokenamount was zero it will cause such problems as division by zero because
uint shares = _tokenAmount * _sharesTotalSupply / _supplied;
0*x = 0 / y => division by zero scenarioImpact
it can cause wrong logic calculations in shares value and can cause certain issues.
Code Snippet
https://github.com/sherlock-audit/2023-02-surge/blob/main/surge-protocol-v1/src/Pool.sol#L199
Tool used
Manual Review
Recommendation
consider adding require to prevent zero in amount
Duplicate of #261