Skip to content

This project implements a Milestone-based Escrow System on the Cardano blockchain using Aiken

Notifications You must be signed in to change notification settings

Dtrang189/milestone-escrow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Milestone Escrow Smart Contract

This project implements a Milestone-based Escrow System on the Cardano blockchain using Aiken. It is designed to demonstrate the technical competencies required for a Cardano Catalyst Milestone Reviewer.

Project Overview

The core functionality ensures that funds allocated for a project are only released when specific milestones are achieved and verified by a designated reviewer.

  • Actors:

    • Funder: The entity providing the funds (e.g., Catalyst Treasury).
    • Contractor: The entity doing the work (e.g., Proposal Team).
    • Reviewer: The trusted entity verifying the milestone (e.g., Value Milestone Reviewer).
  • Logic:

    • Funds are locked in the contract with a Datum specifying the milestone schedule.
    • Release: Requires a signature from the Reviewer. Releases amount_per_milestone to the Contractor and updates the Datum to increment the current_milestone.
    • Cancel: Allows the Funder to reclaim remaining funds, but requires Reviewer approval (simulating dispute resolution or agreement).

Technical Relevance to Milestone Reviewer Role

This project serves as a proof-of-work for the following skills:

  1. Understanding of E-UTxO Model:

    • The contract verifies state transitions (Datum updates) to ensure legitimate progress through milestones.
    • It handles UTxO consumption and creation (spending script input, creating continuing output).
  2. Smart Contract Security:

    • Implements checks for signatures, output values, and correct addresses.
    • Prevents unauthorized access to funds.
  3. Off-Chain Integration (MeshSDK v1.9.0):

    • Includes TypeScript scripts (offchain/src) to interact with the contract.
    • Demonstrates ability to use the latest MeshTxBuilder to construct complex Plutus V3 transactions.
    • Implements robust wallet management and transaction signing.

Directory Structure

  • validators/: Aiken smart contract code.
  • offchain/: Node.js project for off-chain interaction using MeshSDK.
  • plutus.json: Generated CIP-57 blueprint.

How to Run

  1. Install Aiken: aiken --version
  2. Build Contract:
    aiken build
  3. Run Tests:
    aiken check
  4. Off-chain Interaction:
    • Navigate to offchain/
    • npm install
    • (Optional) Configure .env with a Blockfrost Key (see offchain/src/common.ts for setup)
    • Run npx ts-node src/release.ts to see the transaction builder in action (mock mode).

About

This project implements a Milestone-based Escrow System on the Cardano blockchain using Aiken

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published