Skip to content

mendsalbert/Decentralize-Token-Exchange

Repository files navigation


DDAP Token Exchange

A decentralize Token Exchange Platform
Explore the docs »

View App

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact
  6. Acknowledgments

About The Project

Logo

A decentralize token exchange platform that allows users to trade eth with the native token of the platform (DDAP Token).

Built With

This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

Getting Started

The project consist of the backend and also the front end.

Prerequisites

  • nodejs installed

  • npm

    npm install npm@latest -g

Local setup

To run this project locally, follow these steps.

  1. Clone the project locally, change into the directory, and install the dependencies:
git clone https://github.com/mendsalbert/Decentralize-Token-Exchange

cd Decentralize-Token-Exchange

# install using NPM or Yarn
npm install

# or

yarn
  1. Start the local Hardhat node
npx hardhat node
  1. With the network running, deploy the contracts to the local network in a separate terminal window
npx hardhat run scripts/deploy.js --network localhost
  1. Start the app
npm run dev

Configuration

To deploy to Polygon test or main networks, update the configurations located in hardhat.config.js to use a private key and, optionally, deploy to a private RPC like Infura.

/* hardhat.config.js */
const fs = require("fs");
const HDWalletProvider = require("@truffle/hdwallet-provider");
const secrets = JSON.parse(fs.readFileSync(".secrets.json").toString().trim());
require("@nomiclabs/hardhat-waffle");
const sender = fs.readFileSync("secret.txt").toString();
const receiver = "_PRIVATE KEY_";
const ether = "_PRIVATE KEY_";
const feeAccount = "_PRIVATE KEY_";
const projectId = "_INFURA PROJECT ID_";
module.exports = {
    defaultNetwork: "hardhat",
    networks: {
        hardhat: {
            chainId: 1337,
        },

        kovan: {
            url: "https://kovan.infura.io/v3/745fcbe1f649402c9063fa946fdbb84c",

            accounts: [sender, receiver, ether, feeAccount],
            gas: 2100000,
            gasPrice: 8000000000,
            network_id: 42,
        },
        mainet: {
            url: `https://palm-mainnet.infura.io/v3/${projectId}`,
        },
    },
    solidity: {
        version: "0.8.4",
        settings: {
            optimizer: {
                enabled: true,
                runs: 200,
            },
        },
    },
};

If using Infura, update .infuraid with your Infura project ID.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License.

Contact

Mends Albert - @mendsalbert - mendsalbert@gmail.com

Project Link: https://github.com/mendsalbert/Decentralize-Token-Exchange

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors