Skip to content

Conversation

aniketsahu115
Copy link

Description

This PR introduces a comprehensive BNB Swap Protocol example that demonstrates how to build a decentralized token swap application on BNB Smart Chain. The implementation provides a complete full-stack solution with smart contracts, frontend interface, and comprehensive documentation.

Key Components Added:

  • Complete swap protocol smart contracts using Solidity
  • React.js frontend with modern UI/UX using Vite and Tailwind CSS
  • Integration with PancakeSwap Router V2 for token swaps
  • Comprehensive testing suite and deployment scripts
  • Detailed documentation and setup instructions

Features Implemented:

  • Token swapping functionality for any BEP-20 tokens
  • Real-time price quotes and slippage protection
  • Wallet integration (MetaMask and other Web3 wallets)
  • Responsive design for desktop and mobile
  • Built-in fee mechanism for sustainable operations
  • Customizable slippage tolerance
  • Multi-token support for popular BSC tokens

This example serves as a practical reference for developers looking to build DEX applications or integrate token swapping functionality into their DApps on BNB Smart Chain.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

  • Smart contracts tested with comprehensive unit tests using Hardhat
  • Frontend tested with local development environment
  • Integration tested on BSC Testnet
  • Wallet connection and transaction flow verified
  • Cross-browser compatibility tested (Chrome, Firefox, Safari)
  • Mobile responsiveness verified

Test Instructions:

  1. Install dependencies: npm run install && cd frontend && npm install
  2. Start local blockchain: npx hardhat node
  3. Deploy contracts: npx hardhat run scripts/deploy.js --network localhost
  4. Start frontend: cd frontend && npm run dev
  5. Connect MetaMask and test token swap functionality

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link

@Buffalo456 Buffalo456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just getting a looksee at what a commit looks like

@futures996
Copy link

@Buffalo456 excellent, it's always good to look at how a repository works and its functions.

Copy link

@futures996 futures996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

não entendi qual alteração voçê quer fazer no repositorio

Copy link

@jdmatiga1-ux jdmatiga1-ux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript/bnb-swap-protocol

@0xlucasliao
Copy link
Contributor

0xlucasliao commented Oct 14, 2025

Hey there @aniketsahu115 ! Thank you so much for your submission, really appreciate the effort. However, we noticed that an existing PancakeSwap already exist. May i know how is yours different?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants