Swapping unsupported tokens in Uniswap via the web interface

0
71

Swapping unsupported tokens through Uniswap via the web interface

Forbidden Tokens By Sebastião Teixeira

Introduction

Recently, it was announced on the Uniswap Blog the restriction of certain tokens through app.uniswap.org, due to the evolution of the regulatory environment. This restriction has been applied solely and exclusively to the web application in the app.uniswap.org domain that serves as a graphical interface for the common user.

Smart contracts are immutable and, therefore, it is still possible to perform swaps with unsupported tokens through the interface, with solidity, or through the web3 library.

The list of unsupported tokens is mainly made up of synthetics from protocols such as Synthetix, UMA and Mirror. Also included are option protocol tokens, such as Opyn, and other governance tokens, such as dYdX. The complete up-to-date list of unsupported tokens on app.uniswap.com can be found here.

The main centralization point in most DeFi protocols is precisely in the webapp that allows the common user interaction with the protocol, however, several solutions have emerged in recent years for this problem, such as IPFS, Swarm, ENS, Unstoppable Domains and Namecoin.

Uniswap over IPFS

IPFS (InterPlanetary File System) is a peer-to-peer hypermedia protocol that allows for the storage and sharing of information over a decentralized network. On June 30, 2020 Uniswap officially announced on the blog the decentralization of hosting the Uniswap Interface using IPFS.

IPFS uses content-based addressing, that is, a hash address is generated based on the information contained in the files. Thus, different files are associated with different addresses. To solve this problem Uniswap uses DNSRecord to map the app.uniswap.org address to the address of the latest version of the webapp and uses ENS to map app.uniswap.eth to it.

Accessing unsupported tokens

As we can see below, token restrictions have only been applied to the app.uniswap.org domain, and in case of a different domain from this one, localUnsupportedListMap will be empty.

// ln. 35 uniswap-interface/src/constants/misc.ts/
export window && = const IS_ON_APP_URL window.location.hostname === ‘app.uniswap.org’
// ln. 120–121 uniswap-interface/src/state/lists/hooks.ts/
// get hard coded unsupported tokens, only block on app url
const localUnsupportedListMap = useMe => (IS_ON_APP_URL ? listToTokenMap(UNSUPPORTED_TOKEN_LIST) : {}), [])

You can find the full code at https://github.com/Uniswap/uniswap-interface.

Thus, it is possible to have full access to the Uniswap Dapp through the ENS domain or through an IPFS node. For example:

https://app.uniswap.eth.link/#/

https://cloudflare-ipfs.com/ipns/app.uniswap.org/#/

https://app-uniswap-org.ipns.dweb.link/#/

http://127.0.0.1:8080/ipns/app.uniswap.eth.link/#/ (if you are running your own IPFS node)

https://app.uniswap.org vs https://app.uniswap.eth.link/#/

You can also find the IPFS addresses from different Uniswap graphical interface versions on github. This way, you have the option to choose which version of the interface you want to use, giving you independence from future GUI updates.

Conclusion

Thanks to technology and the advancement of decentralized networks, restricting access in a decentralized application becomes impractical.

I hope this helps all those who want to learn a little more about the DeFi universe and who are looking to decentralize the Internet.

If you found any inaccuracies in this article, please leave a comment.

Disclaimer

Each and every example referred to throughout this article is for education as its sole and exclusive purpose, so it should not be treated as financial advice.

References

Uniswap Blog articles:

https://uniswap.org/blog/token-access-app/

https://uniswap.org/blog/ipfs-uniswap-interface/

IPFS Docs:

IPFS Documentation

Join Coinmonks Telegram Channel and learn about crypto trading and investing

Also, Read


Swapping unsupported tokens in Uniswap via the web interface was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.