Skip to content

Commit

Permalink
document behaviour when multiple flags passed
Browse files Browse the repository at this point in the history
  • Loading branch information
hoytech committed Mar 22, 2024
1 parent 0517d86 commit ceed9b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/EVault/shared/types/Flags.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ pragma solidity ^0.8.0;
import {Flags} from "./Types.sol";

library FlagsLib {
/// @dev Are *all* of the flags in bitMask set?
function isSet(Flags self, uint32 bitMask) internal pure returns (bool) {
return (Flags.unwrap(self) & bitMask) != 0;
return (Flags.unwrap(self) & bitMask) == bitMask;
}

/// @dev Are *none* of the flags in bitMask set?
function isNotSet(Flags self, uint32 bitMask) internal pure returns (bool) {
return (Flags.unwrap(self) & bitMask) == 0;
}
Expand Down

0 comments on commit ceed9b6

Please sign in to comment.