Table of Contents
A web3 token exchange project is a decentralized platform for trading various types of tokens that leverages the power of blockchain technology and web3 protocols.
The exchange is designed to be secure, transparent, and immutable, ensuring that all transactions are executed in a decentralized manner. Users can connect their Ethereum wallets to the platform and trade tokens directly with other users without the need for an intermediary. The platform uses smart contracts to facilitate the exchange of tokens, with each contract representing a specific token or trading pair. Smart contracts automatically execute trades based on predefined rules, ensuring that all transactions are conducted fairly and securely.
Users can place buy or sell orders for tokens, which are matched with corresponding orders in the order book. Once a match is found, the trade is executed and the tokens are exchanged between the two parties. The exchange charges a small fee for each trade, which is paid in the platform's native token. The platform also includes various features to enhance the trading experience, such as order book visualization, price charts, and real-time market data. Additionally, users can participate in liquidity pools to earn rewards for providing liquidity to the platform. (Currently this site is running on goerli testnet only if you want to run it on eth mainnet then a slight change will occure)
Using tools:
- Solidity
- ReactJs
- React redux
- Hardhat
- Metamask
- EthersJs
- Alchamy
- Chai
Before you can start using the tokenExchange project, you need to have the following tools installed in your computer:
- Node.js
- Hardhat framework
Required steps for installing the project:
- Clone the repo
git clone https://github.com/your_username_/Project-Name.git
- Open a terminal and navigate to the project directory.
- Install the project dependencies
npm install
npx hardhat test
By doing this test you will able to know whether the contracts work properly or not.
- 1st run the hardhat node like:
npx hardhat node
- Then to deploy the contracts in localhost run
npx hardhat run --network localhost scripts/1_deploy.js
npx hardhat run --network localhost scripts/2_seed-exchange.js
- Now you can view the website like
npm run start
- Now make some transactions to see how the exchange work.
- 1st you have to store the private key in the .secret file (make sure you have sufficient test eth for the gas fees) also put the infura key in .infura file (this 2 files must be in .gitignore file)
- Now deploy the contract to the goerli testnet like:
npx hardhat run --network goerli scripts/1_deploy.js
npx hardhat run --network goerli scripts/2_seed-exchange.js
- Now you are all set to make order, fill order and all other transaction.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request