-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Add toUint, toInt and hexToUint to Strings #5166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 34 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
b2eedbe
Strings: add toUint, toInt and hexToUint
Amxx efd2f30
codespell
Amxx bc42b25
Update contracts/utils/Strings.sol
Amxx 07f4b44
Update .changeset/eighty-hounds-promise.md
Amxx 40ba631
Update contracts/utils/Strings.sol
Amxx 07ec518
Update Strings.sol
Amxx 95fb0db
Apply suggestions from code review
Amxx f263819
Update contracts/utils/Strings.sol
Amxx f51fbe6
Update Strings.sol
Amxx 52a301b
Fix value variable
cairoeth 027859e
make return explicit
Amxx a91a999
branchless
Amxx 86abf5a
Update contracts/utils/Strings.sol
Amxx 6dca3cb
Update contracts/utils/Strings.sol
Amxx a7a6e9e
add try variants + use for governor proposal parsing
Amxx ec9a659
parseAddress
Amxx 568dc7b
use string literal for 0x
Amxx 0292c31
Apply suggestions from code review
Amxx aea4a14
add support for + prefix in parseInt
Amxx cf78a9f
Remove invalid "memory-safe" annotation.
Amxx 26cec97
Merge branch 'master' into feature/parse-strings
Amxx 3a7f904
Merge branch 'master' into feature/parse-strings
Amxx 4d18729
Add Bytes.sol
Amxx c7a7c94
codespell
Amxx d6319e8
cleanup
Amxx b3bf461
Update .changeset/eighty-hounds-promise.md
Amxx 2ab63b7
Update .changeset/rude-cougars-look.md
Amxx 231b93b
optimization
Amxx 24f1490
optimization
Amxx 43f0dc1
testing
Amxx 7b7c1fd
comment update
Amxx 2abfa49
Update contracts/utils/Strings.sol
Amxx f433e6d
making unsafeReadBytesOffset private
Amxx 27c7c0d
optimize
Amxx 75e1e4c
Update contracts/utils/README.adoc
Amxx 4f48757
Update contracts/governance/Governor.sol
Amxx 1ec1e3f
rename parseHex to parseHexUint
Amxx 53d72d7
fix tests
Amxx c5790f8
optimize
Amxx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`Strings`: Add `parseUint`, `parseInt`, `parseHex` and `parseAddress` to parse strings into numbers and addresses. Also provide variants of these functions that parse substrings, and `tryXxx` variants that do not revert on invalid input. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.