DEV Community

Cover image for CookieSwap: a different kind of cookie!

Posted on

CookieSwap: a different kind of cookie!


Recently a devnet was launched for the XRPL EVM sidechain. This is exciting as it allows developers to deploy smart contracts in the same way you would on Ethereum, except on a XRPL sidechain :)

This blog entry will serve a quick intro to CookieSwap and the EVM sidechain. Subsequent entries to this series will teach developers how to deploy a token contract using Remix and how to create liquidity pairs on CookieSwap with those tokens.

What is CookieSwap?

CookieSwap is a fork of the uniswap v2 automated market maker (AMM). This allows for users to deposit liquidity that others can trade against. In return for this service, liquidity providers earn a fee from every trade executed through that pool. End users benefit from a simpler trading interface and ability to always receive a price quote (thanks to the constant product market maker model).

Want to try out CookieSwap?
CookieSwap Contract: 0x662EdB2cfD0E17EAc617bEfE7E4182BC5137dc1e
If your VPN blocks CookieSwap from loading, try the ENS domain link

Connecting to CookieSwap

There are a few quick steps we need to take before we can use CookieSwap and the EVM devnet.

  1. Download and setup MetMask
  2. Get XRPL Devnet Credentials (comes with 1000 test xrp)
  3. Add account to Xumm using these credentials
  4. On Xumm, go to settings > advanced > node and select "dev net"
  5. Bridge the test XRP from XRPL to the EVM sidechain
  6. Visit CookieSwap and connect to the application with metamask
  7. Swap XRP for tokens :)

CookieSwap Info

When using CookieSwap, if you swap XRP for a token listed on the UI, even if the swap is successful, it won't appear in your metamask wallet unless you've imported the token contract address. However, these token swaps will always be viewable on the block explorer.

Below are example tokens and their coresponding addresses. Go ahead and import these addresses into your metamask wallet. If you haven't swapped for these tokens yet, you will see a balance of 0 after importing the token addresses.

cookieUSD (cUSD): 0x83E7B126c047424c3ed018357df0376b980060EC

LOL Token (LOL): 0x57eE425952c44618bDf9751317F2096BaCC05341

Wrapped XRP (wXRP): 0x0192e8d1a428a7eea10b9a3c70f2fe2f70fbbd97

Note: Wrapped XRP is not a token you trade against. XRP gets wrapped 1:1 as an ERC20 token to allow for compatibility with other ERC20 tokens when swapping/adding liquidity. This is a standard practice on EVM based chains.

In the next blog we explore how to create an ERC20 token and deploy it to the XRPL EVM sidechain. We will then build on that knowledge to programmatically interact with CookieSwap, bypassing the UI, using common libraries such as ethers.js and web3.js.

If you have any questions in the meantime, feel free to contact me on twitter @hazardcookie

Top comments (0)