Missing validation check in totalSupply() #170
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
SolidityScan
Vulnerability details
Description
The value of
totalSupply()
at https://github.com/code-423n4/2022-01-notional/blob/main/contracts/sNOTE.sol#L260does not check if the value of totalSupply is 0 or not and it is per
Impact
The return value for the function
getPoolTokenShare
can be invalid because if there's an error in thetotalSupply()
the code at Line 260 will evaluate to divide by zero creating inconsistencies in the function logic.Proof of Concept
bptBalance * sNOTEAmount
Recommended Mitigation Steps
Add a check if the value of
totalSupply()
is zero or not or some other edge cases that can cause inconsistencies.The text was updated successfully, but these errors were encountered: