Skip to content

Commit

Permalink
fix reference implementation for updateStatus scale-down
Browse files Browse the repository at this point in the history
  • Loading branch information
MrToph committed Mar 5, 2024
1 parent 941831b commit ab953c5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions reference/lib/ReferenceOrderValidator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,9 @@ contract ReferenceOrderValidator is
|| denominator > type(uint120).max
) {
// Derive greatest common divisor using euclidean algorithm.
uint256 scaleDown = _greatestCommonDivisor(
numerator,
_greatestCommonDivisor(filledNumerator, denominator)
);
uint256 scaleDown = _greatestCommonDivisor(filledNumerator, denominator);

// Scale all fractional values down by gcd.
numerator = numerator / scaleDown;
// Scale new filled fractional values down by gcd.
filledNumerator = filledNumerator / scaleDown;
denominator = denominator / scaleDown;

Expand Down

0 comments on commit ab953c5

Please sign in to comment.