CookieSwap: a different kind of cookie!
Tags: xrpl, evm, web3, blockchain
Published: 2022-11-28 19:18:49

## Gm! 

Recently a devnet was launched for the [XRPL EVM sidechain](https://dev.to/ripplexdev/an-evm-sidechain-for-the-xrp-ledger-1pbi). 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](https://remix.ethereum.org/) 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?
[https://hazardcookie.com](https://hazardcookie.com)
[https://hazardcookie.eth.limo](https://hazardcookie.eth.limo)
**CookieSwap Contract**: [0x662EdB2cfD0E17EAc617bEfE7E4182BC5137dc1e](https://evm-sidechain.xrpl.org/address/0x662EdB2cfD0E17EAc617bEfE7E4182BC5137dc1e)
**If your VPN blocks CookieSwap from loading, try the [ENS domain link](https://hazardcookie.eth.limo)**

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

1. [Download](https://metamask.io/) and [setup MetMask](https://xrpl.org/get-started-evm-sidechain.html)
2. Get XRPL [Devnet Credentials](https://xrpl.org/xrp-testnet-faucet.html) (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"
4. [Bridge](https://bridge.devnet.xrpl.org) the test XRP from XRPL to the EVM sidechain
5. Visit [CookieSwap](https://hazardcookie.com) and connect to the application with metamask
6. 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](https://evm-sidechain.xrpl.org/). 

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](https://evm-sidechain.xrpl.org/address/0x83E7B126c047424c3ed018357df0376b980060EC)

**LOL Token (LOL)**: [0x57eE425952c44618bDf9751317F2096BaCC05341](https://evm-sidechain.xrpl.org/address/0x57eE425952c44618bDf9751317F2096BaCC05341) 

**Wrapped XRP (wXRP)**: [0x0192e8d1a428a7eea10b9a3c70f2fe2f70fbbd97](https://evm-sidechain.xrpl.org/address/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](https://twitter.com/hazardcookie)