Git Product home page Git Product logo

wrapped-naira's Introduction

Wrapped Naira

This project provides a seamless fiat-to-crypto ramp, allowing users to easily convert Nigerian Naira (NGN) into a stablecoin ERC20 token. It also features a peer-to-peer exchange platform where merchants can list offers, and interested buyers can participate. The process is straightforward - users deposit NGN via a payment processor like Paystack, and the equivalent token amount is minted. The tokens are burned for withdrawals, and the corresponding fiat is sent back to the user's linked bank account. Crucially, the project ensures 1:1 backing of all funds, providing transparency and security.

Project Structure

The project repository contains the following directories, each named after a Nigerian meal:

.
├── README.md
├── afang (Subgraph files and configurations)
├── miyan (Solidity smart contracts)
├── ukwa (Node.js backend API)
└── wara (TypeScript React frontend)

Architecture

sequenceDiagram
    participant User
    participant Paystack
    participant WNGNContract
    participant Server

    User->>Paystack: Sends money
    Paystack->>Server: Sends webhook
    Server-->>WNGNContract: Mints WNGN tokens
    Server-->>User: Allocates minted WNGN tokens to user's blockchain address

    User->>WNGNContract: Burns WNGN tokens
    WNGNContract->>Server: Emits Burn event
    Server-->>User: Sends equivalent fiat asset to user's linked bank account
Loading

Utilities

  • Peer-to-peer stablecoin exchange: This platform allows users to trade the WNGN token directly with each other, facilitating the growth of the token's liquidity. As the project gains more traction, liquidity pools will be created on popular decentralized exchanges (DEXes) to further improve the token's liquidity.
sequenceDiagram
    participant Merchant
    participant User
    participant P2PExchange
    participant WNGN
    participant USDC

    alt Merchant Buy Ad Flow
        Merchant->>P2PExchange: Create a BUY advertisement with price, WNGN quantity, and validity period
        P2PExchange->>WNGN: Transfer required WNGN tokens from Merchant to the contract
        P2PExchange-->>Merchant: Notify the Merchant that the BUY advertisement was created

        User->>P2PExchange: Participate in the BUY advertisement by providing the ad ID and the amount of USDC to sell
        P2PExchange->>USDC: Transfer the provided USDC amount from User to the Merchant
        P2PExchange->>WNGN: Transfer the calculated WNGN tokens from the contract to the User
        P2PExchange-->>User: Notify the User that the trade was executed

        alt Buy advertisement has expired and there are remaining WNGN tokens
            Merchant->>P2PExchange: Withdraw the remaining funds for the expired BUY advertisement
            P2PExchange->>WNGN: Transfer the remaining WNGN tokens from the contract to the Merchant
            P2PExchange-->>Merchant: Notify the Merchant that the funds were withdrawn
        end
    else Merchant Sell Ad Flow
        Merchant->>P2PExchange: Create a SELL advertisement with price, USDC quantity, and validity period
        P2PExchange->>USDC: Transfer required USDC tokens from Merchant to the contract
        P2PExchange-->>Merchant: Notify the Merchant that the SELL advertisement was created

        User->>P2PExchange: Participate in the SELL advertisement by providing the ad ID and the amount of WNGN to buy
        P2PExchange->>WNGN: Transfer the provided WNGN amount from User to the Merchant
        P2PExchange->>USDC: Transfer the calculated USDC tokens from the contract to the User
        P2PExchange-->>User: Notify the User that the trade was executed

        alt Sell advertisement has expired and there are remaining USDC tokens
            Merchant->>P2PExchange: Withdraw the remaining funds for the expired SELL advertisement
            P2PExchange->>USDC: Transfer the remaining USDC tokens from the contract to the Merchant
            P2PExchange-->>Merchant: Notify the Merchant that the funds were withdrawn
        end
    end
Loading

Deployment Addresses

1. WNGN Token

2. P2P Contract

API

Technologies Used

Contributors

URL

Backend is live @ here

Challenges Faced

During the development of this project, we encountered several obstacles related to the deployment of the subgraph. Despite multiple attempts, the subgraph deployment consistently failed, hindering our progress.

The first issue we faced was related to IPFS deployment. To overcome this hurdle, we utilized the Satsuma IPFS URL as an alternative solution. However, this workaround did not completely resolve the deployment problems.

Subsequently, we encountered difficulties when attempting to deploy the subgraph to the node. As a potential solution, we explored the possibility of switching to Alchemy's node, as they offer support for subgraphs. Unfortunately, as at the time of the hackathon, Alchemy did not provide support for the Scroll zkEVM blockchain, which was the platform we were targeting.


wrapped-naira's People

Contributors

prettyirrelevant avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.