Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contracts with the same name in an account? #2252

Closed
LanfordCai opened this issue Jan 16, 2023 · 2 comments
Closed

Contracts with the same name in an account? #2252

LanfordCai opened this issue Jan 16, 2023 · 2 comments
Assignees
Labels
Bug Something isn't working Feedback

Comments

@LanfordCai
Copy link

Current Behavior

account.contracts.names may returns duplicate contract names

Expected Behavior

account.contracts.names returns unique contract names

Steps To Reproduce

script:

  pub fun main(address: Address): [String] {
    let account = getAccount(address)
    return account.contracts.names
  }

command:
flow scripts execute ./scripts/get_contracts.cdc 0xf233dcee88fe0abe --network=mainnet

result:
["FungibleToken", "FungibleToken", "FungibleTokenMetadataViews", "FungibleTokenSwitchboard"]

There are two "FungibleToken"

Environment

- Cadence version: v0.31.0
- Network: Mainnet
@LanfordCai LanfordCai added Bug Something isn't working Feedback labels Jan 16, 2023
@turbolent
Copy link
Member

@LanfordCai Thanks for reporting this inconsistency!

@turbolent
Copy link
Member

Notes:

Cadence gets the contract names of an account by calling into FVM through the runtime.Interface.GetAccountContractNames function. It seems like FVM returns duplicates.

Pinged the Execution team for feedback (https://dapperlabs.slack.com/archives/C03C40ZV82C/p1673891470638519)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Feedback
Projects
None yet
Development

No branches or pull requests

6 participants