♻️ Enforce EIP-55 Checksums for Addresses #40
Merged
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 updates the
validate_addressfunction to enforce EIP-55 checksummed addresses. This ensures that all addresses submitted to the Safe transaction service API are correctly checksummed, preventing potential API errors caused by incorrectly-cased addresses. Furthermore, we redirect all error messages in the functionscheck_required_tools,get_latest_git_commit_hash, and the Bash version check tostderrfor proper error handling.Test Examples
Test Case 1
./safe_hashes.sh --network sepolia --address 0x657FF0D4EC65D82B2BC1247B0A558BCD2F80A0F1 --nonce 4returns:
Invalid checksum: "0x657FF0D4EC65D82B2BC1247B0A558BCD2F80A0F1" (expected "0x657ff0D4eC65D82b2bC1247b0a558bcd2f80A0f1")Test Case 2
./safe_hashes.sh --network sepolia --address 0x657ff0D4eC65D82b2bC1247b0a558bcd2f80A0f1 --nonce 4 --nested-safe-address 0x6bc56d6ce87c86cb0756c616becfd3cd32b09251 --nested-safe-nonce 4returns:
Invalid checksum: "0x6bc56d6ce87c86cb0756c616becfd3cd32b09251" (expected "0x6bc56d6CE87C86CB0756c616bECFD3Cd32b09251")