@ballkidz/defifa 0.0.25 → 0.0.27

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.
Files changed (65) hide show
  1. package/AUDIT_INSTRUCTIONS.md +6 -2
  2. package/README.md +11 -2
  3. package/RISKS.md +3 -1
  4. package/STYLE_GUIDE.md +14 -11
  5. package/package.json +31 -14
  6. package/script/Deploy.s.sol +4 -1
  7. package/src/DefifaDeployer.sol +79 -47
  8. package/src/DefifaGovernor.sol +57 -12
  9. package/src/DefifaHook.sol +83 -26
  10. package/src/DefifaProjectOwner.sol +4 -3
  11. package/src/DefifaTokenUriResolver.sol +113 -20
  12. package/src/enums/DefifaGamePhase.sol +6 -0
  13. package/src/enums/DefifaScorecardState.sol +4 -0
  14. package/src/interfaces/IDefifaDeployer.sol +5 -0
  15. package/src/interfaces/IDefifaGamePhaseReporter.sol +4 -0
  16. package/src/interfaces/IDefifaGamePotReporter.sol +10 -0
  17. package/src/interfaces/IDefifaGovernor.sol +4 -0
  18. package/src/interfaces/IDefifaHook.sol +5 -0
  19. package/src/interfaces/IDefifaTokenUriResolver.sol +3 -0
  20. package/src/libraries/DefifaFontImporter.sol +1 -1
  21. package/src/libraries/DefifaHookLib.sol +9 -10
  22. package/src/structs/DefifaAttestations.sol +3 -2
  23. package/src/structs/DefifaDelegation.sol +1 -0
  24. package/src/structs/DefifaLaunchProjectData.sol +2 -3
  25. package/src/structs/DefifaOpsData.sol +1 -0
  26. package/src/structs/DefifaScorecard.sol +2 -0
  27. package/src/structs/DefifaTierCashOutWeight.sol +3 -1
  28. package/src/structs/DefifaTierParams.sol +1 -0
  29. package/CRYPTO_ECON.pdf +0 -0
  30. package/CRYPTO_ECON.tex +0 -997
  31. package/foundry.lock +0 -17
  32. package/references/operations.md +0 -32
  33. package/references/runtime.md +0 -43
  34. package/slither-ci.config.json +0 -10
  35. package/sphinx.lock +0 -521
  36. package/test/BWAFunctionComparison.t.sol +0 -1320
  37. package/test/DefifaAdversarialQuorum.t.sol +0 -617
  38. package/test/DefifaAuditLowGuards.t.sol +0 -308
  39. package/test/DefifaFeeAccounting.t.sol +0 -581
  40. package/test/DefifaGovernanceHardening.t.sol +0 -1315
  41. package/test/DefifaGovernor.t.sol +0 -1378
  42. package/test/DefifaHookRegressions.t.sol +0 -415
  43. package/test/DefifaMintCostInvariant.t.sol +0 -319
  44. package/test/DefifaNoContest.t.sol +0 -941
  45. package/test/DefifaSecurity.t.sol +0 -741
  46. package/test/DefifaUSDC.t.sol +0 -480
  47. package/test/Fork.t.sol +0 -2388
  48. package/test/TestAuditGaps.sol +0 -984
  49. package/test/TestQALastMile.t.sol +0 -514
  50. package/test/audit/AttestationDoubleCount.t.sol +0 -218
  51. package/test/audit/CodexNemesisCurrencyMismatchBypass.t.sol +0 -112
  52. package/test/audit/CodexNemesisNoContestReserveDrain.t.sol +0 -238
  53. package/test/audit/CodexNemesisOneTierZeroTimeoutLockVerified.t.sol +0 -218
  54. package/test/audit/CodexNemesisSingleTierTimeoutLock.t.sol +0 -237
  55. package/test/audit/CodexRegistryMismatch.t.sol +0 -191
  56. package/test/audit/CodexTierCapMismatch.t.sol +0 -171
  57. package/test/audit/CurrencyMismatchFix.t.sol +0 -265
  58. package/test/audit/FixPendingReserveDilution.t.sol +0 -366
  59. package/test/audit/H5TierCapValidation.t.sol +0 -184
  60. package/test/audit/PendingReserveDilution.t.sol +0 -298
  61. package/test/audit/PendingReserveQuorumGrief.t.sol +0 -355
  62. package/test/audit/PendingReserveSnapshotBypass.t.sol +0 -319
  63. package/test/regression/AttestationDelegateBeneficiary.t.sol +0 -271
  64. package/test/regression/FulfillmentBlocksRatification.t.sol +0 -279
  65. package/test/regression/GracePeriodBypass.t.sol +0 -302
