Patagia Golem

Operation Patagia : Getting Golem on Uniswap

By pierce | Titor Technologies | 18 Aug 2020


TL;DR: You can trade Golem tokens (GNT) on Uniswap now: https://uniswap.info/pair/0x4b0ca81240feaf1d9b3e314a116a2da6e67cce7d

Slightly longer version:  Technically you need to trade GNTW on Uniswap, but I made a frontend that makes it as easy as possible to wrap and unwrap GNT as needed: https://gnt.guru

GNT.GURU when holding some GNTW

So, what gives? There's this super awesome token, GNT, which once graced the ranks of the top 10 on Coinmarketcap (https://cointelegraph.com/news/golem-is-10th-most-valuable-crypto), it's an OG ERC20 token on the Ethereum network, and has been cranking out some of the most cutting edge research in the space, and yet somehow, when you search for it on Uniswap, it isn't there. Weird right?

So here's the story. Golem really was was one of the first tokens in the space. GNT was launched November 2016. This was before the the big explosion of ERC20 tokens happened in 2017, and the memories of the DAO hack were still fresh in everyone's mind. The ERC20 token standard had included a pair of function, approve() and transferFrom(), which would allow users to give permission to other users, or smart contracts, to move tokens on their behalf. This was scary, and not well tested at the time, so the Golem team made the call and decided not to include them in their token. Unfortunately, here we are, almost four years later, and transferFrom() is the cornerstone of decentralized finance. When you have things like lending pools and automated market makers, you need to be able to hand control of tokens over to smart contracts.

This isn't the first time Golem has been left out in the cold. Ether Delta was a very early decentralized exchange, and people noticed pretty quickly that Golem was incompatible with it. This was the first time that I saw someone create an ERC20 wrapper for GNT, as described in this reddit post recorded for the ages here: https://np.reddit.com/r/ethereum/comments/5cs2n4/erc20compliant_wrapper_token_for_gnt_will_enable/

More recently, I kept seeing posts on /r/golemtrader with people asking why they didn't see GNT on uniswap. I decided that just for kicks, I would dig up that old EtherDelta wrapper, and create the exchange myself. Unfortunately, the old EtherDelta wrapper/unwrapper (https://etherdelta.com/gntw.html) was broken, and the code was super dense, so I took it upon myself to make my own.

First, I went to where the code was in Etherscan (https://etherscan.io/address/0x936f78b9852d12f5cb93177c1f84fb8513d06263#code) pulled it down, dropped it into remix, made sure I was using the right compiler version, "Injected Web3" from Metamask, and used the "Load contract from Address" button to point the contract to where the code was already sitting on Mainnet. I scrolled down and hit a couple of the view functions to make sure I was pointing at the right place, like so:

Loading GNTW into Remix

 

Okay, cool, we can interact with the wrapper. I spent some time wrapping and unwrapping GNT manually to get a feel for how it all worked. If you look at the history of this contract, you might notice me interacting with it starting on July 28th 2020. It had been about a year since anyone used it at that point, and even then its use was rare.

After all that, the rest was pretty straight forward. I built a garbage UX in HTML 1.0 to provide a basic interface for what I wanted wrapping and unwrapping to look like, and then I hammered out some EthersJS code to make it actually work. I tried to align the UX somewhat with how the code functions, so people who are familiar with the wrapping and unwrapping process should be able to make sense of the code pretty quickly. It's all up on my GitHub here https://github.com/pierce403/gnt.guru and deployed live here https://gnt.guru, so have at it. If you think you can make a better UX (and I bet you can!) please contribute, I'd love to accept some pull requests to pretty this thing up a bit. It's all static HTML, so if you feel safer pulling it down and running it locally, that's okay too.

After I had myself a nice batch of GNTW, I went over to Uniswap and created the exchange. The initial price was set at about 8 cents per GNT, which is a pretty good deal now that it's been pumping a bit. I also threw in about 80k GNT of liquidity a few days ago, so it can actually be used regularly without much slippage. Anyway, the dream is now, GNT is on Uniswap. You can buy and sell GNTW on Uniswap, and convert it back and fourth between GNT whenever you feel like it. If you've got some extra GNT laying around, I'd recommend adding some to the liquidity pool, and earning some fees from people moving coins back and fourth. This will help stabilize the market, and reduce buying friction for GNT, which helps us all.

GNT on Uniswap

How do you rate this article?

0



Titor Technologies
Titor Technologies

Productive Futurology, explorations in beautiful tech.

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.