Skip to content

feat: verified token#1008

Merged
jaymengxy merged 2 commits intodevelopfrom
verified_token
May 9, 2025
Merged

feat: verified token#1008
jaymengxy merged 2 commits intodevelopfrom
verified_token

Conversation

@jaymengxy
Copy link
Copy Markdown
Contributor

Related Issue

Closes #809 #810 #811 #812

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@jaymengxy jaymengxy added this to the Release 2.8.5 milestone May 9, 2025
@jaymengxy jaymengxy self-assigned this May 9, 2025
@jaymengxy jaymengxy requested a review from a team as a code owner May 9, 2025 03:39
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2025

PR Summary

Refactored token management system to support verified tokens and improved token display functionality. Removed legacy balance and coin rate managers in favor of a new unified FungibleTokenListManager. Added support for both EVM and Flow tokens with enhanced token metadata and verification status.

Changes

File Summary
app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt Created new token management system that handles both EVM and Flow tokens, supports token verification status, and manages token display preferences. Includes caching and listener system for token updates.
app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt Implemented new token model supporting both EVM and Flow tokens with extended metadata including verification status, social links, and chain-specific details.
app/src/main/java/com/flowfoundation/wallet/manager/account/BalanceManager.kt Removed deprecated balance management system in favor of new FungibleTokenListManager implementation.
app/src/main/java/com/flowfoundation/wallet/manager/coin/CoinRateManager.kt Removed deprecated coin rate management system as functionality is now handled by FungibleTokenListManager.
app/src/main/java/com/flowfoundation/wallet/network/model/EVMTokenListResponse.kt Created model for EVM token list API responses with conversion to FungibleToken format.
app/src/main/java/com/flowfoundation/wallet/network/model/FlowTokenListResponse.kt Created model for Flow token list API responses with conversion to FungibleToken format.
app/src/main/java/com/flowfoundation/wallet/cache/DisplayTokenCacheManager.kt Implemented caching system for token display preferences and lists with serialization support.
app/src/main/java/com/flowfoundation/wallet/page/send/transaction/subpage/amount/SendAmountViewModel.kt Refactored to use new FungibleTokenListManager and FungibleToken model for handling token transfers and balance updates.
app/src/main/java/com/flowfoundation/wallet/manager/evm/EVMWalletManager.kt Modified token transfer and bridge operations to work with new FungibleToken model.
app/src/main/java/com/flowfoundation/wallet/manager/LaunchManager.kt Replaced legacy token managers with new FungibleTokenListManager in app initialization sequence.

autogenerated by presubmit.ai

Copy link
Copy Markdown

@github-actions github-actions Bot 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 needs attention.

Review Summary

Commits Considered (1)
Files Processed (30)
  • app/src/main/AndroidManifest.xml (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/cache/DisplayTokenCacheManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/firebase/config/FirebaseConfig.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/LaunchManager.kt (3 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/account/BalanceManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/coin/CoinRateManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/coin/CustomTokenManager.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/coin/FlowCoinListManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/evm/EVMWalletManager.kt (5 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/evm/Utils.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/flowjvm/CadenceExecutor.kt (3 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/network/ApiService.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/network/UserRegisterUtils.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/network/model/EVMTokenListResponse.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/network/model/FlowTokenListResponse.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/page/component/deeplinking/Utils.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/dialog/processing/send/SendProcessingViewModel.kt (5 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/dialog/processing/send/presenter/SendProcessingPresenter.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/inbox/InboxViewModel.kt (5 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/inbox/presenter/InboxTokenItemPresenter.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/main/Utils.kt (5 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/currency/CurrencyViewModel.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/currency/model/Currency.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/wallet/childaccountdetail/ChildAccountDetailViewModel.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/scan/Utils.kt (3 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/send/transaction/TransactionSendActivity.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/send/transaction/subpage/amount/SendAmountActivity.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/send/transaction/subpage/amount/SendAmountViewModel.kt (3 hunks)
Actionable Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt [161-162]

    possible bug: "Potential bug in token comparison logic"

Skipped Comments (3)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt [85-86]

    possible issue: "Potential memory leak in listener registration"

  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt [230-232]

    possible issue: "Potential race condition in cache update"

  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt [79-85]

    enhancement: "Improve numeric error handling"

Comment thread app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt Outdated
Copy link
Copy Markdown

@github-actions github-actions Bot 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 needs attention.

Review Summary

Commits Considered (1)
Files Processed (30)
  • app/src/main/AndroidManifest.xml (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/cache/DisplayTokenCacheManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/firebase/config/FirebaseConfig.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/LaunchManager.kt (3 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/account/BalanceManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/coin/CoinRateManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/coin/CustomTokenManager.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/coin/FlowCoinListManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/evm/EVMWalletManager.kt (5 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/evm/Utils.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/flowjvm/CadenceExecutor.kt (3 hunks)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/network/ApiService.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/network/UserRegisterUtils.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/network/model/EVMTokenListResponse.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/network/model/FlowTokenListResponse.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/page/component/deeplinking/Utils.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/dialog/processing/send/SendProcessingViewModel.kt (5 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/dialog/processing/send/presenter/SendProcessingPresenter.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/inbox/InboxViewModel.kt (5 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/inbox/presenter/InboxTokenItemPresenter.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/main/Utils.kt (5 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/currency/CurrencyViewModel.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/currency/model/Currency.kt (1 hunk)
  • app/src/main/java/com/flowfoundation/wallet/page/profile/subpage/wallet/childaccountdetail/ChildAccountDetailViewModel.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/scan/Utils.kt (3 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/send/transaction/TransactionSendActivity.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/send/transaction/subpage/amount/SendAmountActivity.kt (2 hunks)
  • app/src/main/java/com/flowfoundation/wallet/page/send/transaction/subpage/amount/SendAmountViewModel.kt (3 hunks)
Actionable Comments (2)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt [156-158]

    possible bug: "Fix incorrect self-comparison in token equality check"

  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt [228-232]

    possible issue: "Potential race condition in token list update"

Skipped Comments (2)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/FungibleTokenListManager.kt [167-171]

    enhancement: "Improve error handling in token list update"

  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt [74-80]

    best practice: "Add validation for token balance parsing"

Copy link
Copy Markdown

@github-actions github-actions Bot 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 needs attention.

Review Summary

Commits Considered (1)
  • c3dcb9a: feat: token detail verified info
Files Processed (1)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt (1 hunk)
Actionable Comments (1)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt [63-65]

    possible bug: "Potential null pointer exception in contract ID generation"

Skipped Comments (2)
  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt [107-109]

    best practice: "Hardcoded URL in token icon fallback"

  • app/src/main/java/com/flowfoundation/wallet/manager/token/model/FungibleToken.kt [149-149]

    readability: "Double negative condition reduces readability"

Comment on lines +63 to +65
fun contractId(): String {
return "A.${tokenAddress().removeAddressPrefix()}.${tokenContractName()}"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The contractId() function assumes both tokenAddress() and tokenContractName() return non-empty strings. However, for EVM tokens, tokenContractName() returns an empty string which could lead to malformed contract IDs. Consider adding null/empty checks or handling EVM tokens differently.


private fun onConfigLoadFinish() {
FlowCoinListManager.reload()
// FlowCoinListManager.reload()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we just remove it ?

@jaymengxy jaymengxy merged commit 92ffe61 into develop May 9, 2025
4 checks passed
@jaymengxy jaymengxy deleted the verified_token branch May 9, 2025 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Verified/Unverified Token Support - Token Dashboard Updates

2 participants