Summary
Implement the connection Soroban smart contract that records trial offer agreements between scouts and players on-chain, and advances a player to Elite Tier (Level 3) when a trial offer is logged.
Category
Priority
Depends On
#216 (workspace scaffold), #217 (register.rs — must update player progress level), #218 (progress.rs — shares validator registry)
Description
| Function |
Description |
log_trial_offer(scout, player_id, details_uri) |
Scout records a trial offer; advances player to Level 3; emits trial_offer_logged |
get_connections(player_id) |
Read-only: returns all scout-player connection records for a player |
get_trial_offers(scout) |
Read-only: returns all trial offers made by a scout |
Level 3 promotion logic:
When log_trial_offer is called:
- Verify caller is a scout with an active subscription OR has paid the contact fee for this player.
- Write a
TrialOffer record to persistent storage.
- Call into
register contract storage to set player's progress_level = 3.
- Emit
trial_offer_logged event with topics ["trial_offer_logged", scout, player_id].
Storage:
- Key:
TrialOfferKey(scout, player_id) → TrialOfferData { details_uri, created_at }
Test Cases Required
Summary
Implement the
connectionSoroban smart contract that records trial offer agreements between scouts and players on-chain, and advances a player to Elite Tier (Level 3) when a trial offer is logged.Category
Priority
Depends On
#216 (workspace scaffold), #217 (register.rs — must update player progress level), #218 (progress.rs — shares validator registry)
Description
log_trial_offer(scout, player_id, details_uri)trial_offer_loggedget_connections(player_id)get_trial_offers(scout)Level 3 promotion logic:
When
log_trial_offeris called:TrialOfferrecord to persistent storage.registercontract storage to set player'sprogress_level = 3.trial_offer_loggedevent with topics["trial_offer_logged", scout, player_id].Storage:
TrialOfferKey(scout, player_id)→TrialOfferData { details_uri, created_at }Test Cases Required
log_trial_offerpromotes player from Level 2 to Level 3log_trial_offerrequires scout to be subscribed or have paid contact feeget_connectionsreturns correct records