Update 2.23.20

4 min readFeb 24, 2020


Update written by Adrian, our main developer!

Hey All,

This is just an update on the new build of SwitchDex and some other features that were pushed back due to all the delays in getting this update out. If you want specific timeframes just scroll to the end otherwise here’s a description of what went wrong and what’s left to do.

What went wrong?

As many of you know the first deadline for the new contract update was set to January 1st, almost two months ago. Since then it’s been a cascading amount of deadline delays while we sort out the update and get it ready for public consumption.

The first major issue we had was muir glacier, pushing an update before or during a hard fork period seemed like a terrible idea so we made the strategic decision to avoid that window until nodes had moved over to the new update. At the time this was the sensible move, releasing something completely decentralized during a period of uncertainty is a horrible idea as when something goes wrong we have no control over resolving it.

The update came with further updates on metamask, web3 and solidity. All of which came together to make what we were doing no longer possible in the framework that we had. The updates opened up the possibility of higher gas refunds and much more scaleable code but by taking advantage of this we were also running on the cutting edge of what was possible on ethereum and therefore operating completely in the dark.

The contract finished around January 17th, we added that to a test portal and all seemed well and good until token ownership became a huge issue. Suddenly, it was possible to trade on an order that had no tokens assigned to it. This turned out to be a nightmare to troubleshoot and solve as it was something completely out of left field. Everything had been working during testing so far but all of a sudden any new contract deployed had issues assigning token ownership to an address in a mapping.

After much work and talk with people more experienced in solidity and geth itself we solved that issue around February 10th.

Since then it’s been a daily job of just integrating this new contract completely into the site and resolving any bugs that popped up due to Solidity 0.6 changes and having to use ethers.js instead of web3 for a ton of business logic around the wallet to wallet functions.

Whats left to do?

This past week I’ve employed the help of extra developers so we could smash out the list of tasks that the integration had left and right now we are down to 3 tasks.

Auto matching is not firing off on buy trades, but it is on sell trades.

Trade history is slowing down the entire site and is most definitely not scale able.

The order book needs a much better scaling option as an order book with a high amount of orders slows the site to an unusable level.

That’s it, not a ton left to do but they are all crucial in their own way. The challenge with doing everything on-chain is really the lack of iterative programming that we can do. If this was a simple database-server application we could release as is and then solve scale ability as it scales since it won’t be an issue for the first 200 trades.

Unfortunately, you can’t work like that on smart contracts as once they are deployed migrating to a new contract means moving peoples funds, orders, whitelist’s and trade histories which not only costs an exorbitant amount but might not even be possible (moving funds without an approve is tricky at best).

So, deadlines!

New Dates

With the help of the extra people we’ve hired to get this done we are able to work a little more asynchronously and tie up loose ends at the same time as getting this contract out. So here’s time frames we are planning internally. We think we can get all these features and updates out in the coming weeks, and there is a lot more coming we havn’t told you guys about yet :)

New contract update — later this week

Atomic Swap Update — March 5th

Mid march

Switchdex added to instant swap on Switch.ag
Switch Widget
New Airdrop System
Automatic portal deployment

Late March

Intro screens + Desktop version of dex portals
Gambling games launched
Clearpoll DAO

Final Thoughts

I know everyone has been frustrated by the delays and I get it, no one is more frustrated than me! Going forward, we will be doing a weekly medium article much like this with more in-depth communication around what went wrong that week, date adjustments and what went well that week so everyone in the community can feel like they are part of the discussion. Remember we are releasing our final “bug free” product with everything we have been working on for years this May, so bear with us as we pump out all the new things :)




Switch.ag not only gives users the ability to seamlessly “switch” between tokens, but you can buy gift cards, gamble & more!