Skip to content

[Tx filtering] Wrong decimals when filtering by amount #4942

@katspaugh

Description

A bug was reported by a user that filtering incoming USDC txs by value doesn't work correctly.

Upon inspecting the request and response, it looks like the frontend is sending a request to CGW with a value converted to decimals with too many zeroes because it takes the default 18 decimals which is not correct for USDC.

Given that the filter is supposed to work without specifying a token address, i.e. only by amount, we cannot predict how many decimals a token must have.

I would suggest to fix this on the backend by allowing to specify an amount in its original formatted form, so that the history is filtered post-formatting.

E.g.

Txs:

  • Received 10 ETH
  • Received 1500 USDC
  • Received 1500 ETH
  • Received 100 USDT

When filtering by amount: 1500, it should find both the 1500 USDC and 1500 ETH transfers even though these tokens have different decimals.

How to reproduce

  • Go to a Safe with incoming USDC transfers
  • Open tx history
  • Filter by Incoming + Amount = some amount
  • 0 txs are shown

Links

A backend ticket: safe-global/safe-client-gateway#2340

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions