Updated by Coxygen Global β Bernard Sibanda
π‘ Plinth currently supports GHC 9.6.x and Cabal 3.8+ (recommended).
- π§ Auction Validator Project
- π Table of Contents
- βοΈ Overview
- β¨ Features
- ποΈ Architecture
- π Prerequisites
- β‘ Quick Start
- π οΈ Installation & Build
- π§ͺ Testing
- π Property-Based Testing
- π Usage
- βοΈ Configuration
- π Directory Structure
- π Development Workflow
- π€ CI/CD (Optional)
- π§― Troubleshooting
- π¬ FAQ
- π€ Contributing
- π License
- π Glossary
This repository contains a Plutus-based Auction Validator and Minting Policy.
It includes Blueprint generators, property-based tests, and development tooling.
The project is based on the Plinth Template for teaching on-chain Cardano smart contract development.
- πͺ On-chain Auction Validator (bid, close, payout logic)
- π§± Minting Policy for auction tokens
- π§© Blueprint generation tools for off-chain deployment
- π§ͺ Unit tests and property-based tests
- π§° Nix and Devcontainer support for reproducibility
- π Modular Cabal/Nix structure for teaching and reuse
| Layer | Purpose |
|---|---|
| π§ On-chain Logic | Implemented in src/AuctionValidator.hs. |
| π§° Executables | Blueprint generators under app/. |
| π§ͺ Tests | Unit + property suites under test/. |
| βοΈ Infrastructure | Cabal/Nix build environment. |
- GHC
9.6.x - Cabal
3.8+ - Nix (optional)
- Docker / Devcontainer (optional)
π§© If not using Nix, install via Haskell Platform or
ghcup.
# 1οΈβ£ Enter Nix shell (recommended)
nix-shell
# 2οΈβ£ Update Cabal package index
cabal update
# 3οΈβ£ Build project and tests
cabal build --enable-tests
# 4οΈβ£ Run test suite
cabal test-
Enter Nix shell (optional)
nix-shell
-
Update Cabal index
cabal update
-
Build project
cabal build --enable-tests
-
Generate Blueprints
cabal run gen-auction-validator-blueprint -- ./blueprint-auction.json cabal run gen-minting-policy-blueprint -- ./blueprint-minting.json
cabal test auction-testscabal testExample Cabal config:
test-suite auction-properties
type: exitcode-stdio-1.0
main-is: AuctionValidatorProperties.hs
hs-source-dirs: test
build-depends:
base >=4.7 && <5
, QuickCheck
, plutus-ledger-api
, plutus-tx
, scripts
default-language: Haskell2010Run:
cabal test auction-properties- Customize parameters in
app/GenAuctionValidatorBlueprint.hs(e.g. seller, token name, min bid, end time). - Generate blueprint JSONs via Cabal commands.
- Deploy the compiled Plutus scripts to Cardano network.
- Verify with unit and property-based tests.
-
Project settings:
cabal.project,auction.cabal -
Local overrides:
cabal.project.local -
To ignore local configs:
echo "cabal.project.local" >> .gitignore
auction/
βββ app/ # Executables (Blueprint generators)
β βββ GenAuctionValidatorBlueprint.hs
β βββ GenMintingPolicyBlueprint.hs
βββ src/ # On-chain modules
β βββ AuctionValidator.hs
βββ test/ # Tests
β βββ AuctionValidatorSpec.hs
β βββ AuctionMintingPolicySpec.hs
β βββ AuctionValidatorProperties.hs
βββ default.nix
βββ shell.nix
βββ auction.cabal
βββ cabal.project
βββ cabal.project.local
- πΏ Create a new branch
- π§± Make modular commits
- β
Run
cabal test - π§Ή Format and lint
- π Merge via PR
- π·οΈ Tag releases
- π§° Build & Test:
cabal build --enable-tests && cabal test - π¦ Artifacts: Upload blueprint JSONs, logs, etc.
- β‘ Cache: Use Cabal store caching for faster pipelines.
| Issue | Fix |
|---|---|
| Build fails | cabal clean && cabal update && cabal build --enable-tests |
| Wrong compiler | Use ghc --version β must be 9.6.x |
| Nix errors | Try nix develop or update flakes |
| Devcontainer fails | Check Docker Desktop / VSCode extensions |
Q: Do I need Nix? A: No. Itβs optional but ensures reproducibility.
Q: Where do I change auction parameters?
A: In GenAuctionValidatorBlueprint.hs.
Q: How do I run only property tests?
A: cabal test auction-properties
- π΄ Fork this repo
- πΏ Branch from
main - π§© Add code + tests
- π Verify with
cabal test - π¨ Open a Pull Request
Released under the MIT License (or your organizationβs chosen license).
See the LICENSE file for details.
| Icon | Term | Description |
|---|---|---|
| βοΈ | Cabal | Haskellβs package manager and build tool. |
| π§ | GHC | The Glasgow Haskell Compiler. |
| π | Plutus | Cardanoβs smart contract platform. |
| π§Ύ | Blueprint | JSON representation of a Plutus script and parameters. |
| π§© | ScriptContext | Context for execution (TxInfo, ScriptPurpose). |
| π | TxInfo | Transaction metadata passed to the validator. |
| π§ͺ | QuickCheck | Haskell property-based testing framework. |
| π§ | hspec | Behavior-driven testing framework for Haskell. |
| πΊοΈ | AssocMap | Plutus internal keyβvalue map type. |
π§ Maintained by Coxygen Global β Bernard Sibanda π Last updated: 15 September 2025 Developer: Balogun Muiz Dolapo