Skip to content

feat: Achievement Points Ledger - #419

Merged
Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
Nacho1499:feat/Achievement-Points-Ledger
Nov 23, 2026
Merged

Mkalbani merged 1 commit into
MindFlowInteractive:mainfrom
Nacho1499:feat/Achievement-Points-Ledger

Conversation

@Nacho1499

@Nacho1499 Nacho1499 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #402

Summary

Adds the points_ledger contract. Players earn points for on-chain actions such as completing puzzles or unlocking achievements. Each player has a points balance and a full history of earn events.

Changes

  • contracts/points_ledger/src/types.rs: PointsEntry (amount, reason code, awarder, timestamp) and storage keys for balance, history, admin and awarders
  • contracts/points_ledger/src/lib.rs:
    • initialize(admin)
    • add_awarder / remove_awarder / is_awarder: admin-managed list of contracts allowed to award points
    • earn(awarder, player, amount, reason): authorized only; adds an entry to the history, updates the balance and emits an earned event
    • balance(player) / history(player)
  • contracts/points_ledger/src/tests.rs: unit tests
  • Root Cargo.toml: adds the contract to the workspace

Acceptance criteria

  • Only authorized contracts can award points
  • Balance equals sum of history entries
  • All tests pass

Tests

  • Authorized award records the correct entry and balance
  • Balance equals the sum of history entries across several earns
  • Players are tracked independently
  • Unknown and removed awarders are rejected
  • Zero amount is rejected
  • Double initialization is rejected
  • Only the admin can add awarders

…d awarders earn points for players, each earn is recorded with a reason code, and balance and history can be read per player. Includes unit tests
@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@Nacho1499 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Mkalbani
Mkalbani merged commit ef36894 into MindFlowInteractive:main Nov 23, 2026
@grantfox-oss grantfox-oss Bot mentioned this pull request Nov 23, 2026
5 tasks
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.

Achievement Points Ledger

2 participants