totalshares can be 0 and function can be reverted.
Summary
totalshares can be 0 and function can be reverted.
Vulnerability Detail
baseAmount = baseBalance shareAmount / totalShares;
quoteAmount = quoteBalance shareAmount / totalShares;
Here totalshares can be 0 and function can be reverted.
bareli
medium
totalshares can be 0 and function can be reverted.
Summary
totalshares can be 0 and function can be reverted.
Vulnerability Detail
baseAmount = baseBalance shareAmount / totalShares; quoteAmount = quoteBalance shareAmount / totalShares; Here totalshares can be 0 and function can be reverted.
Impact
Function can be reverted if totalshares can be 0.
Code Snippet
https://github.com/sherlock-audit/2023-12-dodo-gsp/blob/main/dodo-gassaving-pool/contracts/GasSavingPool/impl/GSPFunding.sol#L112
Tool used
Manual Review
Recommendation
use a require statement to verify the total shares.