Divide by 0 error as totalSupply()
can be equal to 0
#102
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
duplicate
This issue or pull request already exists
Handle
Dravee
Vulnerability details
Impact
Divide by 0 panic error.
Proof of Concept
The check exists in the
_mint()
function to prevent a divide by 0 error:However,
sNote.sol:getPoolTokenShare()
doesn't check fortotalSupply() != 0
:Neither does
getVotingPower()
:Tools Used
VS Code
Recommended Mitigation Steps
Check that
totalSupply() != 0
before divisionThe text was updated successfully, but these errors were encountered: