Skip to content

pascalineaugustine/Loyalty-Punch-Card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Customer Loyalty Punch Card Smart Contract

A robust, production-ready Clarity smart contract implementing a customer loyalty punch card system on the Stacks blockchain. Customers earn punches with each purchase and redeem them for rewards.

Overview

This contract manages:

  • Customer Registration - Secure onboarding with duplicate prevention
  • Punch Management - Track punches earned from purchases
  • Reward Redemption - Redeem 10 punches for rewards
  • Account Management - Activate/deactivate customer accounts
  • Audit Trail - Complete history of all transactions

Key Features

1. Customer Registration

  • One-time registration per principal
  • Automatic initialization with 0 punches
  • Prevents duplicate registrations

2. Punch System

  • Add punches to customer accounts (admin only)
  • Track punch history with merchant and timestamp
  • Automatic counter for audit purposes

3. Reward Redemption

  • Redeem 10 punches for 100 STX equivalent reward
  • Customer-initiated redemption
  • Automatic punch deduction

4. Account Control

  • Admin can deactivate accounts
  • Active status validation on all operations
  • Prevents inactive customers from earning/redeeming

5. Analytics

  • Total punches issued
  • Total rewards redeemed
  • Per-customer statistics

Contract Functions

Public Functions

register-customer

Registers a new customer for the loyalty program.

(register-customer)

About

The Loyalty Punch Card is a Clarity-based smart contract deployed on the Stacks blockchain that implements a digital loyalty rewards system. It replaces traditional paper punch cards with a secure, transparent, and immutable blockchain-based solution for tracking customer purchases and rewarding loyalty.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors