Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 2.72 KB

ReadMe.md

File metadata and controls

76 lines (55 loc) · 2.72 KB

PDEX

This library is using Hardhat and Truffle for development, compiling, testing and deploying. The development tool used foor development is Visual Studio Code which has great plugins for solidity development and mocha testing.

Contracts

Compiling

Introduction to compiling these contracts

Install needed packages

npm install or yarn install

Compile code

npx hardhat compile

Test code

npx hardhat test

Run a local development node

This is needed before a truffle migrate to the development network. You can also use this for local development with for example metamask. Hardhat node guide

npx hardhat node

Migrate to the correct networks

truffle migrate --network development
truffle migrate --network test
truffle migrate --network rinkeby
truffle migrate --network goerli
truffle migrate --network main

Make sure you have set the right settings in your '.env' file. You have to create this file with the following contents yourself:

KOVAN_PRIVATE_KEY=keyhere
RINKEBY_PRIVATE_KEY=keyhere
GOERLI_PRIVATE_KEY=keyhere
MAIN_PRIVATE_KEY=keyhere
KOVAN_INFURA=https://kovan.infura.io/v3/<infurakey>
RINKEBY_INFURA=https://rinkeby.infura.io/v3/<infurakey>
GOERLI_INFURA=https://goerli.infura.io/v3/<infurakey>
MAIN_INFURA=https://mainnet.infura.io/v3/<infurakey>

ALCHEMY_KEY=keyhere
ETHERSCAN_API_TOKEN=keyhere;

Flatten contracts

npx hardhat flatten contracts/DPexRouter.sol > contracts-flattened/DPexRouter.sol