Skip to content

feat: implement participants storage map and waste transfer history#103

Merged
Xoulomon merged 3 commits intoXoulomon:mainfrom
limitlxx:participantstorage
Feb 24, 2026
Merged

feat: implement participants storage map and waste transfer history#103
Xoulomon merged 3 commits intoXoulomon:mainfrom
limitlxx:participantstorage

Conversation

@limitlxx
Copy link
Contributor

@limitlxx limitlxx commented Feb 23, 2026

  • Add participants storage with get/set functions
  • Implement registration checks to prevent duplicates
  • Add update functions that preserve registration data
  • Create waste transfer history storage with immutable records
  • Implement transfer_waste function with ownership validation
  • Add chronological transfer history tracking
  • Create comprehensive documentation for both features
  • Add 84 passing tests covering all functionality

Storage architecture:

  • Participants: (address,) → Participant
  • Transfer history: ('transfers', waste_id) → Vec

New functions:

  • set_participant (internal helper)
  • is_participant_registered
  • transfer_waste
  • get_transfer_history
  • record_transfer (internal)
  • get_transfers_from/to (placeholder for future indexing)

Closes #29

- Add participants storage with get/set functions
- Implement registration checks to prevent duplicates
- Add update functions that preserve registration data
- Create waste transfer history storage with immutable records
- Implement transfer_waste function with ownership validation
- Add chronological transfer history tracking
- Create comprehensive documentation for both features
- Add 84 passing tests covering all functionality

Storage architecture:
- Participants: (address,) → Participant
- Transfer history: ('transfers', waste_id) → Vec<WasteTransfer>

New functions:
- set_participant (internal helper)
- is_participant_registered
- transfer_waste
- get_transfer_history
- record_transfer (internal)
- get_transfers_from/to (placeholder for future indexing)

Closes Xoulomon#2 and Xoulomon#1
- Add Incentive type with budget management and reward calculation
- Implement three storage maps: incentive by ID, by rewarder, by waste type
- Add create_incentive, deactivate_incentive, and claim_incentive_reward functions
- Support multiple incentives per manufacturer
- Auto-deactivate incentives when budget exhausted
- Add comprehensive tests for all incentive operations
- Update documentation with INCENTIVE_STORAGE_IMPLEMENTATION.md

closes Xoulomon#30
@Xoulomon Xoulomon merged commit 764f72e into Xoulomon:main Feb 24, 2026
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.

Implement Participants Storage Map

2 participants