@ballkidz/defifa 0.0.40 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/USER_JOURNEYS.md DELETED
@@ -1,169 +0,0 @@
1
- # User Journeys
2
-
3
- ## Repo Purpose
4
-
5
- This repo turns a Juicebox project into a prediction-game lifecycle with fixed phase timing, tiered outcome pieces, attestation-based scorecard governance, and final cash-out weights that decide how the pot settles. It owns Defifa's game-specific launch, scoring, no-contest, and settlement logic.
6
-
7
- ## Primary Actors
8
-
9
- - game creators launching a new Defifa market with fixed timing, tiers, and fee routing
10
- - players minting outcome pieces during MINT and later redeeming or refunding them
11
- - attestors and delegates submitting, supporting, revoking, and ratifying scorecards during SCORING
12
- - auditors tracing where game fairness depends on shared 721-store behavior, governor state, and core terminal flows
13
- - operators handling no-contest recovery or optional fee-project ownership locking
14
-
15
- ## Key Surfaces
16
-
17
- - `DefifaDeployer.launchGameWith(...)`: launches a Defifa game as a JB project and wires hook, governor, splits, and lifecycle timing
18
- - `DefifaHook.afterPayRecordedWith(...)`: mints outcome NFTs when players pay during the mintable phase
19
- - `DefifaHook.beforeCashOutRecordedWith(...)` and `afterCashOutRecordedWith(...)`: define refund, winning-piece redemption, and fee-token claim behavior
20
- - `DefifaGovernor.submitScorecardFor(...)`, `attestToScorecardFrom(...)`, `revokeAttestationFrom(...)`, `ratifyScorecardFrom(...)`: scorecard governance lifecycle
21
- - `DefifaDeployer.fulfillCommitmentsOf(...)` and `triggerNoContestFor(...)`: finalize commitments after ratification or unlock refund-oriented no-contest recovery
22
-
23
- ## Journey 1: Launch A Defifa Game
24
-
25
- **Actor:** game creator.
26
-
27
- **Intent:** launch a prediction game with fixed timing, tiers, fee routing, and governance rules.
28
-
29
- **Preconditions**
30
-
31
- - the creator knows the game start time, mint duration, optional refund duration, and scoring-timeout assumptions
32
- - tier count, tier names, tier price, and split commitments are finalized
33
- - the chosen terminal and payment token are correct because the launch path is intentionally one-way
34
-
35
- **Main Flow**
36
-
37
- 1. Prepare launch data with timing, tiers, splits, fee-project settings, terminal, and governance params.
38
- 2. Call `DefifaDeployer.launchGameWith(...)`.
39
- 3. The deployer launches the JB project, clones and initializes `DefifaHook`, initializes the governor state, and stores the game's immutable ops data.
40
- 4. The game now advances through its documented phase sequence.
41
-
42
- **Failure Modes**
43
-
44
- - launch parameters are wrong, but the creator assumes they can patch them later
45
- - fee routing, token decimals, or terminal assumptions drift from the terminal actually configured
46
- - the creator mistakes permissionless launch for ongoing admin power
47
-
48
- **Postconditions**
49
-
50
- - the game exists as a staged JB project with Defifa-specific lifecycle wiring
51
-
52
- ## Journey 2: Mint Outcome Pieces During Open Play
53
-
54
- **Actor:** player.
55
-
56
- **Intent:** buy one or more outcome pieces during the mint phase.
57
-
58
- **Preconditions**
59
-
60
- - the game is in the mintable phase
61
- - the selected tier exists and is still mintable
62
-
63
- **Main Flow**
64
-
65
- 1. Pay the game project during the mint window.
66
- 2. `DefifaHook` mints the selected outcome NFT tier.
67
- 3. Delegation and mint-cost accounting are updated.
68
- 4. Reserved mints and pending reserves continue to matter for later governance and settlement.
69
-
70
- **Failure Modes**
71
-
72
- - mint is attempted in the wrong phase
73
- - assumptions about attestation power ignore pending reserves or tier weighting
74
-
75
- **Postconditions**
76
-
77
- - the player holds game pieces that later affect governance and settlement
78
-
79
- ## Journey 3: Submit And Ratify A Scorecard
80
-
81
- **Actor:** proposer, attestor, or delegate.
82
-
83
- **Intent:** turn the game's result into a ratified scorecard.
84
-
85
- **Preconditions**
86
-
87
- - the game is in SCORING
88
- - the actor understands quorum, grace-period, and timeout rules
89
-
90
- **Main Flow**
91
-
92
- 1. Submit a scorecard candidate.
93
- 2. Attest or revoke while the scorecard is active.
94
- 3. Wait for quorum and the grace period.
95
- 4. Ratify one winning scorecard.
96
-
97
- **Failure Modes**
98
-
99
- - attestation power is concentrated enough to capture the result
100
- - timeout is reached before ratification
101
- - integrations misread live attestation power or pending-reserve dilution
102
-
103
- **Postconditions**
104
-
105
- - exactly one scorecard can become the game's final outcome, or the game moves toward no-contest handling
106
-
107
- ## Journey 4: Fulfill Commitments And Settle The Game
108
-
109
- **Actor:** completion path caller.
110
-
111
- **Intent:** turn the ratified scorecard into final redeemable economics.
112
-
113
- **Preconditions**
114
-
115
- - a scorecard has been ratified
116
- - the fulfillment path has not already run
117
-
118
- **Main Flow**
119
-
120
- 1. Read the ratified outcome.
121
- 2. Call `fulfillCommitmentsOf(...)`.
122
- 3. Queue the completion ruleset and finalize the promised commitment flow.
123
- 4. Let winning-piece holders redeem under the installed cash-out weights.
124
-
125
- **Failure Modes**
126
-
127
- - ratification succeeds but fulfillment is never run
128
- - commitment logic or fee accounting drifts from the documented outcome
129
-
130
- **Postconditions**
131
-
132
- - the game enters its final redeemable state
133
-
134
- ## Journey 5: Enter No-Contest And Unlock Refund Recovery
135
-
136
- **Actor:** any caller when the no-contest conditions are met.
137
-
138
- **Intent:** move a game out of failed scoring and into the documented refund-oriented fallback path.
139
-
140
- **Preconditions**
141
-
142
- - the game has hit its no-contest conditions
143
- - the caller understands that `NO_CONTEST` and active refund rules are related but not identical states
144
-
145
- **Main Flow**
146
-
147
- 1. Call `triggerNoContestFor(...)` when the timeout or participation conditions make the game ineligible for normal settlement.
148
- 2. Queue the no-contest recovery ruleset.
149
- 3. Let players exit under the fallback path once the queued ruleset becomes active.
150
-
151
- **Failure Modes**
152
-
153
- - integrators assume same-transaction full refunds immediately after the trigger
154
- - the game becomes stuck because nobody triggers the no-contest path
155
-
156
- **Postconditions**
157
-
158
- - the game moves onto the documented no-contest recovery track
159
-
160
- ## Trust Boundaries
161
-
162
- - this repo is trusted for game-specific phase logic, governance, and settlement weighting
163
- - terminal accounting still comes from `nana-core-v6`
164
- - shared tier-storage behavior still comes from `nana-721-hook-v6`
165
-
166
- ## Hand-Offs
167
-
168
- - Use [nana-core-v6](../nana-core-v6/USER_JOURNEYS.md) for underlying treasury and terminal behavior.
169
- - Use [nana-721-hook-v6](../nana-721-hook-v6/USER_JOURNEYS.md) for shared tier-store and reserve semantics that Defifa builds on.