Repository navigation
feat: add on-chain puzzle completion, solution hash verification, and… - #807
Merged
Merged
Conversation
… token reward payouts
|
@Fatimasanusi 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! 🚀 |
dzekojohn4
approved these changes
Oct 21, 2026
dzekojohn4
left a comment
Contributor
There was a problem hiding this comment.
On-chain completion with solution hash verification — nicely done, the flow reads clearly. Ship it 🚀
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.
Summary
This pull request implements on-chain puzzle completion verification, solution hash comparison, SAC token reward payouts, and CAP-54 style puzzle reward NFT minting.
Closes #683
Closes #680
Closes #671
Closes #670
Key Changes
1. Puzzle Solution Hash Verification (#683)
stellar_hunts):add_question_with_hashto store questions directly with precomputed 32-byte SHA-256 hashes.submit_answerto support direct 32-byte solution hash validation alongside raw answers.verify_solution_hashview andError::HashMismatchrejection.usePuzzleContract.js):computeSolutionHashusing Web Crypto (crypto.subtle) for consistent client-side SHA-256 generation.submitAnswerto hash solutions before on-chain submission.2. Cross-Contract Reward Token Payouts (#680)
stellar_hunts):set_reward_token,get_reward_token,set_default_reward_amount, andset_puzzle_reward_amount.try_payout_rewardutilizing the SAC / token interface (soroban_sdk::token::Client).try_transfer, raisingError::RewardTransferFailedif token transfer fails.claim_puzzle_rewardentrypoint for claiming completed puzzle rewards.3. NFT Minting Contract for Puzzle Rewards (#671)
stellar_hunts_nft):mint_puzzle_reward_nftrestricted to authorized hunter contracts viaminter.require_auth()andhas_minter_role.PuzzleRewardMetadatacontaining puzzle name, difficulty, completion timestamp, and minter address.Error::DuplicateCompletion.has_puzzle_rewardandget_puzzle_metadataview methods.stellar_hunts):claim_puzzle_nftfor cross-contract NFT minting upon puzzle completion.4. Puzzle Completion Entrypoint (#670)
stellar_hunts):complete_puzzle(env, caller, puzzle_id, solution_hash)entrypoint to validate solutions trustlessly on-chain.puzzle_completedevent with(caller, puzzle_id).DataKey::CompletedPuzzle) and prevents duplicate completions (Error::AlreadyCompleted).is_puzzle_completedview function.usePuzzleContract.js):completePuzzlehook action for executing completions with client-side hashing.