This repository contains a blockchain-based escrow application. The project is divided into two main parts:
- Escrow Contracts: Solidity smart contracts stored in the
escrow
folder, developed using Foundry. - Escrow Frontend: A Next.js frontend application located in the
escrow-frontend
folder.
The Escrow Blockchain App is designed to facilitate secure transactions between buyers and sellers by using smart contracts on the Ethereum blockchain. The contracts handle the creation, funding, service rendering, dispute opening, and settlement of escrow transactions.
To run this project, you need to have the following installed:
- Node.js (v20 or later)
- npm (v6 or later) or yarn (v1.22 or later)
- Foundry (latest version)
- MetaMask or another Ethereum wallet
-
Clone the repository:
git clone https://github.com/tundx0/escrow-blockchain-app.git cd escrow-blockchain-app
-
Install dependencies for the frontend:
cd escrow-frontend npm install # or yarn install
-
Return to the root directory:
cd ..
To deploy the smart contracts:
-
Navigate to the
escrow
directory:cd escrow
-
Compile the contracts:
forge build
-
Deploy the contracts to your chosen network:
forge script script/DeployEscrow.s.sol:DeployEscrow --rpc-url <YOUR_RPC_URL> --private-key <YOUR_PRIVATE_KEY> --broadcast
⚠️ Replace<YOUR_RPC_URL>
with your Ethereum node's RPC URL and<YOUR_PRIVATE_KEY>
with your wallet's private key.
To run the frontend application:
-
Navigate to the
escrow-frontend
directory:cd escrow-frontend
-
Create a
.env.local
file and add the necessary environment variables:NEXT_PUBLIC_CONTRACT_ADDRESS=<YOUR_DEPLOYED_CONTRACT_ADDRESS> NEXT_PUBLIC_RPC_URL=<YOUR_RPC_URL>
-
Start the development server:
npm run dev # or yarn dev
-
Open your browser and navigate to
http://localhost:3000
to interact with the application.
escrow-blockchain-app/
├── escrow/
│ ├── src/
│ │ └── Escrow.sol
│ ├── test/
│ │ └── Escrow.t.sol
│ └── script/
│ └── DeployEscrow.s.sol
├── escrow-frontend/
│ ├── src/
| ├── app/
│ ├── components/
│ ├── styles/
| └── page.tsx
| └── layout.tsx
│ └── public/
└── README.md
escrow/
: Contains the Solidity smart contracts and related Foundry files.escrow-frontend/
: Houses the Next.js frontend application.
This project is licensed under the MIT License - see the LICENSE file for details.