Search projects, hackathons, sponsors and tech

    ← All projects

    WaffleSwap

    WaffleSwap is a DEX built on ethereum with a custom token called Waffle Coin. You can use this DApp to buy or sell Waffle Coin in exchange for Ethereum.

    Demo

    About

    The problem it solves (In order to run this application. please follow the steps mentioned in readme.md file in github repo.) Centralized exchanges require the user to verify themselves and the transaction between any two buyers and sellers involves an intermediary. Waffleswap is a decentralized exchange over ethereum wherein the transaction takes place directly between the buyer and seller. This removes the intermediary and the KYC requirement which otherwise would need to be done in centralized exchanges. This is one of the core concepts of decentralization, which states trustless transactions. Waffleswap is a simple user friendly DApp built using Solidity for smart contracts. IT IS DIFFERENT FROM THE EXISTING DEX as in the existing DeXs like Uniswap you need to enter the exact amount of tokens you need. Whereas in waffleswap you have to enter the amount of ethereum you need to exchange your tokens for. For example if I need 100 tokens, in existing Dex's, I would just type 100 in the token box. BUT, in Waffleswap, instead of that you just need to enter the the amount you want to spend and it would give you that much amount of tokens. So for example if I want 1 ETH worth waffle, on waffleswap you just need to enter 1 in the ETH selection and it will estimate the amount of WFL it will sell you for 1 ETH.

    How it's made

    Challenges we ran into While testing the Selling function, I ran into a bug where the selling function was verifying the transaction but not performing it. Console threw the error: MetaMask - RPC Error: Cannot set properties of undefined (setting 'loadingDefaults') , initially I couldn't even see the error so this bug gave me a hard time. But after checking through dev tools of my browser I discovered whenever I performed the sell function this error occured. What was weird was that in 25-30% of the case, I get to the second approval step and the transaction goes through. Reinstalling modules and recompiling didn't do anything, but it worked out after I changed the function to async await syntax. Later I came to know that it has an open issue on Metamask`s Github: https://github.com/MetaMask/metamask-extension/issues/13197 . So now everything is working flawlessly. Another challenge was integrating the front-end UI with the backend smart contracts. Originally the plan was to build using react and CSS, but at a later stage I decided to change into Next and Tailwind for ease of coding the front end and building a good UI. Documentation for integrating backend into Nextjs projects helped here: https://nextjs.org/learn/basics/data-fetching State and Event changes when porting the front end from basic react and bootstrap to next and tailwind.