sherlock-audit / 2024-02-optimism-2024-judging

6 stars 4 forks source link

Packing Comment is incorrect #233

Closed sherlock-admin2 closed 6 months ago

sherlock-admin2 commented 7 months ago

Packing Comment is incorrect

Low/Info issue submitted by GalloDaSballo

Summary

https://github.com/sherlock-audit/2024-02-optimism-2024/blob/main/optimism/packages/contracts-bedrock/src/libraries/DisputeTypes.sol#L48-L57

/// @notice A `GameId` represents a packed 1 byte game ID, an 11 byte timestamp, and a 20 byte address.
/// @dev The packed layout of this type is as follows:
/// ┌───────────┬───────────┐
/// │   Bits    │   Value   │
/// ├───────────┼───────────┤
/// │ [0, 8)    │ Game Type │
/// │ [8, 96)   │ Timestamp │ /// @audit 88 vs 64
/// │ [96, 256) │ Address   │
/// └───────────┴───────────┘
type GameId is bytes32;

I wasn't able to abuse this as timestamps are still capped at u64 so we'll just have a bunch of 0s

sherlock-admin4 commented 6 months ago

The protocol team fixed this issue in the following PRs/commits: https://github.com/ethereum-optimism/optimism/pull/10152