Skip to content

Commit 8956279

Browse files
committed
docs: clarify SQUARE_ROOTS_SCHEME is a bounds-check wrapper, not quantization
1 parent fe98190 commit 8956279

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/mechanisms/voting-strategy/ProperQF.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ abstract contract ProperQF {
2525
/// delta update pattern of _processVoteUnchecked; only per-project readback is lossy.
2626
Quant internal constant CONTRIBUTIONS_SCHEME = Quant.wrap(uint16((96 << 8) | 32));
2727

28-
/// @notice Packing scheme for sumSquareRoots: stored as uint160, shift=0 (no quantization).
29-
/// @dev Max value: 2^160 - 1 ~= 1.46e48. No quantization because QF math (S_j^2) is
30-
/// sensitive to rounding and sumSquareRoots operates in a sqrt-compressed range
31-
/// that needs full resolution per bit.
28+
/// @notice Bounds-check wrapper for sumSquareRoots: stored as uint160, no quantization (shift=0).
29+
/// @dev Max value: 2^160 - 1 ~= 1.46e48. Shift is 0 so encode/decode are identity functions;
30+
/// the Quant wrapper is used solely for the overflow check in encode() and to keep
31+
/// _readProject/_writeProject symmetric with CONTRIBUTIONS_SCHEME.
32+
/// No quantization because QF math (S_j^2) is sensitive to rounding and sumSquareRoots
33+
/// operates in a sqrt-compressed range that needs full resolution per bit.
3234
Quant internal constant SQUARE_ROOTS_SCHEME = Quant.wrap(uint16(160 << 8));
3335

3436
// Custom Errors

0 commit comments

Comments
 (0)