♻️ Improve Transaction Parsing and Identify On-Chain Rejections #38
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.
🕓 Changelog
This PR fixes a bug in the
print_decoded_datafunction's nested transaction parser, making it more robust. Previously, the logic could fail on common transaction structures. The updated implementation now correctly handles thevalueDecodedfield whether it's a single object or an array, and reliably extracts method names across different data schemas, ensuring accurate parsing of nested calls.Furthermore, this PR enhances
print_decoded_databy adding support for detecting on-chain rejections. Previously, transactions withdata == 0xwere always displayed as ETH transfers, even when they were semantically rejections. The script now distinguishes between on-chain rejections (where thetoaddress equals the multisig address andvalueis0), ETH self-transfers (where thetoaddress equals the multisig andvalueis non-zero), zero-value ETH transfers (where thetoaddress is different butvalueis0), and standard ETH transfers (where thetoaddress is different andvalueis non-zero). This improves the clarity and accuracy of decoded transaction output.Test Examples
./safe_hashes.sh --network ethereum --address 0xb35096b074fdb9bBac63E3AdaE0Bbde512B2E6b6 --nonce 559returns:
./safe_hashes.sh --network sepolia --address 0x657ff0D4eC65D82b2bC1247b0a558bcd2f80A0f1 --nonce 3returns: