feat(course-registry): mint soulbound badge on course completion#65
Open
ryzen-xp wants to merge 3 commits into
Open
feat(course-registry): mint soulbound badge on course completion#65ryzen-xp wants to merge 3 commits into
ryzen-xp wants to merge 3 commits into
Conversation
|
@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! 🚀 |
- 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
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


feat(course-registry): mint soulbound badge on course completion
Summary
Adds a cross-contract call from
CourseRegistrytoBadgeNFTso that a learner automatically receives their soulbound badge the moment they complete the final module of a course.Changes
badge-nft/Cargo.toml— added atestutilsfeature flag (soroban-sdk/testutils) so the crate can be consumed with test utilities by downstream contracts.course-registry/Cargo.toml— addedbadge-nftas a path dependency (runtime) and withtestutilsfeature (dev).course-registry/src/types.rs— addedBadgeNftAddressvariant toDataKeyfor storing the badge contract address in instance storage.course-registry/src/lib.rsBadgeNFTClient.set_badge_nft(admin, badge_nft_address)— admin-only function to register the BadgeNFT contract address post-deployment.complete_module, after progress is saved, added the completion block: whennew_progress == course.total_modulesand a badge address is configured, callsbadge_nft.mint_badge(&env.current_contract_address(), &learner, &course_id). Guarded withif let Some(...)so the registry degrades gracefully if no badge contract is wired.