https://github.com/spandan114/token-exchange
Decentralized ERC-20 token (Brownie token ) exchange .
https://github.com/spandan114/token-exchange
crypto-exchange cryptocurrency dapp erc20 ethereum-dapp etherjs hardhat mocha-chai reactjs smart-contracts solidity testcase web3 web3js
Last synced: 3 months ago
JSON representation
Decentralized ERC-20 token (Brownie token ) exchange .
- Host: GitHub
- URL: https://github.com/spandan114/token-exchange
- Owner: spandan114
- Created: 2022-01-30T16:37:08.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-03T19:37:11.000Z (over 3 years ago)
- Last Synced: 2025-06-03T15:46:21.538Z (5 months ago)
- Topics: crypto-exchange, cryptocurrency, dapp, erc20, ethereum-dapp, etherjs, hardhat, mocha-chai, reactjs, smart-contracts, solidity, testcase, web3, web3js
- Language: JavaScript
- Homepage:
- Size: 1.65 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Token exchange :money_mouth_face:
decentralized ERC-20 token (Brownie token ) exchange .
### Tech stack & packages used :man_technologist:
- React.js ,solidity ,hardhat ,mocha, chai, ether.js, web3.js,lodash, apexcharts & waffle
### Token exchange features :tada:
- [x] Deposite & withdraw ether.
- [x] Deposite & withdraw token.
- [x] Buy & sell token.
- [x] Maintain trade (Create order,fill order & cancel order).
- [x] Realtime updates.### How to run :runner: :
----------------
- Run hardhat node
```
npx hardhat node
```
- Run test cases
```
npx hardhat test
```
- Deploy contract in local hardhat node
```
npx hardhat run scripts/deploy.js --network localhost
```
- Connect hardhat with metamask
- Run react frontend
```
cd client
npm start
```
### Web3.js
------------
- [Load web3](https://web3js.readthedocs.io/en/v1.2.11/web3-eth.html#web3-eth)
- [Connect with contract](https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html#web3-eth-contract)
```
new web3.eth.Contract(jsonInterface[, address][, options])
```
- [Callback promises events](https://web3js.readthedocs.io/en/v1.2.11/callbacks-promises-events.html#callbacks-promises-events)
```
.on('transactionHash', function(hash){ ... })
.on('error', function(error){ ... })
```
- [Subscribe to event](https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html#contract-events)
```
contractName.events.EventName([options][, callback])
```
- [Fetch all data from contract event](https://web3js.readthedocs.io/en/v1.2.11/web3-eth-contract.html#getpastevents)
- An array with the past event Objects, matching the given event name and filter.```
contractName.getPastEvents(EventName[, options][, callback])
```### Hardhat commands
```shell
npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/deploy.js
npx hardhat run scripts/seed.js
npx hardhat help
npx hardhat run scripts/deploy.js --network
```