Base Token Store

Base Token Store

The easiest way to buy any token on Base in the familiar UX of an e-commerce site.

The problem Base Token Store solves

Users who want to buy tokens onchain currently need to learn a lot about how to use crypto before they can make a purchase. Users need to download wallet apps, create wallets, safely store their seed phrase, buy ETH on an exchange, send the ETH to their new wallet while ensuring they use the correct chain, find the DEX their tokens are trading on, and finally use the swap to buy the tokens.

That's too much to ask.

Base Token Store solves this problem by providing users a one-stop-shop of the most popular tokens on Base and allows users to buy the token just as easily as they would if the token was listed on Coinbase. Users simply spin up a smart wallet with a passkey, put tokens in their cart, and checkout using their Coinbase balance!

Challenges I ran into

Tracking how many swaps originate on Base Token Store is a problem with multiple solutions. I decided to send 1 wei for each swap to a fresh wallet so I can count up each swap that is made on the store. This 1 wei is sent on a per swap basis, not per batched transaction so that in the future, I can know that one tx hash has resulted in 4 swaps in the event I want to view which tokens have had the most swaps on the store.

Support for Coinbase smart wallet's RPCs are experimental and so finding ways to get the smart wallet to pop up took some finessing. I got over this by ultimately wrapping my Thirdweb app inside of a Wagmi app and used Wagmi for the transactions while using Thirdweb for everything else.

Since I cannot predict which DEX a token will use, I implemented Kyberswap's API to find the best route for swapping for each token. I bundle all of the transactions into one for the user so that their checkout experience feels like one-click to buy all of the tokens in their cart.

I am currently using Coingecko to pull the trending base meme tokens and I am still experimenting if this is the best way to surface tokens on the site.

Deciding how to rank which tokens show up on the homepage in a fair way has been challenging but relying on Coingecko's ranking seems to be the fairest play.

MagicSpend does not currently support sponsored gas transactions but hopefully that will be supported soon!

Very first version that was deployed before all of the new features and design iterations: https://streamable.com/nwb8tr

Tracks Applied (3)

Coinbase Smart Wallet

Buying meme coins is a common first onchain interaction however it is extremely cumbersome. Base Token Store provides ne...Read More

Paymaster and Bundler

Base Token Store sponsors the gas for the user in order to simplify the trading experience. The user will be able to pur...Read More

Payments Track

Base Token Store is an innovative token purchasing experience that mirrors the UX of an e-commerce site which drasticall...Read More

PAYMENTS with Stripe

Cheer Project

Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.

Discussion