fix(docs): correct UINT_40_MAX bit width (48 -> 40) in README#66
Open
MitkoTschimev wants to merge 1 commit into1inch:masterfrom
Open
fix(docs): correct UINT_40_MAX bit width (48 -> 40) in README#66MitkoTschimev wants to merge 1 commit into1inch:masterfrom
MitkoTschimev wants to merge 1 commit into1inch:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The inline example in the README (line 28) defines
UINT_40_MAXwith the wrong bit width:Evidence
@1inch/byte-utilsdefinesUINT_40_MAX = (1n << 40n) - 1nandUINT_48_MAX = (1n << 48n) - 1nas separate constantsMakerTraits.withNonce()docs state: "nonce must be less or equal touint40::max"UINT_40_MAXfrom@1inch/byte-utilsImpact
The wrong value happens to work in practice because the SDK's
setMaskoperation truncates, but it is semantically incorrect and could mislead developers or cause issues if stricter validation is added.