TrustLock is a Solidity-based escrow smart contract that enables secure peer-to-peer transactions without relying on trust or intermediaries.
Funds are locked in a smart contract and released only when predefined conditions are met.
Online transactions often fail due to lack of trust between parties.
TrustLock replaces trust in people with trust in code by using smart contracts as a neutral escrow.
- Buyer creates an escrow and deposits ETH
- Funds are locked in the smart contract
- Seller marks work as completed
- Buyer releases funds if satisfied
- Smart contract transfers ETH to seller
If buyer becomes inactive, timeout protection allows seller to claim funds.
If conflict occurs, an arbitrator can resolve the dispute.
- Escrow-based ETH locking
- Buyer-controlled fund release
- Refund option
- Timeout protection for sellers
- Dispute resolution system
- Arbitrator-based conflict handling
- On-chain state tracking
- Solidity
- Hardhat
- Ethers.js
This project was built to explore:
- Smart contract design
- Escrow logic
- Time-based conditions
- Dispute resolution mechanisms
- Role-based permissions in Solidity
TrustLock is a learning-focused prototype and not production-ready.
It demonstrates core escrow mechanics in decentralized systems.
Commands to run & test
- npx hardhat compile
- npx hardhat node
- npx hardhat run scripts/deploy.cjs --network localhost (Deployment and the local contract address will be tabulated)
- npx hardhat run scripts/interact.cjs --network localhost (For basic process)
- npx hardhat run scripts/disputetest.cjs --network localhost (For Dispute Events)
Divyansh Goyal