Description -> Basic Ethereum decentralized exchange
To run this project locally, follow these steps.
- Install Git
- Install Node.js version "v18.16.0" for this dapp, use nvm for better management of node versions.
- Install Yarn (optional)
- Install Truffle Truffle
- Install Metamask
- Create RPC API Enpoint for Ethereum Test Network Sepolia
Please follow screenshots
-
- Sepolia url: 'https://app.zeeve.io/shared-api/eth/f7d5b6624c939b41b58bc6df223df685bde85f1058f03dbe/'
- Chain Id: 11155111
-
Fund your wallet from the Sepolia Faucet
- Clone the project locally, change into the directory, and install the dependencies:
git clone https://github.com/Zeeve-App/sample-dapps.git
cd sample-dapps/dapps/eth-dex
-
npm install
-
Update truffle-config.js file
var HDWalletProvider = require("truffle-hdwallet-provider");
var mnemonic = "your_metamask_wallet_passphrase";
module.exports = {
networks: {
development: {
host: '127.0.0.1',
port: 7545,
network_id: '*',
},
sepolia: {
provider: function() {
return new HDWalletProvider(mnemonic, "https://app.zeeve.io/shared-api/eth/f7d5b6624c939b41b58bc6df223df685bde85f1058f03dbe/");
},
network_id: 11155111,
gas: 4500000,
gasPrice: 10000000000,
}
},
contracts_directory: './src/contracts/',
contracts_build_directory: './build/contracts/',
test_file_extension_regexp: /.*\.test.ts$/,
compilers: {
solc: {
version: '0.8.14',
optimizer: {
enabled: true,
runs: 200,
},
evmVersion: 'petersburg',
},
},
};
-
Compile the contract by running the
truffle compile
command -
Deploy the smart contract on the Sepolia Ethereum test network by running the
truffle migrate --network sepolia
command -
npm run dev