Skip to content

Feature/add material struct#95

Merged
Xoulomon merged 3 commits intoXoulomon:mainfrom
Mystery-CLI:feature/add-material-struct
Feb 23, 2026
Merged

Feature/add material struct#95
Xoulomon merged 3 commits intoXoulomon:mainfrom
Mystery-CLI:feature/add-material-struct

Conversation

@Mystery-CLI
Copy link
Contributor

closes #17

- Create stellar-contract/ directory with Soroban smart contract
- Implement ParticipantRole enum (Recycler, Collector, Manufacturer)
- Add Soroban storage traits and validation logic
- Add 11 comprehensive unit tests covering all role types
- Create CI/CD pipeline with GitHub Actions
- Add build and verification scripts (bash and PowerShell)
- Configure Soroban CLI with network settings
- Update README with complete project documentation
- Add frontend/ directory structure for future implementation
- Remove old frontend files and contracts

Closes Xoulomon#1 - Initialize Stellar Rust Project Structure
Closes Xoulomon#2 - Implement ParticipantRole Enum in Rust
- Add WasteType enum with 5 variants: Paper, PetPlastic, Plastic, Metal, Glass
- Implement Soroban storage traits via #[contracttype] attribute
- Add Display trait for string conversion
- Implement helper methods: is_valid, from_u32, to_u32, as_str
- Add domain-specific methods: is_plastic, is_biodegradable, is_infinitely_recyclable
- Add 14 comprehensive unit tests covering all functionality
- Add Soroban storage serialization tests
- Export WasteType from lib.rs

All acceptance criteria met:
- Enum compiles without errors
- Can be stored in Soroban storage (TryFromVal/TryIntoVal)
- Tests pass for all variants
- Display trait implemented for string conversion

Closes Xoulomon#3 - Implement WasteType Enum in Rust
- Add Material struct to track recyclable material submissions
- Implement reward point calculation based on waste type and weight
- Add material submission, retrieval, and verification functions
- Add minimum weight requirement validation (100g)
- Implement reward multipliers: Paper(1x), PetPlastic(3x), Plastic(2x), Metal(5x), Glass(2x)
- Add 5 comprehensive tests for material operations
- Add material tracking documentation

New Features:
- submit_material(): Submit recyclable materials with description
- get_material(): Retrieve material by ID
- verify_material(): Recyclers can verify material submissions
- calculate_reward_points(): Automatic reward calculation
- meets_minimum_weight(): Weight validation

Integration:
- Uses WasteType enum for material categorization
- Integrates with ParticipantRole for verification permissions
- Soroban storage compatible with #[contracttype]

Documentation:
- Added MATERIAL_TRACKING.txt with complete system overview
- Reward point system explained
- Workflow and storage details included
@Xoulomon Xoulomon merged commit de9ed9e into Xoulomon:main Feb 23, 2026
0 of 2 checks passed
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.

Define WasteType Enum

3 participants