Uniswap / v3-core

🦄 🦄 🦄 Core smart contracts of Uniswap v3
https://uniswap.org
Other
4.38k stars 2.68k forks source link

Refund otherwise lost tokens (deposited using unsupported functions) #583

Open tristartom opened 1 year ago

tristartom commented 1 year ago

Uniswap V3 pool only supports token deposit by approve/transferFrom. If a user deposits a token by transfer (by mistake), the token would be lost permanently in today's Uniswap V3 design. A more user-friendly design is to refund the otherwise lost tokens.

There are two designs to do so: 1) Redesign the pool smart contract for the next version of Uniswap (say V4). 2) The other direction is to build an off-chain service retrofittable to deployed Uniswap V3 pool contracts (i.e., without changing the smart contract).

tristartom commented 1 year ago

In this issue, may we know if supporting token refund is a necessary feature?

jchen217 commented 1 year ago

We build a solution to this issue: basically the pool contract can be extended with ETHRelay to allow refund of the lost token, in a secure way: https://github.com/Uniswap/v3-core/pull/595

please review the code.

jchen217 commented 1 year ago

Is our change included in the main branch of UniswapV3 pool? Can the locked token be returned now?