Skip to content

Commit 2ff87d9

Browse files
committed
DFP-3: Silent Underflow to Zero
1 parent e0595d4 commit 2ff87d9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contracts/InverseApi3ReaderProxyV1.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ contract InverseApi3ReaderProxyV1 is IInverseApi3ReaderProxyV1 {
2424
}
2525

2626
/// @notice Returns the inverted value of the underlying IApi3ReaderProxy
27-
/// @dev The operation will revert if `baseValue` is zero (division by zero).
27+
/// @dev Calculates `int224(1e36) / baseValue`. The operation will revert if
28+
/// `baseValue` is zero. If `baseValue` is non-zero but its absolute value is
29+
/// greater than `1e36`, the result of the integer division will be `0`.
2830
/// @return value Inverted value of the underlying proxy
2931
/// @return timestamp Timestamp of the underlying proxy
3032
function read()

0 commit comments

Comments
 (0)