Implement/review the A2 scalable winner model using canonical playerKey per WinMode + O(1) aggregated counters & winner counts (no loops over players) for daily/monthly commit→reveal→draw→claim.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Implement/review the A2 scalable winner model using canonical playerKey per WinMode + O(1) aggregated counters & winner counts (no loops over players) for daily/monthly commit→reveal→draw→claim.
A2 Key Aggregation (O(1) Winners)
When to use
Touching reveal, draw/VRF callback, claim, win modes, or anything that might reintroduce loops over players.
Adding new win conditions, “order ignored” variants, or changing how pot splits/winner counts are computed.
Goal (Definition of Done)
✅ No unbounded loops over players in draw/claim paths.
✅ For every WinMode, contract stores:
playerKey per player
countByKey aggregated counter
winningKey and winnersCount computed in O(1)
Canonical approach
1) Canonical keys per mode (computed on reveal)
Compute playerKey = keyFn(mode, revealedSequence) for each supported WinMode.