Skip to content

Commit

Permalink
馃摑 Better comment on TokenLib unsafe equal
Browse files Browse the repository at this point in the history
  • Loading branch information
KONFeature committed Aug 25, 2023
1 parent 1eeb8cb commit a50af11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/TokenLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ using TokenLib for Token global;
using { unsafeEquals as == } for Token global;

/// @notice Check if a token equals another
/// @dev Mark it as unsafe since we don't have any upper byte protection
/// @dev Mark it as unsafe since we don't have any upper byte cleaning, so address 0x00000000000011111111111111111111
/// will not be considered equals to 0xdead0000000011111111111111111111, even if they are the same if we were to used
/// address(...) == address(...)
function unsafeEquals(Token self, Token other) pure returns (bool isEquals) {
assembly {
// Warn, no upper byte protection here
isEquals := eq(self, other)
}
}
Expand Down

0 comments on commit a50af11

Please sign in to comment.