package/CRYPTO_ECON.tex DELETED
@@ -1,997 +0,0 @@
1
- \documentclass[11pt,a4paper]{article}
2
-
3
- \usepackage[utf8]{inputenc}
4
- \usepackage[T1]{fontenc}
5
- \usepackage{lmodern}
6
- \usepackage{amsmath,amssymb,amsthm}
7
- \usepackage{graphicx}
8
- \usepackage{hyperref}
9
- \usepackage{geometry}
10
- \usepackage{booktabs}
11
- \usepackage{enumitem}
12
- \usepackage{float}
13
- \usepackage{xcolor}
14
-
15
- \geometry{margin=1in}
16
- \emergencystretch=1.5em
17
-
18
- \hypersetup{
19
- colorlinks=true,
20
- linkcolor=blue!70!black,
21
- urlcolor=blue!70!black,
22
- citecolor=blue!70!black
23
- }
24
-
25
- \newtheorem{theorem}{Theorem}
26
- \newtheorem{corollary}[theorem]{Corollary}
27
- \newtheorem{definition}{Definition}
28
-
29
- \title{\textbf{Cryptoeconomics of Defifa}}
30
- \author{Claude Opus 4.6 (Anthropic) in coordination with Jango from the Defifa Team.\\[4pt]
31
- \small This analysis was generated by Claude Opus 4.6 based on its study of the Defifa V6 codebase\\
32
- \small and the \href{https://cryptoeconlab.com/paper/pub-0?paper=https\%253A\%252F\%252Fstorage.googleapis.com\%252Fcel-public-resources\%252FRevnet-Whitepaper.pdf}{Revnet Whitepaper} by CryptoEconLab.}
33
- \date{March 2026}
34
-
35
- \begin{document}
36
-
37
- \maketitle
38
-
39
- \begin{abstract}
40
- Defifa is a prediction-game protocol built on Juicebox V6 that transforms NFT minting into a parimutuel wagering mechanism with governance-ratified outcomes. Players purchase ERC-721 game pieces representing competing tiers (teams, candidates, outcomes), forming a shared treasury. After the event concludes, a decentralized attestation process ratifies a scorecard that assigns weights to each tier, redistributing the treasury proportionally. This paper formalizes the cryptoeconomic mechanics of Defifa games: the prize distribution formula, the attestation governance model, the fee extraction pipeline, the protocol-token incentive layer, and the rational actor strategies that emerge. We derive solvency guarantees, characterize equilibrium behavior under various participation profiles, analyze the game-theoretic properties of the scorecard ratification process, and identify the parameter regimes that maximize game integrity and participant welfare.
41
-
42
- Throughout, we illustrate the mechanics with a running example: a \textbf{FIFA World Cup game with 32 tiers}---one per national team---priced at 0.01~ETH each.
43
- \end{abstract}
44
-
45
- \tableofcontents
46
- \newpage
47
-
48
- %==========================================================================
49
- \section{Introduction}
50
- %==========================================================================
51
-
52
- \subsection{What is Defifa?}
53
-
54
- Defifa is a prediction-game protocol that transforms the act of purchasing an NFT into a wager on the outcome of a real-world event. It is deployed using the Juicebox V6 protocol and governed by a combination of immutable smart-contract rules and a minimal, time-bounded governance process for outcome resolution.
55
-
56
- A Defifa game is a \emph{tokenized parimutuel pool}: money goes in via NFT purchases, forming a shared pot; after the event concludes, a governance process assigns weights to each tier (team, outcome, candidate), and the pot is distributed proportionally. The game pieces are ERC-721 tokens organized into tiers, where each tier represents a distinct prediction. The purchase price is uniform across all tiers---enforced at the protocol level---and the payout is determined by post-event scorecard ratification.
57
-
58
- \textbf{Running example: World Cup 2026.} Imagine a Defifa game for the FIFA World Cup with 32 tiers---one for each national team---priced at 0.01~ETH each. Argentina is Tier~1, France is Tier~2, Brazil is Tier~3, \ldots, and Saudi Arabia is Tier~32. Anyone can mint NFTs for the team they believe will win (or perform well), and after the tournament, a scorecard assigns weights reflecting the actual results.
59
-
60
- Defifa games are:
61
- \begin{itemize}[nosep]
62
- \item \textbf{Deterministic in structure}: all phases, durations, tier prices, and fee schedules are fixed at deployment.
63
- \item \textbf{Governance-minimal}: the only human input is the scorecard---a mapping from tiers to weights---ratified through an attestation process.
64
- \item \textbf{Self-custodial}: all funds remain in the Juicebox treasury; no operator can access them outside the protocol rules.
65
- \item \textbf{Composable}: games are standard Juicebox projects, inheriting the full protocol's accounting, terminal, and hook infrastructure.
66
- \end{itemize}
67
-
68
- \subsection{How a Defifa Game Works (at a glance)}
69
-
70
- \begin{enumerate}[nosep]
71
- \item \textbf{Mint (pot formation).} During the mint phase, anyone can purchase NFTs representing tiers at the game's uniform price. All payments flow into a shared treasury---the \emph{pot}. Players may delegate their attestation power to a chosen delegate at mint time.
72
-
73
- \item \textbf{Refund (optional exit window).} If configured, a refund phase follows minting. During this period, players may burn their NFTs to reclaim the original mint price, allowing a risk-free exit for those who change their minds. No new mints are accepted.
74
-
75
- \item \textbf{Score (outcome resolution).} Once the real-world event concludes, anyone may propose a \emph{scorecard}---a vector of weights summing to $W_{\text{total}} = 10^{18}$---assigning each tier its share of the pot. NFT holders attest to the scorecard they believe reflects the correct outcome. Once a scorecard achieves quorum, it can be ratified. Scorecard submission is restricted to the SCORING phase---no pre-scoring submissions are allowed.
76
-
77
- \item \textbf{Complete (prize distribution).} After ratification, protocol fees are extracted, and the remaining pot is available for claims. Each NFT holder burns their token to receive their proportional share, plus any accrued protocol tokens (\$DEFIFA and \$NANA).
78
-
79
- \item \textbf{No contest (safety fallback).} If the game fails to attract sufficient participation or the scorecard is not ratified within the configured timeout, the game enters a NO\_CONTEST state where all players can reclaim their original mint prices.
80
- \end{enumerate}
81
-
82
- \textbf{World Cup example.} The World Cup game mints for 30 days before the tournament. Fans buy Argentina NFTs, France NFTs, etc. After the final, someone submits a scorecard: the champion's tier gets 40\% of the weight, the runner-up gets 20\%, semifinalists get 10\% each, and quarterfinalists share the remaining 20\%. Holders attest, the scorecard is ratified, fees are extracted, and holders of the champion's NFTs receive their proportional share of a now-concentrated prize pool.
83
-
84
- \subsection{The Design Parameters}
85
-
86
- A Defifa game is fully specified at deployment by a parameter tuple:
87
- \begin{equation}
88
- \mathcal{G} = \left( \{T_i\}_{i=1}^{N}, \; p, \; t_{\text{mint}}, \; t_{\text{refund}}, \; t_{\text{start}}, \; \phi_{\text{defifa}}, \; \phi_{\text{base}}, \; \mathcal{S}, \; \tau_{\text{attest}}, \; \tau_{\text{grace}}, \; m_{\text{min}}, \; \tau_{\text{timeout}} \right)
89
- \end{equation}
90
-
91
- Where:
92
- \begin{enumerate}[nosep]
93
- \item \textbf{Tier configuration} $\{T_i\}_{i=1}^{N}$: For each of the $N$ tiers (maximum~128), an optional reserved rate $\rho_i$, a reserved-token beneficiary address, a name, and an optional IPFS URI. The initial supply per tier is set to $999{,}999{,}999$ (effectively unlimited).
94
-
95
- \item \textbf{Uniform tier price} ($p$): A single fixed price applied to all tiers, denominated in the game's base asset. Uniform pricing is enforced at the protocol level via the \texttt{tierPrice} parameter, ensuring that price-based voting power is equal across tiers.
96
-
97
- \item \textbf{Mint period duration} ($t_{\text{mint}}$): How long the minting window stays open, in seconds.
98
-
99
- \item \textbf{Refund period duration} ($t_{\text{refund}}$): How long the refund window stays open after minting closes. May be zero (no refund phase).
100
-
101
- \item \textbf{Game start time} ($t_{\text{start}}$): When the scoring phase begins---typically aligned with the real-world event's conclusion.
102
-
103
- \item \textbf{Defifa fee divisor} ($\phi_{\text{defifa}}$): The fraction $1/\phi_{\text{defifa}}$ of the pot sent to the Defifa protocol project. Default: $\phi_{\text{defifa}} = 20$ (5\%).
104
-
105
- \item \textbf{Base protocol fee divisor} ($\phi_{\text{base}}$): The fraction $1/\phi_{\text{base}}$ of the pot sent to the base protocol (NANA) project. Default: $\phi_{\text{base}} = 40$ (2.5\%).
106
-
107
- \item \textbf{Splits} ($\mathcal{S}$): Additional payout splits configured at deployment (e.g., for game organizers, charities).
108
-
109
- \item \textbf{Attestation start time} ($\tau_{\text{attest}}$): The earliest time at which attestation voting opens on submitted scorecards.
110
-
111
- \item \textbf{Attestation grace period} ($\tau_{\text{grace}}$): Minimum duration attestations must remain open after $\tau_{\text{attest}}$. Protocol-enforced minimum: 1~day.
112
-
113
- \item \textbf{Minimum participation} ($m_{\text{min}}$): The minimum treasury balance required for the game to proceed to scoring. If the balance is below this threshold when SCORING would begin, the game enters NO\_CONTEST. Set to~0 to disable.
114
-
115
- \item \textbf{Scorecard timeout} ($\tau_{\text{timeout}}$): The maximum time (in seconds) after the scoring phase begins for a scorecard to be ratified. If exceeded without ratification, the game enters NO\_CONTEST. Set to~0 to disable.
116
- \end{enumerate}
117
-
118
- Once set, the tuple $\mathcal{G}$ is immutable. Phase transitions occur automatically by timestamp, with the scoring phase having infinite duration (duration $= 0$) until the scorecard is ratified or the timeout elapses.
119
-
120
- %==========================================================================
121
- \section{Mathematical Model of Defifa Economics}
122
- %==========================================================================
123
-
124
- \subsection{Parameters and State Variables}
125
-
126
- The economic behavior of a Defifa game is determined jointly by:
127
- \begin{enumerate}[nosep]
128
- \item The immutable game parameters $\mathcal{G}$ (cf.\ Section~1.3), fixed at deployment;
129
- \item The evolving state variables, which track the pot, token supplies, and claim status over time.
130
- \end{enumerate}
131
-
132
- \textbf{State variables.} The core dynamic variables are listed in Table~\ref{tab:state}.
133
-
134
- \begin{table}[H]
135
- \centering
136
- \begin{tabular}{ll}
137
- \toprule
138
- \textbf{Variable} & \textbf{Description} \\
139
- \midrule
140
- $B(t)$ & Pot (treasury balance) at time $t$ \\
141
- $n_i(t)$ & Number of NFTs minted in tier $i$ at time $t$ \\
142
- $N_{\text{total}}(t)$ & Total NFTs outstanding: $\sum_i n_i(t)$ \\
143
- $M(t)$ & Total mint cost accumulated: $N_{\text{total}}(t) \cdot p$ \\
144
- $w_i$ & Scorecard weight assigned to tier $i$ ($\sum_i w_i = W_{\text{total}}$) \\
145
- $d_i(t)$ & Tokens redeemed from tier $i$ after ratification \\
146
- $B_{\text{prize}}$ & Net prize pool after fee extraction \\
147
- \bottomrule
148
- \end{tabular}
149
- \caption{Core state variables of a Defifa game.}
150
- \label{tab:state}
151
- \end{table}
152
-
153
- Note that because all tiers share a uniform price $p$, the total mint cost simplifies to $M(t) = N_{\text{total}}(t) \cdot p$ and the pot composition is $B(t) = M(t)$. This uniformity is a deliberate design choice that ensures fair parimutuel dynamics---the pot fraction in each tier reflects only the \emph{count} of mints, not differential pricing.
154
-
155
- \subsection{Minting --- Pot Formation}
156
-
157
- During the mint phase $[t_{\text{mint\_start}},\; t_{\text{mint\_start}} + t_{\text{mint}})$, any participant may purchase NFTs from any tier $i$ at the uniform price $p$ per token.
158
-
159
- \textbf{Minted quantity.} For a payment amount $x$ of base asset directed at tier $i$:
160
- \begin{equation}
161
- q_i = \left\lfloor \frac{x}{p} \right\rfloor
162
- \end{equation}
163
-
164
- \textbf{Reserved minting.} If tier $i$ has a reserved rate $\rho_i > 0$, then for every $\rho_i$ tokens minted by paying players, one additional token is minted to the reserved-token beneficiary. Reserved tokens are \emph{not} paid for, but their cost is counted toward $M(t)$ for purposes of protocol-token distribution (cf.\ Section~2.6).
165
-
166
- \textbf{State updates.} At the instant of a mint event where player $j$ purchases $q$ tokens of tier $i$:
167
- \begin{align}
168
- B(t^+) &= B(t^-) + q \cdot p \\
169
- n_i(t^+) &= n_i(t^-) + q \\
170
- M(t^+) &= M(t^-) + q \cdot p
171
- \end{align}
172
-
173
- \textbf{Pot composition.} At the end of the mint phase, the pot is:
174
- \begin{equation}
175
- B_{\text{mint}} = \sum_{i=1}^{N} n_i \cdot p = N_{\text{total}} \cdot p
176
- \end{equation}
177
-
178
- \textbf{World Cup example.} Suppose the game attracts 15,000 total mints across 32 tiers. Argentina: 2,000 (13.3\%), France: 1,800 (12.0\%), Brazil: 1,500 (10.0\%), \ldots, Saudi Arabia: 10 (0.07\%). Total pot: $15{,}000 \times 0.01 = 150$~ETH. The pot fractions reveal the crowd's consensus probabilities.
179
-
180
- \subsection{Refund --- Optionality Window}
181
-
182
- If $t_{\text{refund}} > 0$, a refund phase follows minting. During $[t_{\text{mint\_end}},\; t_{\text{mint\_end}} + t_{\text{refund}})$:
183
- \begin{itemize}[nosep]
184
- \item No new mints are accepted (\texttt{pausePay} $=$ \texttt{true}).
185
- \item Any NFT holder may burn their token to reclaim its mint price.
186
- \end{itemize}
187
-
188
- \textbf{Refund mechanics.} A player burning $q$ tokens of tier $i$ receives exactly $q \cdot p$ base asset from the treasury:
189
- \begin{equation}
190
- R_{\text{refund}} = q \cdot p
191
- \end{equation}
192
-
193
- Because all tiers share the uniform price $p$, the per-NFT backing ratio $B(t) / N_{\text{total}}(t) = p$ is always preserved.
194
-
195
- \textbf{World Cup example.} Two days before the tournament, a star player for Brazil suffers an injury. 300 Brazil holders refund their NFTs, reducing the pot from 150~ETH to 147~ETH. The refund activity signals the belief shift---other participants observe the on-chain volume and update their expectations.
196
-
197
- \subsection{Prize Distribution --- The Scorecard Formula}
198
-
199
- After the real-world event concludes and a scorecard is ratified, the game enters the COMPLETE phase.
200
-
201
- \textbf{The scorecard.} A scorecard is a vector of weights $\mathbf{w} = (w_1, w_2, \ldots, w_N)$ satisfying:
202
- \begin{equation}
203
- \sum_{i=1}^{N} w_i = W_{\text{total}} = 10^{18}
204
- \end{equation}
205
-
206
- The exact-sum constraint is enforced on-chain---the \texttt{validateAndBuildWeights} function in \texttt{DefifaHookLib} reverts if the cumulative weight does not equal \texttt{TOTAL\_CASHOUT\_WEIGHT} exactly.
207
-
208
- \textbf{Per-token weight.} The weight assigned to a single NFT in tier $i$ is:
209
- \begin{equation}
210
- w_i^{\text{token}} = \frac{w_i}{\hat{n}_i}
211
- \end{equation}
212
-
213
- where $\hat{n}_i$ is the \emph{effective} number of tokens eligible for redemption in tier $i$:
214
- \begin{equation}
215
- \hat{n}_i = n_i^{\text{minted}} - n_i^{\text{remaining}} - (n_i^{\text{burned}} - d_i) + n_i^{\text{pendingReserves}}
216
- \end{equation}
217
-
218
- Including pending reserves in the denominator prevents paid holders from front-running reserve mints to extract disproportionate value.
219
-
220
- \textbf{Cash-out value.} When a player burns a set of token IDs $\{k_1, k_2, \ldots, k_m\}$, the total claim is:
221
- \begin{equation}
222
- \boxed{C(\{k_j\}) = \frac{\displaystyle\sum_{j=1}^{m} w_{i(k_j)}^{\text{token}}}{W_{\text{total}}} \cdot \bigl(B_{\text{prize}} + A_{\text{redeemed}}\bigr)}
223
- \label{eq:cashout}
224
- \end{equation}
225
-
226
- where $i(k_j)$ is the tier of token $k_j$, $B_{\text{prize}}$ is the current treasury balance (post-fee), and $A_{\text{redeemed}}$ is the cumulative amount already redeemed by prior players.
227
-
228
- The term $(B_{\text{prize}} + A_{\text{redeemed}})$ reconstructs the \emph{original} post-fee pot, ensuring that the order of redemptions does not affect the payout per token. This is a critical design property: it makes Defifa a \emph{path-independent} mechanism.
229
-
230
- \textbf{World Cup example.} Argentina wins; scorecard assigns 40\% to Argentina ($w_1 = 4 \times 10^{17}$). Post-fee pot: $147 \times 0.925 = 135.975$~ETH. An Argentina holder with 1~NFT receives: $\frac{4 \times 10^{17} / 2{,}000}{10^{18}} \times 135.975 \approx 0.0272$~ETH---a 2.72x return on their 0.01~ETH mint.
231
-
232
- \subsection{Fee Extraction Pipeline}
233
-
234
- Before prize distribution begins, the Deployer contract extracts protocol fees by calling \texttt{fulfill\-Commitments\-Of}. This function computes the fee amount and sends only the fee portion as payouts via \texttt{send\-Payouts\-Of}, while the remaining balance stays in the treasury as surplus for player cash-outs.
235
-
236
- \textbf{Split structure.} The splits configured at game launch allocate fees as follows:
237
- \begin{enumerate}[nosep]
238
- \item \textbf{Defifa fee:} $1/\phi_{\text{defifa}}$ of the pot to the Defifa project (default: $\phi_{\text{defifa}} = 20$, i.e., 5\%)
239
- \item \textbf{Base protocol fee:} $1/\phi_{\text{base}}$ of the pot to the base protocol (NANA) project (default: $\phi_{\text{base}} = 40$, i.e., 2.5\%)
240
- \item \textbf{Custom splits} ($\mathcal{S}$): Any additional game-creator-defined splits
241
- \item \textbf{Remainder:} Stays in the game's treasury as surplus for player cash-outs
242
- \end{enumerate}
243
-
244
- \textbf{Fee formulas.} Let $B_{\text{pot}}$ be the treasury balance at commitment fulfillment:
245
- \begin{align}
246
- F_{\text{defifa}} &= \frac{B_{\text{pot}}}{\phi_{\text{defifa}}} = \frac{B_{\text{pot}}}{20} = 0.05 \cdot B_{\text{pot}} \\[4pt]
247
- F_{\text{base}} &= \frac{B_{\text{pot}}}{\phi_{\text{base}}} = \frac{B_{\text{pot}}}{40} = 0.025 \cdot B_{\text{pot}} \\[4pt]
248
- F_{\text{custom}} &= \sum_{s \in \mathcal{S}} \frac{B_{\text{pot}} \cdot \text{percent}_s}{\text{SPLITS\_TOTAL\_PERCENT}}
249
- \end{align}
250
-
251
- The prize pool available for player claims is:
252
- \begin{equation}
253
- \boxed{B_{\text{prize}} = B_{\text{pot}} - F_{\text{defifa}} - F_{\text{base}} - F_{\text{custom}}}
254
- \end{equation}
255
-
256
- With default parameters ($\phi_{\text{defifa}} = 20$, $\phi_{\text{base}} = 40$, no custom splits), the total fee rate is \textbf{7.5\%}:
257
- \begin{equation}
258
- B_{\text{prize}} = B_{\text{pot}} \cdot \left(1 - \tfrac{1}{20} - \tfrac{1}{40}\right) = 0.925 \cdot B_{\text{pot}}
259
- \end{equation}
260
-
261
- \textbf{Resilient fee handling.} The \texttt{sendPayoutsOf} call is wrapped in a try-catch. If the payout fails for any reason, the \texttt{CommitmentPayoutFailed} event is emitted, the fulfilled commitments value is set to a sentinel~(1), and the final ruleset is still queued. Players can cash out immediately---the fee amount stays in the pot, slightly benefiting cash-out recipients. This ensures the game always reaches completion regardless of fee-collection failures.
262
-
263
- \textbf{Fee recycling.} The fees paid to the Defifa and base protocol projects are processed as standard Juicebox payments, which mint project tokens (\$DEFIFA, \$NANA) to the game's hook contract. These tokens are later distributed to players upon claim (Section~2.6).
264
-
265
- \textbf{World Cup example.} With a 147~ETH pot: Defifa fee: $147 / 20 = 7.35$~ETH (5\%). Base protocol fee: $147 / 40 = 3.675$~ETH (2.5\%). Total fees: 11.025~ETH (7.5\%). Prize pool: $147 - 11.025 = 135.975$~ETH (92.5\%).
266
-
267
- \subsection{Protocol Token Allocation}
268
-
269
- When fees are paid to the Defifa and base protocol projects, those projects mint their respective tokens to the game hook's address. The hook contract accumulates these tokens and distributes them proportionally when players burn their NFTs in the COMPLETE phase.
270
-
271
- \textbf{Token allocation per player.} For a player burning tokens with cumulative mint cost $c$:
272
- \begin{align}
273
- X_{\text{defifa}} &= \frac{c}{M} \cdot D_{\text{total}} \\[4pt]
274
- X_{\text{nana}} &= \frac{c}{M} \cdot P_{\text{total}}
275
- \end{align}
276
-
277
- where $M$ is the total mint cost of all tokens ever minted, $D_{\text{total}}$ is the total \$DEFIFA tokens held by the hook, and $P_{\text{total}}$ is the total \$NANA tokens held by the hook.
278
-
279
- \textbf{Key property.} Protocol token distribution is proportional to \emph{original mint cost}, not to scorecard weight. Since all tiers share the same price $p$, each NFT generates the same protocol-token claim regardless of tier. Even holders of losing tiers ($w_i = 0$) receive protocol tokens when burning---a consolation that rewards participation regardless of outcome.
280
-
281
- %==========================================================================
282
- \section{Attestation Governance and Scorecard Ratification}
283
- %==========================================================================
284
-
285
- \subsection{Voting Power Model}
286
-
287
- The attestation mechanism uses a \emph{per-tier proportional representation} model rather than a simple one-token-one-vote system.
288
-
289
- \textbf{Attestation units.} Each tier $i$ carries a maximum attestation power of:
290
- \begin{equation}
291
- V_{\max} = 10^9 \quad \text{(MAX\_ATTESTATION\_POWER\_TIER)}
292
- \end{equation}
293
-
294
- This maximum is shared among all holders of tier $i$. A holder's attestation weight for tier $i$ is:
295
- \begin{equation}
296
- \boxed{v_i^{\text{holder}} = V_{\max} \cdot \frac{n_i^{\text{holder}}}{n_i^{\text{total}}}}
297
- \end{equation}
298
-
299
- where $n_i^{\text{holder}}$ is the number of tier-$i$ tokens delegated to (or held by) the attestor, and $n_i^{\text{total}}$ is the total minted supply of tier $i$ at the attestation snapshot timestamp.
300
-
301
- \textbf{Total attestation weight.} A holder's total attestation power across all tiers is:
302
- \begin{equation}
303
- v^{\text{holder}} = \sum_{i \,:\, n_i^{\text{holder}} > 0} V_{\max} \cdot \frac{n_i^{\text{holder}}}{n_i^{\text{total}}}
304
- \end{equation}
305
-
306
- \textbf{Checkpoint-based snapshots.} Attestation power is measured at the scorecard's \texttt{attestationsBegin} timestamp---always a past timestamp set during \texttt{submitScorecardFor}. This prevents same-block transfer manipulation.
307
-
308
- \textbf{Delegation.} During the mint phase only, holders may delegate their attestation units to a chosen delegate address per tier. Delegation is per-tier, snapshot-locked, and mint-phase-only (the \texttt{\_update} function enforces \texttt{DELEGATE\_CHANGES\_UNAVAILABLE\_IN\_THIS\_PHASE} after MINT).
309
-
310
- \textbf{World Cup example.} Argentina (Tier~1) has 2,000 NFTs. A fan holding 100 Argentina NFTs has attestation power: $10^9 \times 100/2{,}000 = 50{,}000{,}000$ from Tier~1. Despite Argentina having the most mints, each \emph{tier} contributes equally to governance weight---Argentina's 2,000 holders collectively cap at $10^9$, the same as Saudi Arabia's 10 holders.
311
-
312
- \subsection{Quorum and Ratification Conditions}
313
-
314
- \textbf{Quorum calculation.} The quorum required for scorecard ratification is:
315
- \begin{equation}
316
- \boxed{Q = \frac{N_{\text{minted\_tiers}}}{2} \cdot V_{\max}}
317
- \end{equation}
318
-
319
- where $N_{\text{minted\_tiers}}$ is the number of tiers that have at least one minted token.
320
-
321
- \textbf{World Cup example.} All 32 tiers have minted tokens:
322
- $$Q = \frac{32}{2} \cdot 10^9 = 16 \times 10^9$$
323
-
324
- This requires the equivalent of 16 full tiers' worth of unanimous attestation. If the default delegate holds delegated power from a majority of minters across 16+ tiers, they can single-handedly meet quorum---which is exactly the intended fast path for games with trusted organizers.
325
-
326
- \textbf{Ratification conditions.} A scorecard can be ratified when all three conditions are met:
327
- \begin{enumerate}[nosep]
328
- \item The scorecard's grace period has expired ($\texttt{gracePeriodEnds} \leq \texttt{block.timestamp}$),
329
- \item The attestation count meets or exceeds quorum,
330
- \item No other scorecard has been ratified for this game.
331
- \end{enumerate}
332
-
333
- \subsection{Scorecard Lifecycle}
334
-
335
- Each submitted scorecard passes through five states:
336
-
337
- \begin{table}[H]
338
- \centering
339
- \begin{tabular}{ll}
340
- \toprule
341
- \textbf{State} & \textbf{Condition} \\
342
- \midrule
343
- PENDING & \texttt{attestationsBegin} $>$ \texttt{block.timestamp} \\
344
- ACTIVE & \texttt{attestationsBegin} $\leq$ \texttt{now} and (grace not expired or quorum not met) \\
345
- SUCCEEDED & Grace period expired AND attestations $\geq$ quorum \\
346
- DEFEATED & A different scorecard was ratified \\
347
- RATIFIED & This scorecard was ratified \\
348
- \bottomrule
349
- \end{tabular}
350
- \caption{Scorecard lifecycle states.}
351
- \end{table}
352
-
353
- Multiple scorecards may coexist in ACTIVE or SUCCEEDED state simultaneously, but only one can ever be ratified. Scorecards that fail to reach quorum remain ACTIVE indefinitely---the game's \texttt{scorecardTimeout} provides the ultimate backstop (see Section~9.1).
354
-
355
- The grace period is computed relative to \texttt{attestationsBegin}, not submission time: $t_{\text{grace\_end}} = t_{\text{attest\_begin}} + \tau_{\text{grace}}$. This prevents the grace period from expiring before attestations even start.
356
-
357
- \subsection{Resistance to Strategic Manipulation}
358
-
359
- The attestation model incorporates several defenses:
360
-
361
- \textbf{Defense 1: Per-tier cap.} No single tier's holders can contribute more than $V_{\max}$ attestation units, regardless of how many tokens they hold.
362
-
363
- \textbf{Defense 2: Checkpoint snapshots.} Attestation power is computed at a fixed historical timestamp (\texttt{attestationsBegin}). Acquiring tokens after the snapshot provides zero additional voting power.
364
-
365
- \textbf{Defense 3: Mint-phase-only delegation.} Delegation is locked after the mint phase, preventing last-minute delegation changes during the scoring phase.
366
-
367
- \textbf{Defense 4: 50\% quorum across tiers.} Requiring half of all minted tiers' worth of attestation power means no coalition controlling fewer than half the minted tiers can unilaterally ratify a fraudulent scorecard.
368
-
369
- \textbf{Defense 5: Scoring-phase-only submission.} Scorecard submission is restricted to the SCORING phase, preventing pre-accumulation of attestations during minting.
370
-
371
- \textbf{Remaining attack surface.} A coalition controlling sufficient attestation power across $\lceil N_{\text{minted}}/2 \rceil$ tiers can ratify an arbitrary scorecard. An attacker holding 100\% of a tier's supply---even just 1~token---receives the full $V_{\text{max}} = 10^9$ attestation power for that tier.
372
-
373
- \textbf{Worst-case attack cost (heavily minted tiers):}
374
- \begin{equation}
375
- C_{\text{attack}}^{\text{worst}} \geq \sum_{i \in \text{majority set}} \left\lceil \frac{n_i + 1}{2} \right\rceil \cdot p
376
- \end{equation}
377
-
378
- \textbf{Best-case attack cost (sparse tiers):}
379
- \begin{equation}\label{eq:cheapattack}
380
- C_{\text{attack}}^{\text{best}} = \lceil N/2 \rceil \cdot p
381
- \end{equation}
382
-
383
- This is potentially orders of magnitude cheaper. See Section~9.2 for a full analysis of governance attack economics and mitigations.
384
-
385
- %==========================================================================
386
- \section{Price Dynamics and Value Flows}
387
- %==========================================================================
388
-
389
- \subsection{NFT Intrinsic Value During Minting}
390
-
391
- \textbf{Expected value at mint.} Let $\pi_i$ be a player's subjective probability that tier $i$ wins. The expected post-fee payout for one tier-$i$ NFT in a winner-take-all game is:
392
- \begin{equation}
393
- \mathbb{E}[V_i] = \pi_i \cdot \frac{B_{\text{prize}}}{n_i} + X_i^{\text{protocol}}
394
- \end{equation}
395
-
396
- A rational risk-neutral player mints tier $i$ when $\mathbb{E}[V_i] > p$, which requires:
397
- \begin{equation}
398
- \pi_i > \frac{p - X_i^{\text{protocol}}}{B_{\text{prize}} / n_i}
399
- \end{equation}
400
-
401
- \textbf{World Cup example.} Argentina has 2,000 mints. If the scorecard assigns 40\% to the winner, an Argentina holder's expected value is $\pi_A \times 0.4 \times 135.975 / 2{,}000$. For this to exceed 0.01~ETH: $\pi_A > 36.8\%$. If you believe Argentina has a $>37\%$ chance of winning, minting is positive expected value.
402
-
403
- \subsection{Post-Scorecard Valuation}
404
-
405
- After the scorecard is ratified and fees are extracted, each NFT has a deterministic value:
406
- \begin{equation}
407
- V_i^{\text{token}} = \frac{w_i}{\hat{n}_i \cdot W_{\text{total}}} \cdot (B_{\text{prize}} + A_{\text{redeemed}}) + V_i^{\text{protocol}}
408
- \end{equation}
409
-
410
- \textbf{Winning tier:} $V_j^{\text{token}} = \frac{B_{\text{prize}} + A_{\text{redeemed}}}{\hat{n}_j} + V_j^{\text{protocol}}$
411
-
412
- \textbf{Losing tier ($w_i = 0$):} $V_i^{\text{token}} = V_i^{\text{protocol}}$ (protocol tokens only).
413
-
414
- \subsection{Secondary Market Implications}
415
-
416
- \textbf{Pre-ratification.} NFT value is driven by subjective outcome probabilities, analogous to prediction-market shares.
417
-
418
- \textbf{Post-ratification.} NFT value is deterministic and publicly computable. Any price deviation from redemption value creates an arbitrage, so secondary markets should converge immediately to redemption value.
419
-
420
- %==========================================================================
421
- \section{Rational Actor Analysis}
422
- %==========================================================================
423
-
424
- \subsection{Mint-Phase Strategy: Entry Timing}
425
-
426
- \textbf{Equilibrium.} In a Nash equilibrium of the minting game with risk-neutral players, denoting by $\pi_i$ the true probability of tier $i$ winning and by $f_i = n_i / N_{\text{total}}$ the fraction of NFTs allocated to tier $i$:
427
- \begin{equation}
428
- \mathbb{E}[\text{return}_i] = \frac{\pi_i}{f_i} \cdot (1 - \phi) - 1
429
- \end{equation}
430
-
431
- where $\phi = 1/\phi_{\text{defifa}} + 1/\phi_{\text{base}} + \phi_{\text{custom}}$ is the total fee rate (default: 7.5\%).
432
-
433
- In equilibrium, expected returns equalize across tiers: $f_i = \pi_i$.
434
-
435
- \textbf{Result.} In equilibrium, the fraction of NFTs in each tier equals the market's consensus probability of that tier winning. This is the classical parimutuel result.
436
-
437
- \textbf{World Cup example.} Argentina's 2,000 mints out of 15,000 total = 13.3\% share. In equilibrium, this implies a 13.3\% probability of winning---approximately matching real-world bookmaker odds.
438
-
439
- \subsection{Refund-Phase Strategy: Option Exercise}
440
-
441
- The refund phase creates a \emph{free put option} on each minted NFT, struck at the mint price $p$:
442
- \begin{equation}
443
- O_i = \max\bigl(p - V_i(t_{\text{refund\_end}}),\; 0\bigr)
444
- \end{equation}
445
-
446
- A rational player exercises (refunds) when new information shifts the expected outcome against their chosen tier.
447
-
448
- \subsection{Scoring-Phase Strategy: Attestation}
449
-
450
- \textbf{Equilibrium.} In the unique subgame-perfect equilibrium (assuming common knowledge of the event outcome):
451
- \begin{enumerate}[nosep]
452
- \item All holders attest to the \emph{truthful} scorecard---the one reflecting the actual event outcome.
453
- \item The truthful scorecard achieves quorum, as holders of winning tiers have the strongest incentive to attest.
454
- \end{enumerate}
455
-
456
- \subsection{Complete-Phase Strategy: Claim vs Hold}
457
-
458
- \textbf{Dominant strategy.} For risk-neutral players, burning immediately weakly dominates holding. The claim value does not depreciate (path-independence), but the time value of money favors immediate realization. Holding is justified only by expected protocol-token appreciation exceeding the discount rate:
459
- \begin{equation}
460
- \frac{dP_D}{dt} \cdot \frac{p}{M} \cdot D_{\text{total}} > r \cdot V_i^{\text{token}}
461
- \end{equation}
462
-
463
- %==========================================================================
464
- \section{Solvency and Conservation Laws}
465
- %==========================================================================
466
-
467
- \subsection{The Conservation Guarantee}
468
-
469
- \begin{theorem}[Prize Pool Conservation]
470
- For any scorecard $\mathbf{w}$ with $\sum_i w_i = W_{\text{total}}$ and any sequence of redemptions, the total amount paid out to all NFT holders equals $B_{\text{prize}}$.
471
- \end{theorem}
472
-
473
- \begin{proof}
474
- The total claim across all tokens is:
475
- $$\sum_{i=1}^{N} n_i^{\text{eligible}} \cdot \frac{w_i}{\hat{n}_i \cdot W_{\text{total}}} \cdot (B_{\text{prize}} + A_{\text{redeemed}})$$
476
-
477
- Since $n_i^{\text{eligible}} = \hat{n}_i$ at the start, and $(B_{\text{prize}} + A_{\text{redeemed}})$ is invariant, this equals:
478
- $$\sum_{i=1}^{N} \frac{w_i}{W_{\text{total}}} \cdot B_{\text{prize}} = \frac{B_{\text{prize}}}{W_{\text{total}}} \sum_{i=1}^{N} w_i = B_{\text{prize}}$$
479
- \end{proof}
480
-
481
- This guarantee is strengthened by the exact-sum validation on-chain:
482
- \texttt{validate\-And\-Build\-Weights} reverts if $\sum_i w_i \neq W_{\text{total}}$.
483
- Under-allocated scorecards are rejected.
484
-
485
- \subsection{Solvency Under Sequential Cash-Outs}
486
-
487
- \begin{corollary}[Order Independence]
488
- The payout to any individual NFT holder is independent of the order in which other holders redeem their tokens.
489
- \end{corollary}
490
-
491
- \begin{proof}
492
- The per-token claim formula (Eq.~\ref{eq:cashout}) uses $(B_{\text{prize}} + A_{\text{redeemed}})$ as the reference pot, which is constant. As each token is redeemed, both $n_i^{\text{burned}}$ and $d_i$ increment by~1, leaving $\hat{n}_i$ invariant.
493
- \end{proof}
494
-
495
- \subsection{Fee Impact on Total Claimable Value}
496
-
497
- The total value available to players (prize + protocol tokens) is:
498
- \begin{equation}
499
- V_{\text{total}} = B_{\text{prize}} + V_{\text{protocol}} = B_{\text{pot}} \cdot (1 - \phi) + V_{\text{protocol}}
500
- \end{equation}
501
-
502
- With default fees ($\phi = 7.5\%$):
503
- $$V_{\text{total}} = 0.925 \cdot B_{\text{pot}} + V_{\text{protocol}}$$
504
-
505
- Whether the net present value exceeds the mint cost depends on whether $V_{\text{protocol}} > 0.075 \cdot B_{\text{pot}}$---whether protocol token value compensates for the fee extraction.
506
-
507
- %==========================================================================
508
- \section{Game-Theoretic Properties}
509
- %==========================================================================
510
-
511
- \subsection{Defifa as a Parimutuel Mechanism}
512
-
513
- Defifa implements a \emph{generalized parimutuel mechanism} with several distinctive features:
514
-
515
- \begin{table}[H]
516
- \centering
517
- \begin{tabular}{lll}
518
- \toprule
519
- \textbf{Property} & \textbf{Traditional Parimutuel} & \textbf{Defifa} \\
520
- \midrule
521
- Outcome resolution & Centralized oracle & Decentralized attestation \\
522
- Payout computation & House-computed odds & On-chain formula \\
523
- Fee structure & Fixed takeout rate & Split-based, configurable \\
524
- Asset type & Fungible bet tickets & Non-fungible ERC-721 \\
525
- Secondary market & Typically none & Full ERC-721 transferability \\
526
- Refund option & Typically none & Configurable refund phase \\
527
- Token rewards & None & Protocol token distribution \\
528
- Safety fallback & None & NO\_CONTEST with full refunds \\
529
- \bottomrule
530
- \end{tabular}
531
- \caption{Comparison: Traditional parimutuel vs.\ Defifa.}
532
- \end{table}
533
-
534
- \textbf{Parimutuel equivalence.} Under uniform pricing (enforced by protocol---always true), binary scorecard, and no refund phase, Defifa is equivalent to a classical parimutuel pool with odds:
535
- \begin{equation}
536
- \text{odds}_i = \frac{B_{\text{prize}}}{n_i \cdot p} = \frac{(1 - \phi) \cdot N_{\text{total}}}{n_i}
537
- \end{equation}
538
-
539
- \textbf{World Cup example (winner-take-all).} Argentina ($n_1 = 2{,}000$) out of 15,000 total mints: $\text{odds}_{\text{Argentina}} = \frac{0.925 \times 15{,}000}{2{,}000} = 6.94\times$. A 0.01~ETH bet pays 0.069~ETH---precisely classical parimutuel odds with a 7.5\% takeout rate.
540
-
541
- \subsection{Information Aggregation}
542
-
543
- The minting and refund dynamics create a multi-round price-discovery mechanism:
544
-
545
- \textbf{Round~1 (Mint phase).} Players reveal information through tier selection. Under equilibrium, the mint distribution converges to the collective probability distribution.
546
-
547
- \textbf{Round~2 (Refund phase).} Players who received new information can exit, revealing belief updates.
548
-
549
- \textbf{Round~3 (Secondary market).} If NFTs trade on secondary markets during the scoring phase, prices reflect the most current probability assessments.
550
-
551
- \subsection{Multi-Game Dynamics and Protocol Flywheel}
552
-
553
- Defifa generates a \emph{protocol-level flywheel} through its fee-token mechanism. Let $G$ be the number of active games, $\bar{B}$ the average pot size, and $\phi$ the fee rate (default: 7.5\%). The aggregate fee revenue is:
554
- \begin{equation}
555
- R = G \cdot \bar{B} \cdot \phi
556
- \end{equation}
557
-
558
- The fraction of the pot recovered through protocol tokens is:
559
- \begin{equation}
560
- \frac{V_{\text{protocol}}^{\text{game}}}{\bar{B}} = \phi^2 \cdot \mu \cdot G
561
- \end{equation}
562
-
563
- where $\mu$ is the revenue multiple of protocol token valuation. For $\phi = 0.075$, $\mu = 10$, and $G = 100$: recovery rate $= 0.005625 \times 10 \times 100 = 5.625\times$. While extreme, this demonstrates the positive network effect: more games create more protocol token value.
564
-
565
- %==========================================================================
566
- \section{Parameter Design Space}
567
- %==========================================================================
568
-
569
- \subsection{Tier Count and Price Calibration}
570
-
571
- \textbf{Tier count} (maximum: 128). More tiers increase governance robustness but potentially slow ratification. Optimal: $4 \leq N \leq 32$. A 32-team World Cup game is the sweet spot.
572
-
573
- \textbf{Price calibration.} Since all tiers share a uniform price $p$ (enforced by the protocol), the price affects accessibility, pot size per capita, and attack economics. Recommended: 0.01--0.1~ETH per NFT.
574
-
575
- \subsection{Timing Parameters}
576
-
577
- \textbf{Mint duration}: $t_{\text{mint}} \approx \min(\text{time until event}, 30\text{ days})$. \textbf{Refund duration}: 1--7 days. \textbf{Attestation grace period}: 3--7 days (minimum: 1 day, enforced by protocol). \textbf{Scorecard timeout}: 90--180 days for permissionless games, 30 days for trusted-organizer games.
578
-
579
- \subsection{Fee Calibration and Protocol Sustainability}
580
-
581
- The default fee structure is competitive with existing markets:
582
-
583
- \begin{table}[H]
584
- \centering
585
- \begin{tabular}{ll}
586
- \toprule
587
- \textbf{Platform} & \textbf{Takeout Rate} \\
588
- \midrule
589
- Horse racing (parimutuel) & 15--25\% \\
590
- Sports betting (vig) & 4--10\% \\
591
- Prediction markets (fees) & 1--5\% \\
592
- \textbf{Defifa (default)} & \textbf{7.5\%} \\
593
- \bottomrule
594
- \end{tabular}
595
- \caption{Fee comparison across prediction platforms.}
596
- \end{table}
597
-
598
- The effective fee rate, accounting for protocol token rebates, is:
599
- \begin{equation}
600
- \phi_{\text{eff}} = \phi \cdot (1 - \alpha)
601
- \end{equation}
602
-
603
- where $\alpha$ is the fraction of fee value retained in protocol tokens. For $\alpha = 0.5$: $\phi_{\text{eff}} = 0.075 \times 0.5 = 3.75\%$, highly competitive with low-fee prediction markets.
604
-
605
- %==========================================================================
606
- \section{Safety Mechanisms}
607
- %==========================================================================
608
-
609
- Defifa includes a comprehensive safety system---the \textbf{NO\_CONTEST} mechanism---that prevents funds from being permanently locked when governance fails or the game is non-viable. NO\_CONTEST is a first-class game phase (defined in the \texttt{DefifaGamePhase} enum) with three complementary triggers.
610
-
611
- \subsection{The No-Contest System}
612
-
613
- \subsubsection{Trigger~1: Minimum Participation Threshold}
614
-
615
- At game creation, the organizer sets \texttt{minParticipation}---a minimum treasury balance required for the game to proceed to scoring. The \texttt{currentGamePhaseOf()} function checks the balance against this threshold before returning SCORING. If below, it returns NO\_CONTEST.
616
-
617
- \emph{What it solves:} Ghost games with negligible participation skip directly to refundability. \emph{Attack surface:} A majority holder can refund enough tokens to push the balance below threshold. \emph{Mitigation:} Set the threshold conservatively low (${\sim}10\%$ of expected pot). Set to~0 to disable.
618
-
619
- \subsubsection{Trigger~2: Scorecard Ratification Timeout}
620
-
621
- At game creation, the organizer sets \texttt{scorecardTimeout}---a duration after SCORING begins. If no scorecard is ratified within this window, \texttt{currentGamePhaseOf()} returns NO\_CONTEST.
622
-
623
- \emph{What it solves:} All governance deadlock scenarios---no scorecard submitted, quorum unreachable, dead delegate, dead attestation holders. This is the only mechanism providing a hard, trustless, time-bounded guarantee that funds cannot be locked permanently. Set to~0 to disable.
624
-
625
- \subsubsection{Trigger~3: Explicit Activation}
626
-
627
- Once \texttt{currentGamePhaseOf()} returns NO\_CONTEST (from either trigger), anyone calls \texttt{triggerNoContestFor(gameId)}. This:
628
- \begin{enumerate}[nosep]
629
- \item Sets \texttt{noContestTriggeredFor[gameId] = true} (permanent flag)
630
- \item Queues a new ruleset with no payout limits, making surplus equal to balance
631
- \item Enables full-refund cash-outs at mint price
632
- \end{enumerate}
633
-
634
- During NO\_CONTEST, the \texttt{computeCashOutCount} function returns the cumulative mint price---identical to MINT/REFUND phase behavior, implementing a complete refund.
635
-
636
- \subsubsection{Priority Rules}
637
-
638
- COMPLETE takes priority over NO\_CONTEST---a ratified scorecard is final. Once \texttt{noContestTriggeredFor} is set, the game stays in NO\_CONTEST permanently.
639
-
640
- \subsubsection{Defense in Depth}
641
-
642
- The \texttt{defaultAttestationDelegate} provides a social fast-path for routine governance. Combined with the automated NO\_CONTEST triggers, this creates layered safety: delegate (fast-path social resolution) + timeout (hard backstop) + threshold (early exit for ghost games).
643
-
644
- \subsection{Governance Attack Economics}
645
-
646
- \textbf{All governance systems are manipulatable with sufficient capital.} The relevant question is not \emph{whether} an attack is possible, but whether the \textbf{mechanism structurally prevents profit} regardless of how much the attacker spends. Making attacks ``more expensive'' is insufficient---a sufficiently capitalized adversary will pay any price. The defense must be structural, not economic.
647
-
648
- \subsubsection{The Scaling Problem (Current Design)}
649
-
650
- The per-tier attestation power cap assigns equal $V_{\text{max}} = 10^9$ to every tier regardless of supply. An adversary buys 1~token in each of $\lceil N/2 \rceil$ sparse tiers at cost $C_{\text{attack}} = \lceil N/2 \rceil \cdot p$, while the pot scales as $B_{\text{pot}} = \sum_i n_i \cdot p$:
651
- \begin{equation}
652
- \text{ROI} \approx \frac{2 \cdot N_{\text{total}}}{N}
653
- \end{equation}
654
-
655
- Attack cost is $O(N)$ while the pot is $O(N_{\text{total}})$, so ROI grows linearly with participation. For our 32-team World Cup at 0.01~ETH: 0.16~ETH to capture a 138.75~ETH pot---an $867\times$ return. No amount of threshold-tuning fixes this: any defense based on ``make it cost more'' fails against unlimited capital.
656
-
657
- \subsubsection{Benefit-Weighted Attestation: The Structural Fix}
658
-
659
- The insight: \textbf{the beneficiaries of a scorecard should not be the ones who ratify it.} The more a tier receives from a scorecard, the less that tier's attestation power counts toward ratifying it.
660
-
661
- For a scorecard $S$ with weights $\{w_1, \ldots, w_N\}$, tier $i$'s effective attestation power:
662
- \begin{equation}\label{eq:bwa}
663
- \boxed{V_i^{\text{eff}}(S) = V_{\text{max}} \cdot \left(1 - \frac{w_i}{W_{\text{total}}}\right)}
664
- \end{equation}
665
-
666
- This is the \textbf{perfect proportion}: a pure linear reduction where benefit and governance power are complementary. The function has a critical mathematical invariant---total available attestation power is \emph{constant} for every valid scorecard:
667
- \begin{equation}
668
- \sum_{i=1}^{N} V_i^{\text{eff}}(S)
669
- = V_{\text{max}} \cdot \sum_{i=1}^{N}\!\left(1 - \frac{w_i}{W_{\text{total}}}\right)
670
- = V_{\text{max}} \cdot (N - 1)
671
- \end{equation}
672
-
673
- since $\sum w_i = W_{\text{total}}$. The mechanism does not favor concentrated scorecards over distributed ones in terms of \emph{how much} power exists---it only changes \emph{who} holds it.
674
-
675
- \textbf{Why linear is optimal.} Stronger-than-linear functions (e.g., quadratic $(1-x)^2$) reduce total available power for distributed scorecards relative to concentrated ones---the opposite of what is desired. Weaker-than-linear functions leave too much power with beneficiaries. The linear form uniquely preserves the $(N-1) \cdot V_{\text{max}}$ invariant while providing maximal separation between beneficiary and non-beneficiary power.
676
-
677
- \subsubsection{Why This Kills the Attack}
678
-
679
- \textbf{Fraudulent scorecard} (100\% to attacker's monopoly tier):
680
-
681
- \begin{table}[H]
682
- \centering
683
- \begin{tabular}{lll}
684
- \toprule
685
- \textbf{Tier} & \textbf{Weight} & \textbf{Effective power} \\
686
- \midrule
687
- Attacker's tier & 100\% & $V_{\text{max}} \times 0 = 0$ \\
688
- Each of 31 others & 0\% & $V_{\text{max}} \times 1.0$ \\
689
- \bottomrule
690
- \end{tabular}
691
- \end{table}
692
-
693
- The attacker has \textbf{zero} attestation power for their own scorecard. No amount of capital changes this. The fraudulent scorecard accumulates 0 attestation and dies.
694
-
695
- \textbf{Truthful scorecard} (Argentina wins 40\%):
696
-
697
- \begin{table}[H]
698
- \centering
699
- \begin{tabular}{lll}
700
- \toprule
701
- \textbf{Tier} & \textbf{Weight} & \textbf{Effective power} \\
702
- \midrule
703
- Argentina & 40\% & $0.6 \times V_{\text{max}}$ \\
704
- Runner-up & 20\% & $0.8 \times V_{\text{max}}$ \\
705
- Semi-finalists ($\times 2$) & 10\% each & $0.9 \times V_{\text{max}}$ each \\
706
- Other 28 tiers & $\approx$0\% & $\approx V_{\text{max}}$ each \\
707
- \midrule
708
- \textbf{Total available} & & $31 \times V_{\text{max}}$ \\
709
- \textbf{Quorum} & & $16 \times V_{\text{max}}$ \\
710
- \bottomrule
711
- \end{tabular}
712
- \end{table}
713
-
714
- The truthful scorecard has nearly $2\times$ the attestation power needed. The delegate marshals power from non-winning tiers (full strength), and even the winning tiers retain 60--90\% power.
715
-
716
- \subsubsection{Scaling Against Unlimited Capital}
717
-
718
- The attacker's fallback: buy into \emph{non-winning} tiers to accumulate attestation power for a fraudulent scorecard. But those purchases go \emph{into the pot}---the attacker enriches the treasury they are trying to steal.
719
-
720
- \textbf{Attacker buys 1 token in 16 sparse tiers (0.16~ETH):} winning tier contributes 0 power; 15 other sparse tiers contribute $15 \times V_{\text{max}}$; honest tiers $\approx 0.03 \times V_{\text{max}}$. Total $\approx 15.03 \times V_{\text{max}} < 16 \times V_{\text{max}} =$ quorum. \textbf{Fails}---one tier short because the winning tier is dead weight.
721
-
722
- \textbf{Attacker buys massively into honest tiers (80~ETH):} gains 50\% share in 16 honest tiers, adding $8 \times V_{\text{max}}$. Total $\approx 23 \times V_{\text{max}} >$ quorum. \textbf{Passes}---but invested 80~ETH to attack an 80~ETH pot. Net extraction = honest holders' original contribution. Attack cost now \textbf{scales linearly with the pot}---not because we made it expensive, but because the structure demands it.
723
-
724
- \subsubsection{Dead Token Economics: The Attack Tax}
725
-
726
- The key insight making governance manipulation structurally unprofitable: \textbf{tokens purchased for governance power in non-winning tiers are dead money under a fraudulent scorecard.}
727
-
728
- Under BWA, an attacker needs tokens in non-winning tiers (full governance power) to ratify a scorecard that benefits their winning tiers (zero power). But under the fraudulent scorecard, those non-winning tiers receive 0\% of the pot. The attacker's non-winning tokens are a sunk cost---capital destroyed in the act of governance manipulation.
729
-
730
- Combined with the 7.5\% fee extraction (5\% Defifa + 2.5\% base protocol), this creates a formal profitability condition.
731
-
732
- \begin{theorem}[Attack Profitability Threshold]\label{thm:profitability}
733
- In a Defifa game with $N$ tiers, fee rate $\phi = 7.5\%$, and BWA, an attacker controlling fraction $\alpha_w$ of winning-tier tokens and fraction $\alpha_v$ of non-winning (voting) tier tokens profits if and only if:
734
- \begin{equation}
735
- \alpha_w > \alpha_v \cdot \frac{N-1}{(1-\phi)N - 1}
736
- \end{equation}
737
- \end{theorem}
738
-
739
- For the default fee rate ($\phi = 0.075$):
740
-
741
- \begin{table}[H]
742
- \centering
743
- \begin{tabular}{lll}
744
- \toprule
745
- $N$ (tiers) & Threshold $\alpha_w / \alpha_v$ & Interpretation \\
746
- \midrule
747
- 2 & 1.176 & Must own 17.6\% more of winning tiers \\
748
- 4 & 1.111 & Must own 11.1\% more \\
749
- 8 & 1.094 & Must own 9.4\% more \\
750
- 32 & 1.084 & Must own 8.4\% more \\
751
- 128 & 1.082 & Converges to $1/(1-\phi) \approx 1.081$ \\
752
- \bottomrule
753
- \end{tabular}
754
- \caption{Profitability threshold by tier count.}
755
- \end{table}
756
-
757
- \begin{corollary}[Uniform Buyer Loss]
758
- An attacker who buys uniformly across all tiers ($\alpha_w = \alpha_v$) always loses money---their return is $(1-\phi) \cdot \alpha \cdot \text{pot}$ while their cost is $\alpha \cdot \text{pot}$, yielding a guaranteed $-7.5\%$ loss regardless of the scorecard, tier count, or pot size.
759
- \end{corollary}
760
-
761
- \begin{corollary}[Dead Token Tax]
762
- In a game with $N$ tiers where the attacker claims weight for 1 tier, $(N-1)/N$ of the attacker's governance tokens are dead---they cost money to buy but return nothing. For the World Cup ($N = 32$), 96.9\% of the attacker's governance investment is dead money.
763
- \end{corollary}
764
-
765
- \subsubsection{The Complete Defense Stack}
766
-
767
- \begin{table}[H]
768
- \centering
769
- \begin{tabular}{lll}
770
- \toprule
771
- \textbf{Layer} & \textbf{Mechanism} & \textbf{Defends against} \\
772
- \midrule
773
- Structural & Benefit-weighted attestation & Self-interested manipulation \\
774
- Economic & Dead token tax + fee extraction & Profitability of residual attacks \\
775
- Temporal & Post-ratification timelock (\S9.4) & Fraud slipping through BWA \\
776
- Adaptive & Graduated quorum (\S9.4) & Concentrated fraudulent scorecards \\
777
- Corrective & Attestation withdrawal (\S9.4) & Social engineering / phishing \\
778
- Social & Trusted delegate & Coordination failure \\
779
- Parametric & \texttt{minParticipation} + \texttt{scorecardTimeout} & Ghost games, deadlock \\
780
- Design & Uniform participation (\S9.3) & 51\% ownership concentration \\
781
- \bottomrule
782
- \end{tabular}
783
- \caption{Layered governance defense stack.}
784
- \end{table}
785
-
786
- \textbf{The irreducible limit.} Like all proof-of-stake systems, Defifa has a 51\% security threshold: an attacker who controls $>$50\% of every tier's tokens can ratify any scorecard. This is the fundamental limit of all token-weighted governance and cannot be eliminated by mechanism design alone. The defense is \emph{game design}---structuring games so that organic participation makes 51\% ownership prohibitively expensive.
787
-
788
- \textbf{The bottom line.} Benefit-weighted attestation transforms Defifa governance from an economic arms race into a structural equilibrium. The ``perfect proportion''---$\text{power} = 1 - \text{benefit}$---is the unique linear function that preserves constant total attestation across all valid scorecards while maximally separating beneficiary power from non-beneficiary power. Combined with dead token economics and fee extraction, self-serving governance is not just structurally difficult---it is provably unprofitable under the conditions identified in Section~9.3.
789
-
790
- \subsection{Resilient Game Design}\label{sec:game-design}
791
-
792
- The profitability threshold from Section~9.2 implies specific design principles that make Defifa games structurally resistant to governance attacks. This section derives the conditions under which attack profitability goes to zero and identifies the proven ideal game design.
793
-
794
- \subsubsection{The Uniform Participation Theorem}
795
-
796
- \begin{theorem}[Uniform Participation]\label{thm:uniform}
797
- In a Defifa game with BWA, if all $N$ tiers have equal supply ($n_i = n$ for all $i$), then no attacker controlling any fraction $\alpha$ of the total supply can profit from governance manipulation.
798
- \end{theorem}
799
-
800
- \begin{proof}
801
- Under uniform supply, any buyer's ownership fraction is identical across all tiers: $\alpha_w = \alpha_v = \alpha$. The profitability condition (Theorem~\ref{thm:profitability}) requires $\alpha_w > \alpha_v \cdot (N-1)/((1-\phi)N - 1)$, which reduces to $1 > (N-1)/((1-\phi)N - 1)$. Since $(1-\phi)N - 1 < N - 1$ for any $\phi > 0$, the right side exceeds 1---the condition can never be satisfied. The attacker always loses exactly the fee fraction $\phi$.
802
- \end{proof}
803
-
804
- This theorem establishes that \textbf{participation uniformity is the fundamental design variable} for game security. The closer a game's tier supplies are to uniform, the harder it is for any attacker to achieve the $\alpha_w > 1.08 \times \alpha_v$ threshold needed for profit.
805
-
806
- \subsubsection{Design Principles}
807
-
808
- \textbf{Principle 1: Choose events with balanced interest.} The single most important design decision is selecting an event where participants naturally spread their mints across tiers. Events with clear favorites and longshots concentrate supply, creating the imbalance attackers exploit.
809
-
810
- \begin{itemize}[nosep]
811
- \item \textbf{Ideal}: Tournament stages (World Cup groups, March Madness brackets) where multiple teams have genuine fanbases
812
- \item \textbf{Good}: Multi-candidate elections, multi-outcome market predictions
813
- \item \textbf{Risky}: ``Favorite vs.\ field'' structures where one tier attracts 90\%+ of supply
814
- \end{itemize}
815
-
816
- \textbf{Principle 2: More tiers, but only if they attract participation.} Additional tiers dilute the attacker's governance power across more dead tokens. However, adding tiers that attract zero organic participation creates cheap governance power for attackers. The optimal tier count $N^*$ maximizes tiers with meaningful supply:
817
- \[
818
- N^* = \max \{ N : \forall i, \; n_i \geq n_{\min} \}
819
- \]
820
- where $n_{\min}$ is the supply level below which a tier becomes a governance attack vector.
821
-
822
- \textbf{Principle 3: Reserve tokens as supply smoothing.} Configuring a reserved rate $\rho_i$ on every tier ensures that even tiers with low organic demand have tokens held by the delegate. These reserve tokens count toward supply (diluting attacker ownership), are held by the delegate (used to attest truthfully), and push $\alpha_w$ and $\alpha_v$ closer together. A reserved rate of $\rho = 1$ effectively halves the attacker's ownership fraction in any tier they haven't bought into.
823
-
824
- \textbf{Principle 4: Meaningful minimum participation.} Setting \texttt{minParticipation} ensures the pot is large enough that the attacker's token purchases represent a small fraction of total supply.
825
-
826
- \textbf{Principle 5: Scorecard timeout as hard backstop.} Always set \texttt{scorecardTimeout} for permissionless games to ensure fund recovery if governance fails.
827
-
828
- \subsubsection{Anti-Patterns}
829
-
830
- \textbf{Anti-pattern 1: Extreme favorites.} A game where Tier~1 attracts 10,000 mints and Tiers 2--32 attract 10 each. The attacker buys 11 tokens in each of 16 sparse tiers (cost: 1.76~ETH), gaining majority control at full governance power, while the pot holds 103.1~ETH.
831
-
832
- \textbf{Anti-pattern 2: Excess empty tiers.} Adding 128 tiers when only 8 attract organic interest. The remaining 120 tiers are free governance power---1 token each at minimum cost.
833
-
834
- \textbf{Anti-pattern 3: No safety parameters.} Running a permissionless game with \texttt{scorecardTimeout = 0} and \texttt{minParticipation = 0}. If governance fails, funds are permanently locked.
835
-
836
- \subsubsection{The World Cup as Near-Ideal Design}
837
-
838
- The 32-team FIFA World Cup game exemplifies resilient design:
839
-
840
- \begin{enumerate}[nosep]
841
- \item \textbf{Balanced interest}: All 32 teams have genuine fanbases, ensuring organic minting across all tiers. Even ``longshot'' teams attract nationalist buying.
842
- \item \textbf{High tier count}: $N = 32$ means the profitability threshold requires 8.4\% ownership advantage---and 96.9\% of governance tokens are dead money.
843
- \item \textbf{Natural uniformity}: Group-stage structure ensures competitive teams in each group, providing diverse entry points.
844
- \item \textbf{Cultural event alignment}: The World Cup attracts large, globally distributed participation---making any attacker's fraction small.
845
- \item \textbf{Clear resolution}: Tournament brackets provide unambiguous outcomes, reducing scorecard disputes to mechanical verification.
846
- \end{enumerate}
847
-
848
- \textbf{Is there a proven ideal game design?} Yes, with qualification. The Uniform Participation Theorem proves that a game with perfectly uniform tier supply is impervious to profitable governance attacks regardless of attacker capital. The ``ideal'' is therefore any event structure that naturally produces uniform minting---and the World Cup is the canonical real-world example. The qualification: no mechanism can prevent a 51\% attacker, just as no proof-of-stake protocol can. The defense is making 51\% ownership prohibitively expensive through high, uniform participation.
849
-
850
- \subsection{Governance Hardening}\label{sec:hardening}
851
-
852
- The defense stack in Section~9.2---BWA, dead token economics, and resilient game design---provides strong structural guarantees. This section describes four implemented mechanisms that provide defense-in-depth against residual attack vectors. These are additive: each one independently strengthens the system, and they compose without interference.
853
-
854
- \subsubsection{Post-Ratification Timelock}
855
-
856
- \textbf{Problem.} Without a timelock, \texttt{ratifyScorecardFrom} executes the scorecard instantly---the moment quorum is met and the grace period expires. There is zero time for the community to react to fraud that slips through BWA.
857
-
858
- \textbf{Mechanism.} A mandatory delay $\tau_{\text{lock}}$ exists between a scorecard reaching quorum (after grace period) and its execution. During this window:
859
- \begin{enumerate}[nosep]
860
- \item The scorecard enters the \textsc{queued} state---visible but not yet executable.
861
- \item Multiple scorecards can reach \textsc{queued} or \textsc{succeeded} simultaneously. The first to be ratified wins; others become \textsc{defeated}.
862
- \item After $\tau_{\text{lock}}$ expires, the scorecard transitions to \textsc{succeeded} and can be ratified.
863
- \end{enumerate}
864
-
865
- Multiple scorecards can coexist in \textsc{queued}/\textsc{succeeded} simultaneously. The first \texttt{ratifyScorecardFrom} call wins. Under BWA + graduated quorum, marshaling enough attestation power for a fraudulent competing scorecard is extremely expensive.
866
-
867
- \textbf{Recommended:} $\tau_{\text{lock}} = 3$--$7$ days. Same pattern as Compound Governor, OpenZeppelin TimelockController, and Gnosis Safe.
868
-
869
- \textbf{Implementation.} A \textsc{queued} state exists between \textsc{active} and \textsc{succeeded}. \texttt{ratifyScorecardFrom} only executes when the state is \textsc{succeeded} (timelock expired). The \texttt{timelockDuration} is configurable per game (set to 0 to disable).
870
-
871
- \subsubsection{Graduated Quorum by Scorecard Concentration}
872
-
873
- \textbf{Problem.} Base quorum is flat: $Q_{\text{base}} = N_{\text{eligible}} \times V_{\text{max}} / 2$ regardless of the scorecard's weight distribution. A ``steal everything'' scorecard faces the same quorum as a distributed one.
874
-
875
- \textbf{Mechanism.} Apply a concentration penalty based on the largest tier weight's squared share, scaled by the \emph{headroom}---the gap between maximum achievable BWA attestation and the base quorum:
876
- \begin{equation}
877
- \text{headroom} = Q_{\text{base}} - V_{\text{max}} - N = \frac{(N-2) \times V_{\text{max}}}{2} - N
878
- \end{equation}
879
- \begin{equation}
880
- Q(S) = Q_{\text{base}} + \text{headroom} \times \left(\frac{\max_i(w_i)}{W_{\text{total}}}\right)^2
881
- \end{equation}
882
-
883
- The $-N$ term accounts for per-tier integer rounding loss in the BWA computation (\texttt{mulDiv} truncation).
884
-
885
- \textbf{Properties:}
886
- \begin{itemize}[nosep]
887
- \item \textbf{Self-capping.} The penalty can never exceed headroom, so the adjusted quorum is always reachable by non-beneficiary attestors.
888
- \item \textbf{Nonlinear.} $\text{maxShare}^2$ is quadratic: gentle for moderate concentration (25\% max $\to$ 6.25\% of headroom), steep for extreme (100\% max $\to$ 100\% of headroom).
889
- \item \textbf{No magic constants.} The formula derives entirely from game parameters.
890
- \end{itemize}
891
-
892
- \begin{table}[H]
893
- \centering
894
- \begin{tabular}{lll}
895
- \toprule
896
- \textbf{Distribution} & \textbf{maxShare} & \textbf{Penalty (fraction of headroom)} \\
897
- \midrule
898
- Equal across 32 tiers & 3.1\% & 0.1\% (essentially unchanged) \\
899
- World Cup (40/20/10/10/\ldots) & 40\% & 16\% \\
900
- Winner-take-all (100/0/\ldots) & 100\% & 100\% (quorum = max achievable BWA) \\
901
- \bottomrule
902
- \end{tabular}
903
- \caption{Graduated quorum impact by scorecard concentration.}
904
- \end{table}
905
-
906
- Distributed scorecards are barely affected. Concentrated fraudulent scorecards face quadratically increasing quorum, up to the theoretical BWA maximum for winner-take-all.
907
-
908
- \subsubsection{Attestation Withdrawal}
909
-
910
- \textbf{Problem.} Without withdrawal, attestation would be irreversible. Holders tricked into attesting to a fraudulent scorecard (phishing, social engineering) cannot correct their mistake.
911
-
912
- \textbf{Mechanism.} Holders can revoke attestation during the \textsc{active} phase:
913
- \begin{enumerate}[nosep]
914
- \item Each attestor's BWA weight is stored: \texttt{attestedWeightOf[msg.sender]}.
915
- \item \texttt{revokeAttestationFrom(gameId, scorecardId)} subtracts the stored weight from the scorecard's count.
916
- \item Revocation is only available while the scorecard state is \textsc{active}. Once \textsc{queued} (grace period ended + quorum met), revocations are disabled to prevent attest/revoke griefing.
917
- \end{enumerate}
918
-
919
- During \textsc{active}, the grace period is still running, giving honest holders time to correct mistakes. Combined with the timelock, the overall correction window spans the grace period plus timelock duration.
920
-
921
- \subsubsection{Scorecard-Aware Attestation Power (BWA Implementation)}
922
-
923
- \textbf{Problem.} The raw \texttt{getAttestationWeight} computes attestation power without regard to which scorecard is being attested to. For BWA to function, attestation power must be \emph{scorecard-dependent}: each tier's contribution reduced by $(1 - w_i / W_{\text{total}})$.
924
-
925
- \textbf{Mechanism.} Modify the attestation flow to be scorecard-aware:
926
- \begin{enumerate}[nosep]
927
- \item When \texttt{attestToScorecardFrom} is called, retrieve the scorecard's tier weights.
928
- \item For each tier where the attestor has power, compute the BWA-reduced weight:
929
- \[
930
- \text{power}_i^{\text{eff}} = \text{power}_i^{\text{raw}} \times \left(1 - \frac{w_i}{W_{\text{total}}}\right)
931
- \]
932
- \item Sum the effective power across all tiers and record this as the attestation count.
933
- \end{enumerate}
934
-
935
- \textbf{Storage approach.} The tier weights must be accessible during attestation. Storing weights in the scorecard struct is recommended: written once at submission ($O(N)$ storage, $\sim$400k gas for 128 tiers), read many times during attestation (zero additional calldata per attestation).
936
-
937
- \textbf{Quorum adjustment.} Under BWA, maximum possible attestation for any scorecard is $(N-1) \times V_{\text{max}}$ (the constant-total invariant). Base quorum is $N_{\text{eligible}} \times V_{\text{max}} / 2$, representing 50\% of raw power. The graduated quorum mechanism (Section 9.4.2) further adjusts this per-scorecard based on concentration, storing the result in \texttt{quorumSnapshot}.
938
-
939
- \subsection{Governance Deadlock Analysis}
940
-
941
- The following table summarizes all governance deadlock scenarios and their resolution:
942
-
943
- \begin{table}[H]
944
- \centering
945
- \begin{tabular}{ll}
946
- \toprule
947
- \textbf{Scenario} & \textbf{Resolution} \\
948
- \midrule
949
- No scorecard submitted & \texttt{scorecardTimeout} $\to$ NO\_CONTEST \\
950
- Quorum unreachable & \texttt{scorecardTimeout} $\to$ NO\_CONTEST \\
951
- Dead delegate & \texttt{scorecardTimeout} $\to$ NO\_CONTEST \\
952
- Dead attestation holders & \texttt{scorecardTimeout} $\to$ NO\_CONTEST \\
953
- Split target reverts & try-catch $\to$ fee stays in pot $\to$ game continues \\
954
- All minters refund & Treasury = 0, nothing to recover \\
955
- Insufficient participation & \texttt{minParticipation} $\to$ NO\_CONTEST \\
956
- \bottomrule
957
- \end{tabular}
958
- \caption{Governance deadlock scenarios and resolutions.}
959
- \end{table}
960
-
961
- Every deadlock scenario is resolved by either \texttt{scorecardTimeout} or \texttt{minParticipation}, provided these optional parameters are set. A game with both set to~0 relies on the delegate and community coordination.
962
-
963
- %==========================================================================
964
- \section{Conclusions and Practical Implications}
965
- %==========================================================================
966
-
967
- This paper has formalized the cryptoeconomic mechanisms of Defifa: a prediction-game protocol that transforms NFT minting into a parimutuel wagering mechanism with governance-ratified outcomes.
968
-
969
- \textbf{Prize Distribution Mechanics.} Defifa implements a path-independent, weight-proportional prize distribution through Equation~\ref{eq:cashout}. Using $(B_{\text{prize}} + A_{\text{redeemed}})$ as the reference pot ensures every token holder receives the same payout regardless of redemption order. Theorem~6.1 proves total payouts exactly exhaust the prize pool. The on-chain exact-sum validation ($\sum w_i = W_{\text{total}}$) provides a hard guarantee that no prize pool value is trapped.
970
-
971
- \textbf{Governance Security.} The attestation model achieves a balance between decentralization and efficiency. Section~9.2 introduces \textbf{benefit-weighted attestation} (BWA): the ``perfect proportion'' where a tier's governance power for a given scorecard equals $V_{\text{max}} \times (1 - w_i / W_{\text{total}})$. This structural mechanism makes self-serving scorecards unratifiable regardless of attacker capital. The dead token economics prove that even attacks overcoming BWA are unprofitable: tokens purchased for governance power in non-winning tiers return \$0 under the fraudulent scorecard, creating a guaranteed loss when combined with fee extraction. Section~9.3 formalizes the Uniform Participation Theorem, proving that games with equal tier supply are impervious to profitable governance attacks.
972
-
973
- \textbf{Safety Mechanisms.} The NO\_CONTEST system (Section~9.1) provides comprehensive fund-recovery guarantees through minimum participation thresholds, scorecard timeouts, and the default attestation delegate---layered safety where each mechanism covers the failure modes of the others.
974
-
975
- \textbf{Market Efficiency.} The equilibrium analysis demonstrates convergence to the classical parimutuel result: mint fractions equal consensus probabilities. The uniform pricing enforced by the protocol ensures clean dynamics. The three-round information structure (mint $\to$ refund $\to$ secondary) provides richer information aggregation than single-shot mechanisms.
976
-
977
- \textbf{Protocol Sustainability.} The 7.5\% default fee rate (5\% Defifa + 2.5\% base protocol) positions Defifa competitively with traditional parimutuel systems (15--25\%) while the protocol token rebate further reduces the effective rate.
978
-
979
- \textbf{Practical Recommendations.}
980
- \begin{enumerate}[nosep]
981
- \item \textbf{Participation uniformity is paramount}: The Uniform Participation Theorem (Section~9.3) proves games with equal tier supply are impervious to profitable governance attacks. Choose events where all tiers attract organic interest.
982
- \item \textbf{Tier count}: 4--32 tiers. Only add tiers that will attract meaningful participation; empty tiers are cheap governance power for attackers.
983
- \item \textbf{Reserve tokens}: Configure reserved rates on every tier to smooth supply and dilute attacker ownership in sparse tiers.
984
- \item \textbf{Pricing}: 0.01--0.1~ETH per NFT for accessibility and attack resistance.
985
- \item \textbf{Refund phase}: 1--7 days for meaningful optionality.
986
- \item \textbf{Attestation}: Trusted default delegate; 3--7 day grace period.
987
- \item \textbf{Fees}: Default 7.5\% is competitive; organizer splits should not exceed 5\%.
988
- \item \textbf{Safety}: Always set \texttt{scorecardTimeout} (90--180 days) and \texttt{minParticipation} for permissionless games.
989
- \end{enumerate}
990
-
991
- \textbf{Synthesis.} Defifa implements a rigorous approach to prediction gaming through the composition of three well-understood mechanisms: parimutuel pooling for price formation, attestation governance for outcome resolution, and Juicebox V6 for treasury management. The mathematical analysis confirms that the system conserves value and converges to informationally efficient equilibria. The protocol token layer adds a novel incentive dimension that aligns participant, organizer, and protocol interests around game volume growth.
992
-
993
- The elegance of Defifa resides in its architectural composability: prediction games with arbitrary outcomes, arbitrary tier structures, and arbitrary payout distributions emerge from the same set of twelve parameters (Eq.~1), executed deterministically by immutable smart contracts with a single, time-bounded governance input. From a 4-team presidential election to a 32-team World Cup, the same protocol handles it all---and the safety mechanisms ensure that every game resolves, one way or another.
994
-
995
- The most significant finding is the Uniform Participation Theorem: \textbf{a game with uniform tier supply is provably impervious to profitable governance attacks regardless of attacker capital.} This transforms game design from an art into an engineering discipline---the designer's job is to choose events and tier structures that naturally produce uniform participation, and the cryptoeconomics handle the rest.
996
-
997
- \end{document}