feat(tx): decode UTF-8 text in transaction input data#320
Merged
AugustoL merged 1 commit intoopenscan-explorer:devfrom Mar 16, 2026
Merged
feat(tx): decode UTF-8 text in transaction input data#320AugustoL merged 1 commit intoopenscan-explorer:devfrom
AugustoL merged 1 commit intoopenscan-explorer:devfrom
Conversation
When ABI decoding fails, attempt to decode the hex input as UTF-8 text. If ≥80% of characters are printable, show the decoded text above the raw hex in a readable pre-formatted block. This handles text messages embedded in transactions like the Ethereum Foundation mandate. Closes openscan-explorer#311
|
🚀 Preview: https://pr-320--openscan.netlify.app |
MatiasOS
approved these changes
Mar 16, 2026
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.
Description
When transaction input data is not an ABI-encoded function call, attempt to decode it as UTF-8 text. If the result is mostly printable characters (≥80%), display it in a readable pre-formatted block above the raw hex.
Related Issue
Closes #311
Type of Change
Changes Made
tryDecodeUtf8()utility insrc/utils/inputDecoder.ts— decodes hex to bytes, runs through TextDecoder, checks printable ratioInputDataTabto show "UTF-8 Decoded Text" section when ABI decode fails but UTF-8 decode succeeds.tx-input-utf8CSS styles (scrollable pre block, max 400px height)analyser.utf8Texti18n key to all 5 localesTest Transaction
Checklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errorsnpm run test:run