Making the frontend part of my project DEX smart contract!
# Clone this project
$ git clone https://github.com/gab0071/DEX-FRONT
# Access
$ cd DEX-FRONT
# Install dependencies
$ npm install
- $
npx create-next-app@latest
- $
npm run dev
Now go tohttp://localhost:3000
, your app should be running π€
Open up a terminal pointing at my-app directory
and execute this command:
- $
npm install web3modal ethers
Noteπ¨ β‘ to interact with your smart contract in the folder constants/index.js
write:
export const TOKEN_CONTRACT_ABI = "ABI-CRYPTO-DEV-TOKEN-CONTRACT";
export const TOKEN_CONTRACT_ADDRESS = "ADDRESS-OF-CRYPTO-DEV-TOKEN-CONTRACT";
export const EXCHANGE_CONTRACT_ABI = "ABI-EXCHANGE-CONTRACT";
export const EXCHANGE_CONTRACT_ADDRESS = "ADDRESS-EXCHANGE-CONTRACT";
We created some utility files which would help us to better interact with the contract. Create a utils
folder inside the my-app
folder and inside the folder create 4 files: addLiquidity.js
, removeLiquidity.js
, getAmounts.js
, and swap.js
.
- Next.js
- Ethers.js
- Web3Modal
Hope you enjoy making this.
Made with β€οΈ by catellaTech.