Skip to content

Helps patients with bookings and manage daily appointments so that everyone is helped and assisted.

License

Notifications You must be signed in to change notification settings

Mshengu27/ClinicApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ“¦ Auction Validator Project

Updated by Coxygen Global - Bernard Sibanda

πŸ“‘ Table of Contents

  1. βš™οΈ Project Overview
  2. βš™οΈ Environment Setup
  3. πŸ“‚ Directory Structure
  4. πŸ› οΈ Installation & Build
  5. πŸ”¬ Testing
  6. πŸ§ͺ Property-Based Testing
  7. πŸš€ Usage
  8. πŸ“– Glossary

1. βš™οΈ Project Overview

This repository contains a Plutus-based Auction Validator smart contract along with tooling to generate Blueprints and comprehensive test suites. It is part of the Plinth Template for teaching on-chain development on Cardano.

2. βš™οΈ Environment Setup

image

image

image

Follow these steps to prepare your environment:

# 1. Enter the Nix shell (requires Nix installed)
nix-shell

# 2. Update Cabal package index
cabal update

# 3. Ensure project dependencies are available
cabal build --enable-tests

Note: If you do not use Nix, skip the nix-shell step and ensure you have GHC and Cabal installed via the Haskell Platform.

3. πŸ“‚ Directory Structure

auction/                     # Project root
β”œβ”€β”€ app/                     # Executables for Blueprint generation
β”‚   β”œβ”€β”€ GenAuctionValidatorBlueprint.hs
β”‚   └── GenMintingPolicyBlueprint.hs
β”œβ”€β”€ src/                     # On-chain library modules
β”‚   └── AuctionValidator.hs
β”œβ”€β”€ test/                    # Test suite files
β”‚   β”œβ”€β”€ AuctionValidatorSpec.hs            # Unit tests
β”‚   β”œβ”€β”€ AuctionMintingPolicySpec.hs        # Minting policy tests
β”‚   └── AuctionValidatorProperties.hs      # QuickCheck properties
β”œβ”€β”€ default.nix              # Nix definition (if applicable)
β”œβ”€β”€ shell.nix                # Nix shell entry (if applicable)
β”œβ”€β”€ auction.cabal            # Cabal project configuration
β”œβ”€β”€ cabal.project            # Root project settings
└── cabal.project.local      # Local overrides (e.g., tests: True)

4. πŸ› οΈ Installation & Build

  1. Enter Nix shell (optional):

    nix-shell
  2. Update Cabal index:

    cabal update
  3. Install dependencies & build:

    cabal build --enable-tests
  4. Generate Blueprints:

    cabal run gen-auction-validator-blueprint -- ./blueprint-auction.json
    cabal run gen-minting-policy-blueprint -- ./blueprint-minting.json

5. πŸ”¬ Testing

Run Unit Tests

cabal test auction-tests

Run All Tests

cabal test
  • auction-tests: Unit tests for the Auction Validator.
  • minting-tests: Unit tests for the Minting Policy (if configured).

6. πŸ§ͺ Property-Based Testing

To verify invariants using QuickCheck:

  1. Add a QuickCheck test suite entry in your .cabal:

    test-suite auction-properties
      type: exitcode-stdio-1.0
      main-is: AuctionValidatorProperties.hs
      hs-source-dirs: test
      build-depends:
          base >=4.7 && <5,
        , scripts,
        , QuickCheck,
        , plutus-ledger-api,
        , plutus-tx,
        , test-framework
      default-language: Haskell2010
  2. Run the property suite:

    cabal test auction-properties

7. πŸš€ Usage

  • Deploy your compiled Plutus script on a Cardano network by submitting the generated blueprint JSON via your deployment tooling.
  • Customize AuctionParams (seller, currency symbol, token name, minimum bid, end time) in GenAuctionValidatorBlueprint.hs before generating the blueprint.
  • Extend the contract logic in src/AuctionValidator.hs and re-run tests to ensure correctness.

8. πŸ“– Glossary

Term Description
Cabal Haskell’s package manager and build tool.
GHC The Glasgow Haskell Compiler.
Plutus Cardano’s on-chain smart contract platform.
TxInfo Metadata about a transaction passed to a Plutus validator.
ScriptContext Context for script execution, including TxInfo and ScriptPurpose.
AssocMap Plutus’s internal map type for associating keys to values (e.g., Datum, Redeemer).
hspec A behavior-driven testing framework for Haskell.
QuickCheck A property-based testing library for Haskell.
Blueprint JSON representation of a Plutus script and its parameters, for off-chain tooling.

Updated by Coxygen Global - Bernard Sibanda Date: 15 September 2025

About

Helps patients with bookings and manage daily appointments so that everyone is helped and assisted.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published