Skip to content

feat(course-registry): mint soulbound badge on course completion#65

Open
ryzen-xp wants to merge 3 commits into
learnault:mainfrom
ryzen-xp:eat/course-completion-badge
Open

feat(course-registry): mint soulbound badge on course completion#65
ryzen-xp wants to merge 3 commits into
learnault:mainfrom
ryzen-xp:eat/course-completion-badge

Conversation

@ryzen-xp
Copy link
Copy Markdown

feat(course-registry): mint soulbound badge on course completion


Summary

Adds a cross-contract call from CourseRegistry to BadgeNFT so that a learner automatically receives their soulbound badge the moment they complete the final module of a course.


Changes

  • badge-nft/Cargo.toml — added a testutils feature flag (soroban-sdk/testutils) so the crate can be consumed with test utilities by downstream contracts.

  • course-registry/Cargo.toml — added badge-nft as a path dependency (runtime) and with testutils feature (dev).

  • course-registry/src/types.rs — added BadgeNftAddress variant to DataKey for storing the badge contract address in instance storage.

  • course-registry/src/lib.rs

    • Imported BadgeNFTClient.
    • Added set_badge_nft(admin, badge_nft_address) — admin-only function to register the BadgeNFT contract address post-deployment.
    • In complete_module, after progress is saved, added the completion block: when new_progress == course.total_modules and a badge address is configured, calls badge_nft.mint_badge(&env.current_contract_address(), &learner, &course_id). Guarded with if let Some(...) so the registry degrades gracefully if no badge contract is wired.
  • Screenshot From 2026-05-29 17-34-10

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@ryzen-xp 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

Copy link
Copy Markdown
Contributor

@Kaylahray Kaylahray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ryzen-xp Please Kindly resolve CI issues

image

- Add badge-nft contract to workspace members in root Cargo.toml
- Remove contracts/Cargo.lock to avoid lock file duplication
- Remove contracts/Cargo.toml as workspace is now managed from root
- Update badge-nft/Cargo.toml dependencies
- Add Makefile to badge-nft contract for build automation
- Update course-registry/Cargo.toml configuration
- Consolidate workspace management under root Cargo.toml for cleaner dependency resolution
@ryzen-xp
Copy link
Copy Markdown
Author

Screenshot From 2026-05-30 18-25-12

@ryzen-xp ryzen-xp requested a review from Kaylahray May 30, 2026 12:55
Copy link
Copy Markdown
Contributor

@Kaylahray Kaylahray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ryzen-xp Sorry you have conflicts. could you clone again and don't delete the toml

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.

[CourseRegistry] Trigger badge minting on completion

2 participants