Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Add ERC-20 compatibility check when creating a new exchange #49

Open
gundas opened this issue Mar 5, 2020 · 1 comment
Open

Add ERC-20 compatibility check when creating a new exchange #49

gundas opened this issue Mar 5, 2020 · 1 comment

Comments

@gundas
Copy link

gundas commented Mar 5, 2020

Hello,
I have a small suggestion - currently Uniswap has about 2400 exchanges deployed. A few of the tokens (still) do no fully support ERC-20. The worst was BNB, but there are others - PKG, XYO etc.

Maybe it would be a good idea to a do a simple token compatibility test when creating a new exchange:

assert(token.transferFrom(msg.sender, address(this),1))
assert(token.transfer(msg.sender,1))

This small check would prevent people from loosing money.

What do you think? Maybe it is not too late to implement it in V2?

@gundas
Copy link
Author

gundas commented Mar 6, 2020

Alternatively, the Exchange contract could require that addLiquidity/removeLiquidity operations should be tested before allowing to add liquidity to the exchange (this could be done by having a method which adds and removes liquidity as well as sets a flag one the two operations are successful).

There are many ways to implement this safeguard.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant