TLDR:
Zen Swap is a swapping service for Zen Academy’s Denizen NFTs where users can swap their own Denizens 1-to-1 for Denizens held in the swap wallet.
Zen Swap is super simple, below I demonstrate both the simplicity of its usage and the underlying code that we wrote to make it possible.
If you own a Denizen, give it a go and let me know your feedback, we’d love to hear how you found it and any further suggestions.
After almost an entire month travelling I’m back to work mode and excited to get back to writing my regular posts.
Each week in the last 4 weeks I’ve re-shared an old post from last year, which worked quite well so I imagine that I’ll do this again in the future on particularly busy weeks or when I’m away again.
This week I decided to write about a Web3 app we built for Zen Academy that was released early last month that’s gotten some great usage and positive feedback called Zen Swap!
Zen Academy’s Denizens
Zeneca is an influencer in the Web3 space who created the Zen Academy community. The community is predominantly focused on educating people about the space, with a bias towards trading and keeping up with trends as Zeneca himself is a trader and investor.
Last year Zen Academy launched a PFP collection called the “Denizens” that were an evolution of his original NFT, which gives you access to the Zen Academy community.
The original collection were all identical NFTs, meanwhile the Denizens are a classic PFP collection where each Denizen has it’s own traits. You can an example of a Denizen below, in particular this one is mine that I use within the community:
As an active member of Zen Academy I’ve collaborated with them in the past releasing a course together called 30 Days of NFT Tech.
So when he announced he was planning to have a specific wallet to sweep Denizen NFTs and allow other community members to swap them, I suggested we come together to work on a bespoke app to do this and he agreed, which led to the creation of Zen Swap!
Zen Swap
Zen Swap was therefore built with a clear intention of providing a visual interface for people to swap Denizens with one of Zeneca’s wallets used to sweep floor Denizen NFTs. We released it early last month in May ’24 and it’s already had plenty of usage!
Below I’ll highlight how simple it is to use and swap your own Denizens. On opening the site start by connecting your wallet.
You’ll then be shown the Denizens in your wallet. Select the one you want to swap and press Continue. In this case my wallet afox.eth only has 1 Denizen. If you don’t have a Denizen then you can pick them up for around 0.05 ETH on Blur right now.
By pressing “Continue” you’ll be shown all the Denizens available in the Denizen swapping wallet, there’s currently around 130 in there and I’m sure that number will grow over time.
Next just select the one(s) you want to trade with and hit “Continue” again. Note that you can do multiple trades at once, so if have 3 Denizens for example, you can trade all of them for 3 from the swapping wallet.
The final screen will show you the Denizen(s) that you’re swapping in and the Denizen(s) you’ll get back in return. You need to approve the contract to swap the Denizens for you, then sign the transaction to swap them and you’re done!
As you can see the steps are super simple. As of today we’ve already had over 80 swaps and the feedback has been really positive!
Code
Since my posts often discuss slightly more technical concepts, I wanted to have a brief look at the inner workings of the app so that you the reader can learn a bit about how it works.
Firstly, there’s no active back-end (ie. no server) here, there’s just a website front-end that shows all the pretty images you saw above and a smart contract on the Ethereum network that the front-end interacts with in the background.
The smart contract code itself is incredibly simple too. It firstly has a few utility and admin functions, like the ability to pause the contract and set the correct swapping wallet, which we’ve called the “delegator”.
Then the real work in the smart contract happens in our swap function, which is also really simple.
All the code does is make sure you have an equal number of swaps on either side, and then transfers the NFTs with the “safeTransferFrom” function. Transferring your old NFTs into the delegator address and the new ones from the delegator to you!
As you can see the code is as elegant and succinct as we could make it.
Looking forward
Zen Swap has been built with the potential to grow further as Zeneca needs, for example we can add different mechanics like points for people who are more active swappers. It all depends on what Zeneca and ZenAcademy need and want.
So far Zeneca, the community, and ourselves have been very happy with the result.
We’d actually built something similar before for Seedphrase as part of his Swapshop brand with Sheep and Chop swapping services for Wolf Game.
Considering we’ve now done this a couple of times we may offer the development of a bespoke swapping app for other projects in the future too, but there’s nothing certain here.
If you haven’t tried Zen Swap then you can get yourself a Denizen on secondary and give it a go, or you can buy a ZenChest and burn it for a Denizen and then swap it with Zen Swap you don’t like the one you received!
If you do try out Zen Swap please do feel free to send me any feedback you may have.