Skip to content

Commit c8e9e3c

Browse files
committed
Make boolToUint clean the upper bits
1 parent 45bbe87 commit c8e9e3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contracts/utils/math/Math.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ library Math {
541541
function boolToUint(bool b) internal pure returns (uint256 u) {
542542
/// @solidity memory-safe-assembly
543543
assembly {
544-
u := b
544+
u := iszero(iszero(b))
545545
}
546546
}
547547
}

0 commit comments

Comments
 (0)