Skip to content

fix(evm-api): find enabled erc20 token using platform ticker#2445

Merged
mariocynicys merged 10 commits intodevfrom
fix-chain-id-issue-2375
May 26, 2025
Merged

fix(evm-api): find enabled erc20 token using platform ticker#2445
mariocynicys merged 10 commits intodevfrom
fix-chain-id-issue-2375

Conversation

@laruh
Copy link
Copy Markdown

@laruh laruh commented May 7, 2025

fixes #2375

borngraced
borngraced previously approved these changes May 12, 2025
Copy link
Copy Markdown

@borngraced borngraced left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

Comment on lines +98 to +100
token_conf: &Json,
) -> MmResult<Option<MmCoinEnum>, String> {
let chain_id = token_conf["chain_id"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: we better let the param be the chain_id instead. that aligns more with the function name.

// `is_custom` was added to avoid this unnecessary check for non-custom tokens
if is_custom {
match get_enabled_erc20_by_contract(&ctx, protocol.token_addr).await {
match get_enabled_erc20_by_contract_chain_id(&ctx, protocol.token_addr, &token_conf).await {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Q: token_conf["chain_id"] is supposed to be the same as self.chain_id? no?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

there is no eth_coin.chain_id anymore after tron pr merge #2425
I will update this branch

@laruh laruh force-pushed the fix-chain-id-issue-2375 branch from 8d2090b to cbd0c5b Compare May 13, 2025 08:02
@laruh laruh changed the title fix(evm-api): find enabled erc20 token using chain id fix(evm-api): find enabled erc20 token using platform ticker May 14, 2025
@laruh laruh requested review from borngraced and mariocynicys May 14, 2025 18:02
mariocynicys
mariocynicys previously approved these changes May 15, 2025
Copy link
Copy Markdown
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM!

@laruh
Copy link
Copy Markdown
Author

laruh commented May 20, 2025

@mariocynicys sami approved pr, as you also approved it earlier could you do some final check and merge pr?

@smk762
Copy link
Copy Markdown

smk762 commented May 26, 2025

@laruh Does this PR require any updates to docs or coins repo?

@laruh
Copy link
Copy Markdown
Author

laruh commented May 26, 2025

@laruh Does this PR require any updates to docs or coins repo?

nope, its just an inner bug fix

@mariocynicys mariocynicys merged commit 68319c0 into dev May 26, 2025
24 of 33 checks passed
@mariocynicys mariocynicys deleted the fix-chain-id-issue-2375 branch May 26, 2025 11:09
dimxy pushed a commit that referenced this pull request May 27, 2025
* dev:
  fix(evm-api): find enabled erc20 token using platform ticker (#2445)
  chore(docs): add DeepWiki badge to README (#2463)
  chore(core): organize deps using workspace.dependencies (#2449)
  feat(db-arch): more dbdir to address_dir replacements (#2398)
dimxy pushed a commit that referenced this pull request May 28, 2025
* dev: (29 commits)
  fix(p2pk): validate expected pubkey correctly for p2pk inputs (#2408)
  chore(docs): update old urls referencing atomicdex or old docs pages (#2428)
  improvement(p2p): remove hardcoded seeds (#2439)
  fix(evm-api): find enabled erc20 token using platform ticker (#2445)
  chore(docs): add DeepWiki badge to README (#2463)
  chore(core): organize deps using workspace.dependencies (#2449)
  feat(db-arch): more dbdir to address_dir replacements (#2398)
  chore(build-artifacts): remove duplicated mm2 build artifacts (#2448)
  feat(pubkey-banning): expirable bans (#2455)
  fix(eth-balance-events): serialize eth address using AddrToString (#2440)
  chore(deps): remove base58 and replace it completely with bs58 (#2427)
  feat(tron): initial groundwork for full TRON integration (#2425)
  fix(UTXO): improve tx fee calculation and min relay fee handling (#2316)
  deps(timed-map): bump to 1.3.1 (#2413)
  improvement(tendermint): safer IBC channel handler (#2298)
  chore(release): complete v2.4.0-beta changelogs  (#2436)
  fix(event-streaming): initial addresses registration in utxo balance streaming (#2431)
  improvement(watchers): re-write use-watchers handling (#2430)
  fix(evm): make withdraw_nft work in HD mode (#2424)
  feat(taproot): support parsing taproot output address types
  ...
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Jun 8, 2025
* lr-swap-wip: (37 commits)
  fix custom token error name
  fix getting chain_id from protocol_data
  refactor (review): use dedicated large error cfg, add new fn to FromApiValueError, fix TODO, use experimental namespace for lr rpc, more Ticker alias
  feat(walletconnect): add WalletConnect v2 support for EVM and Cosmos (GLEECBTC#2223)
  feat(ibc-routing-part-1): supporting entire Cosmos network for swaps (GLEECBTC#2459)
  fix(test): fix HD Wallet message signing tests (GLEECBTC#2474)
  improvement(builds): enable static CRT linking for MSVC builds (GLEECBTC#2464)
  feat(wallet): implement HD multi-address support for message signing (GLEECBTC#2432)
  fix(p2pk): validate expected pubkey correctly for p2pk inputs (GLEECBTC#2408)
  chore(docs): update old urls referencing atomicdex or old docs pages (GLEECBTC#2428)
  improvement(p2p): remove hardcoded seeds (GLEECBTC#2439)
  fix(evm-api): find enabled erc20 token using platform ticker (GLEECBTC#2445)
  chore(docs): add DeepWiki badge to README (GLEECBTC#2463)
  chore(core): organize deps using workspace.dependencies (GLEECBTC#2449)
  feat(db-arch): more dbdir to address_dir replacements (GLEECBTC#2398)
  chore(build-artifacts): remove duplicated mm2 build artifacts (GLEECBTC#2448)
  feat(pubkey-banning): expirable bans (GLEECBTC#2455)
  fix(eth-balance-events): serialize eth address using AddrToString (GLEECBTC#2440)
  chore(deps): remove base58 and replace it completely with bs58 (GLEECBTC#2427)
  feat(tron): initial groundwork for full TRON integration (GLEECBTC#2425)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review findings: add chain_id to get_enabled_erc20_by_contract fn

4 participants