Open code423n4 opened 3 years ago
We check that totalDerivativeTimeWeight
is not zero in the first branch, and due to the ordering of the check (eg check totalUnderlyingTimeWeight
first then totalDerivativeTimeWeight
you shouldn't be able to enter the second branch in the case where totalDerivativeTimeWeight = 0
.
The same is true for the third branch since it is an else if check
Marking this as invalid as @raymogg's explanation makes sense.
Handle
a_delamo
Vulnerability details
Impact
On the
calculateTWAP
method, we should add the following validations to prevent division by zero