Skip to content

When a token is in a list multiple times, it fails to load the token info #19

@fubuloubu

Description

@fubuloubu

Environment information

  • ape and plugin versions:
$ ape --version
0.2.7

$ ape plugins list
Installed Plugins:
  hardhat      0.2.2
  solidity     0.2.3
  tokens       0.2.0
  infura       0.2.0
  etherscan    0.2.1
  alchemy      0.2.0
  foundry      0.2.0
  vyper        0.2.0
  ens          0.2.0
  • Python Version: 3.9.9
  • OS: linux

What went wrong?

Not quite sure what happens here, and may be related to the error shown in #18, but it appears that if a token is in a list multiple times, it will not properly handle that result and fail to find a matching token.

$ ape tokens list-tokens --search APE
...
0x4d224452801aced8b2f0aebe155379bb5d594381 (APE)
0x40e0a6ef9dbadfc83c5e0d15262feb4638588d77 (APE)
...
0x26ea1f595f6567b7050fbba24f6a66e19db4d560 (APE)

How can it be fixed?

May have to expose alternative flags to filter down on, like what decimals it has, address, etc.
Or, offer a way to ignore specific entries in a list in this scenario.

Might need to be moved to py-tokenlists

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions