Skip to content

Allow tokens without valid pair details to be forwarded #7

Description

@Valdorff

First I'd like to confirm my understanding.

There's a swapper with an ERC20 token in it. The swapper is using a univ3 oracle. Using getPairDetails between that token and the target token returns [[0x0000000000000000000000000000000000000000,0]]. getQuoteAmounts reverts. I believe there is currently no way to recover these tokens forever. If the oracle had an owner, setPairDetails might provide a path, but that's not the case here. The swapper also has no owner.

If that's accurate, I'd like to suggest adding a forwardUnpricedToken function or similar. That would take in a target token, check that getPairDetails yields 0x0...0 as the pool from pair details, and then simply send the full amount of the target token on to the beneficiary. This might not always work (eg, the recipient may be unable to use that type of token), but it would certainly have prevented a loss in my case, and it seems unlikely this is the only time that's happened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions