Skip to content

Fix etherscan urls#217

Merged
CharlVS merged 9 commits intodevfrom
fix-etherscan-urls
Sep 18, 2025
Merged

Fix etherscan urls#217
CharlVS merged 9 commits intodevfrom
fix-etherscan-urls

Conversation

@smk762
Copy link
Copy Markdown
Contributor

@smk762 smk762 commented Sep 9, 2025

Closes GLEECBTC/gleec-wallet#3098

  • Updates url builder for https://etherscan-proxy-v2.komodo.earth/ to use token contract address (not swap contract address).
  • Updates get_token_info to ensure mixed case contract address and avoid checksum fail errors

To test:

  • Add a custom token for PLG20/BEP20/AVX20/ERC20, and use lowercase contract address.
    • Ensure the correct network is returned.
    • Ensure non-error response (confirmed address conversion to mixed case)
  • Enter PLG20/BEP20/AVX20/ERC20 token wallet page with balance and prior transaction activity. History should be populated (There is some work pending in https://github.com/KomodoPlatform/etherscan-mm2-proxy/ so this may not be ready for a few hours)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 9, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-etherscan-urls

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

cursor[bot]

This comment was marked as outdated.

@CharlVS CharlVS requested a review from Copilot September 16, 2025 15:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes Etherscan URL generation issues by correcting the URL builder to use token contract addresses instead of swap contract addresses, and ensures mixed case contract addresses to avoid checksum validation errors.

Key changes:

  • Updated Etherscan URL builder to use token contract address instead of swap contract address
  • Modified get_token_info to handle mixed case contract addresses and prevent checksum failures
  • Enhanced custom asset handling with proper parent-child relationship parsing

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
etherscan_transaction_history_strategy.dart Updated URL construction to use token contract address and added validation
custom_asset_history_storage.dart Added knownAssets parameter for proper asset parsing with parent relationships
activation_manager.dart Updated custom token activation flow and improved asset refresh notification timing
asset_manager.dart Passed known assets to custom asset history retrieval
coin_config_repository.dart Implemented two-pass asset parsing strategy and added AssetParser dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +138 to +139
/// NOTE: Parent/child relationships are not rebuilt for single asset retrieval.
/// Use [getAssets] if you need proper parent relationships.
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This limitation could lead to inconsistent behavior when retrieving individual assets vs collections. Consider adding a warning log or throwing an exception when parent/child relationships are expected but not available in single asset retrieval.

Copilot uses AI. Check for mistakes.
cursor[bot]

This comment was marked as outdated.

some of the conversion operations likely change the order of the original list and keys, which caused a segfault on linux
Copy link
Copy Markdown
Contributor

@takenagain takenagain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested on Web and Linux.

I made the following follow-up changes:

  • Removed the convertaddress call from the RPC library, since it is already being called elsewhere.
  • Fixed parent->child relationships when loading from storage (a62b1c6 and 45fe71b)
  • Fixed issues that were brought to light by the Linux build (2f6000c and db9c957)

@CharlVS CharlVS merged commit d0ebd75 into dev Sep 18, 2025
5 of 9 checks passed
@takenagain takenagain deleted the fix-etherscan-urls branch September 22, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 Major issue that needs to be fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants