Skip to content

Conversation

@Oluwaseyi89
Copy link

📋 Overview

This PR implements the core foundation for the community sticker system, addressing both Issue #35 (Core Sticker Contract) and Issue #36 (Usage System & Limits). The implementation establishes a complete ERC1155-based sticker ecosystem with creation, management, and usage tracking capabilities.

🎯 Features Implemented

✅ Core Sticker Contract (#35)

ERC1155 Integration: Full OpenZeppelin ERC1155Component implementation for fungible sticker tokens

Sticker Creation: Open creation system with automatic token minting and unique ID generation

Metadata Management: Comprehensive on-chain storage for name, description, tags, category, creator, and content hash

Creator Tracking: Complete creator attribution system with immutable ownership records

Validation System: String length limits and non-empty checks for all metadata fields

Query Functions: Full suite of read operations including:

get_sticker_metadata() - Retrieve complete sticker details

get_stickers_by_creator() - List all stickers by creator address

get_total_sticker_count() - Global sticker counter

get_sticker_creation_timestamp() - Immutable creation timestamps

✅ Community Sticker Usage System (#36)

Daily Limit System: Configurable free usage limits (default: 10 uses/day)

Usage Tracking: Per-user daily usage counting with automatic daily resets

Payment Integration: Ready framework for excess usage payments (ERC20 integration ready)

Event System: Comprehensive events for usage, payments, and daily resets

Admin Controls: Configurable limits, costs, and treasury address management

🏗 Technical Architecture

Core Sticker Contract (StickerContract):

OpenZeppelin ERC1155Component with Ownable access control

Structured metadata storage with validation

Creator-to-sticker mapping system

Sequential ID generation with global counter

Usage System (CommunityStickerUsage):

Daily usage tracking with (user, day) tuple storage

Configurable limits and payment parameters

Event-driven architecture for monitoring

Admin-controlled configuration

📊 Storage Optimization

Efficient Metadata: Fixed-length string limits for gas optimization

Minimal Mapping: Optimized storage patterns for frequent read/write operations

Scalable Design: Support for unlimited stickers and users

🧪 Acceptance Criteria Met

####Issue #35

Users can create new community stickers with complete metadata

Each creation mints ERC1155 tokens automatically

Stickers retrievable by ID with full metadata

Creator can view all their created stickers

Accurate total sticker counting

Immutable content reference storage

Proper OpenZeppelin ERC1155Component integration

Correct event emission for all operations

Unique sequential sticker IDs

Immutable creator attribution

Metadata validation prevents invalid entries

Accurate immutable timestamps

Issue #36

Users can use stickers within daily limits

Accurate usage counting and incrementing

Proper daily limit enforcement

Automatic daily usage resets

Payment framework for excess usage

Reliable daily reset mechanism

Secure payment processing foundation

Efficient usage validation

Comprehensive event emission

🔗 Dependencies Resolved

Built on ERC1155 standard for multi-token functionality

Integrated with Ownable for admin controls

Prepared for ERC20 integration for payment processing

Full event system for external indexing

close #35 and

close #36

@Oluwaseyi89
Copy link
Author

@Xaxxoo please, review the Pull Request.

@manlikeHB manlikeHB self-requested a review August 30, 2025 11:16
@manlikeHB
Copy link
Contributor

Hi @Oluwaseyi89, please add a comprehensive test.

@Oluwaseyi89
Copy link
Author

@manlikeHB Okay, I will.

@Oluwaseyi89
Copy link
Author

@manlikeHB please, bear with me. I have been preoccupied. I will commit my tests latest this Friday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Community sticker Usage System & Limits Feat: Core Sticker Contract Foundation

2 participants