This DApp allows the user (deployer and arbiter) to deploy Escrow Smart Contracts by adding a beneficiary. Only the arbiter can approve the contract, and when this happens the beneficiary is allowed to withdraw the contract funds. The app has the contract code and test, the frontend React App, and a server that allows persistent data to be retrieved in the UI.
- Frontend -
/app
- Backend -
/server
- Escrow contract -
/contracts
- Contract tests -
/tests
- Run
npm install
for hardhat dependencies - Run
cd app && npm install
for frontend dependencies - Run
cd server && npm install
for backend dependencies
-
Configuration -
hardhat.config.js
-
Compile contracts (artifacts will go to
/app/src/artifacts
):# With hardhat npx hardhat compile # With npm scripts npm run compile
-
Test contracts:
# With hardhat npx hardhat test # With npm scripts npm run test
-
Start local node:
# With hardhat npx hardhat node # With npm scripts npm run node
- Start development host
npm start
- At the root level it runs the npm script
start
which runscd app && npm start
- You can
cd app
and runnpm start
as well
- At the root level it runs the npm script
- Go to
http://localhost:3000
- Start the express server
npm run server
- At the root level it runs the npm script
server
which runscd app && npm run dev
- You can
cd server
and runnpm run dev
as well
- At the root level it runs the npm script
- The server's purpose is to provide persistent data to have easier access to the deployed contracts