Skip to content

fix(docs): correct UINT_40_MAX bit width (48 -> 40) in README#66

Open
MitkoTschimev wants to merge 1 commit into1inch:masterfrom
MitkoTschimev:fix/readme-uint40-max-bit-width
Open

fix(docs): correct UINT_40_MAX bit width (48 -> 40) in README#66
MitkoTschimev wants to merge 1 commit into1inch:masterfrom
MitkoTschimev:fix/readme-uint40-max-bit-width

Conversation

@MitkoTschimev
Copy link
Copy Markdown

Summary

The inline example in the README (line 28) defines UINT_40_MAX with the wrong bit width:

// Current (wrong — this is UINT_48_MAX)
const UINT_40_MAX = (1n << 48n) - 1n

// Fixed (correct 40-bit max)
const UINT_40_MAX = (1n << 40n) - 1n

Evidence

  • @1inch/byte-utils defines UINT_40_MAX = (1n << 40n) - 1n and UINT_48_MAX = (1n << 48n) - 1n as separate constants
  • MakerTraits.withNonce() docs state: "nonce must be less or equal to uint40::max"
  • The RFQ Order example on line 65 of the same README correctly imports UINT_40_MAX from @1inch/byte-utils

Impact

The wrong value happens to work in practice because the SDK's setMask operation truncates, but it is semantically incorrect and could mislead developers or cause issues if stricter validation is added.

The inline example on line 28 defined UINT_40_MAX as (1n << 48n) - 1n,
which is actually UINT_48_MAX. The correct value is (1n << 40n) - 1n,
matching @1inch/byte-utils constants and MakerTraits.withNonce() docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant