Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ef051b8
feat(token_lite): add single-game gas-optimized token component (dens…
starknetdev Aug 5, 2026
135540f
test(token_lite): add paired gas benchmarks vs full token component
starknetdev Aug 5, 2026
528c056
feat(minigame): add lite pre_action/post_action call-site twins
starknetdev Aug 6, 2026
62dc47b
feat(token_lite): batch mint, registry-less game check, shared example
starknetdev Aug 6, 2026
c58983b
fix(minigame): skip token settings/objectives announcements on lite t…
starknetdev Aug 6, 2026
af65a98
feat(presets): MinigameTokenLite deployable + two-phase game binding
starknetdev Aug 6, 2026
3bb9fac
docs: denshokan-lite -> one-address migration write-up
starknetdev Aug 6, 2026
612ee97
docs: per-action gas estimates for the remaining entrypoints
starknetdev Aug 6, 2026
4adda5c
refactor(token_lite)!: commit to self-binding — the game contract IS …
starknetdev Aug 7, 2026
5522993
feat(token_lite)!: lite-native token-id layout — spare bits consolida…
starknetdev Aug 24, 2026
0e369c1
refactor(token_lite)!: strip the ABI — dead machinery out, capability…
starknetdev Aug 24, 2026
d4aaac8
feat(token_lite)!: restore objective/context/client_url/paymaster/met…
starknetdev Aug 24, 2026
1a8e993
Merge game-components main (v1.1.12) into feat/token-lite
starknetdev Aug 24, 2026
3feb2eb
refactor!: the lite token is the standard — rename Lite→(none), origi…
starknetdev Aug 24, 2026
b51c0a6
feat(token)!: creator payout identity on the standard token (IMinigam…
starknetdev Aug 24, 2026
465ce93
perf(token): adopt SDM's packing codec — felt-arithmetic pack, u64 wo…
starknetdev Aug 24, 2026
2939fc9
fix(metagame): serve both token generations, not just legacy
starknetdev Aug 24, 2026
4a9bf15
refactor(metagame)!: drop the metagame-wide default token
starknetdev Aug 24, 2026
c493406
refactor(metagame)!: self-binding component — no context address, no ABI
starknetdev Aug 24, 2026
767fd1a
fix(metagame): clear test-compilation warnings from the metagame refa…
starknetdev Aug 24, 2026
efb4397
fix(metagame): reject a failed game-fee transfer instead of reporting…
starknetdev Aug 24, 2026
4e4f8d2
fix(metagame)!: enforce the self-bound pairing on every standard-toke…
starknetdev Aug 24, 2026
c92e3c4
feat(tokenomics): opt-in strict per-token config mode for BuybackComp…
starknetdev Aug 24, 2026
103b405
docs(tokenomics): document set_require_token_config in the admin table
starknetdev Aug 25, 2026
2c13741
feat(token): MinigameTokenMixinImpl — one embed for the full standard…
starknetdev Aug 25, 2026
b7fb0e7
docs(token): state the initializer's all-three-surfaces invariant for…
starknetdev Aug 25, 2026
de87644
docs(token): the partial-wiring revert triggers at first fee claim, n…
starknetdev Aug 25, 2026
198267c
feat(metagame): mint_batch_recipients passthrough — one dispatch per …
starknetdev Aug 25, 2026
7b1ddf1
feat(metagame)!: widen mint metadata to u128, matching the batch path
starknetdev Aug 25, 2026
9a0d5b9
feat(token): standard gets its own default license — fee amount remov…
starknetdev Aug 25, 2026
7295fd6
perf(metagame)!: discriminate token generation by address, not an SRC…
starknetdev Aug 25, 2026
f5d912f
fix(metagame): guard the fee paths against a zero registry
starknetdev Aug 25, 2026
864ac50
refactor(token)!: creator → game fee recipient — the payee names what…
starknetdev Aug 25, 2026
4b2023d
docs(metagame): finish the creator -> game fee recipient rename in prose
starknetdev Aug 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
include:
# Embeddable Game Standard
- package: game_components_embeddable_game_standard
module: token
module: token_legacy
runner: ubuntu-latest-32
fuzzer_runs: 32
- package: game_components_embeddable_game_standard
Expand All @@ -178,6 +178,10 @@ jobs:
module: registry
runner: ubuntu-latest-8
fuzzer_runs: 32
- package: game_components_embeddable_game_standard
module: token
runner: ubuntu-latest-8
fuzzer_runs: 32
# Metagame
- package: game_components_metagame
module: leaderboard
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,11 @@ jobs:
add() { INCLUDES=$(echo "$INCLUDES" | jq -c --arg p "$1" --arg m "$2" --arg r "$3" --argjson f "$4" '. + [{package:$p,module:$m,runner:$r,fuzzer_runs:$f}]'); }

if [ "$NEED_EGS" = "true" ]; then
add game_components_embeddable_game_standard token ubuntu-latest-32 32
add game_components_embeddable_game_standard token_legacy ubuntu-latest-32 32
add game_components_embeddable_game_standard minigame ubuntu-latest-8 32
add game_components_embeddable_game_standard metagame ubuntu-latest-8 32
add game_components_embeddable_game_standard registry ubuntu-latest-8 32
add game_components_embeddable_game_standard token ubuntu-latest-8 32
fi
if [ "$NEED_METAGAME" = "true" ]; then
add game_components_metagame leaderboard ubuntu-latest-4 256
Expand Down
56 changes: 48 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ The workspace is organized into **group packages**, each containing multiple mod
packages/
├── embeddable_game_standard/ # Core game standard components
│ ├── src/
│ │ ├── token/ # ERC721 game token with compile-time feature flags
│ │ ├── token/ # THE minigame token standard (self-bound ERC721, absorbed minter)
│ │ ├── token_legacy/ # Original multi-game ERC721 token (kept for deployed denshokan)
│ │ ├── minigame/ # Individual game logic foundation
│ │ ├── metagame/ # High-level game coordination & context
│ │ └── registry/ # Game registration and discovery
Expand Down Expand Up @@ -79,8 +80,39 @@ Each module has its own `AGENTS.md` with detailed documentation inside its `src/

## Architecture Overview

There are two token generations. New work targets the **standard** token; the
**legacy** token is kept for deployed denshokan.

### Standard (`token/`) — self-bound, one address

```
Metagame ──→ Game contract (IS the ERC721 token)
│ ├── Settings (optional)
│ └── Objectives (optional)
└── Context (optional)
```

`MinigameTokenComponent` is embedded IN the game contract, so the game and the
token are the same address. There is no registry, no `game_address` resolution
and no mutable token state.

**Game Lifecycle**: Setup → Mint → Play → `refresh_metadata()` (ERC-4906)

There is no `update_game()` and no `IMetagameCallback`: nothing to sync. The
game contract is the authority on game-over and objective completion, gating
its own entrypoints with the component's internal `assert_owner_and_playable`.
Consumers identify a standard token by SRC5 (`IMINIGAME_TOKEN_ID`); the
creator/fee identity the registry used to hold lives on the token itself
(`IMINIGAME_TOKEN_CREATOR_ID`).

`MinigameComponent` is **legacy-only** — it asserts `IMINIGAME_TOKEN_LEGACY_ID`
and calls `game_registry_address()`. A standard-token game embeds the token
component directly instead (see `test_common::mocks::standard_game_mock`).

### Legacy (`token_legacy/`) — separate token contract, registry-backed

```
Metagame ──→ MinigameToken (ERC721) ──→ Minigame
Metagame ──→ MinigameTokenLegacy (ERC721) ──→ Minigame
│ ▲ │ │
│ │ └── Registry ├── Settings (optional)
│ │ └── Objectives (optional)
Expand All @@ -92,6 +124,12 @@ Metagame ──→ MinigameToken (ERC721) ──→ Minigame

When `update_game()` is called, the token checks if the minter implements `IMetagameCallback` (via SRC5) and dispatches score/game_over/objective callbacks automatically.

The `metagame` lib and `MetagameComponent` serve **both** generations, branching
on SRC5. `MetagameComponent` is itself **self-bound** — it stores no addresses
and exposes no ABI (`IMetagame`/`IMETAGAME_ID` were removed): the embedding
contract IS the metagame, each game's token is resolved per mint, and a
metagame that provides context embeds `ContextComponent` on its own address.

## Key Patterns

- `#[starknet::component]` for reusable architecture
Expand Down Expand Up @@ -123,28 +161,30 @@ When adding a new module to a group package, update **both** files:
fuzzer_runs: 256
```

For memory-intensive modules (like `token` or `minigame`), assign a larger runner (e.g., `ubuntu-latest-4` or `ubuntu-latest-32`).
For memory-intensive modules (like `token_legacy` or `minigame`), assign a larger runner (e.g., `ubuntu-latest-4` or `ubuntu-latest-32`).

2. **`codecov.yml`** - Update the build count:
```yaml
notify:
after_n_builds: 15 # ← Must equal total module count in matrix
```

### Current Matrix (16 modules)
### Current Matrix (18 modules)

| Group Package | Module | Runner | Fuzzer Runs |
|---------------|--------|--------|-------------|
| `embeddable_game_standard` | `token` | `ubuntu-latest-32` | 32 |
| `embeddable_game_standard` | `minigame` | `ubuntu-latest-32` | 32 |
| `embeddable_game_standard` | `metagame` | `ubuntu-latest-32` | 256 |
| `embeddable_game_standard` | `registry` | `ubuntu-latest-32` | 256 |
| `embeddable_game_standard` | `token_legacy` | `ubuntu-latest-32` | 32 |
| `embeddable_game_standard` | `minigame` | `ubuntu-latest-8` | 32 |
| `embeddable_game_standard` | `metagame` | `ubuntu-latest-8` | 32 |
| `embeddable_game_standard` | `registry` | `ubuntu-latest-8` | 32 |
| `embeddable_game_standard` | `token` | `ubuntu-latest-8` | 32 |
| `metagame` | `leaderboard` | `ubuntu-latest-4` | 256 |
| `metagame` | `registration` | `ubuntu-latest-4` | 256 |
| `metagame` | `entry_requirement` | `ubuntu-latest-4` | 256 |
| `metagame` | `entry_fee` | `ubuntu-latest-4` | 256 |
| `metagame` | `prize` | `ubuntu-latest-4` | 256 |
| `metagame` | `ticket_booth` | `ubuntu-latest-4` | 256 |
| `metagame` | `merkledrop` | `ubuntu-latest-4` | 256 |
| `economy` | `tokenomics` | `ubuntu-latest-4` | 256 |
| `utilities` | `math` | `ubuntu-latest-4` | 256 |
| `utilities` | `distribution` | `ubuntu-latest-4` | 256 |
Expand Down
6 changes: 3 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
codecov:
require_ci_to_pass: true
notify:
# Must equal package count in .github/workflows/main-ci.yml matrix
# See AGENTS.md "CI Configuration" section when adding packages
after_n_builds: 17
# Must equal total module count in the .github/workflows/main-ci.yml matrix
# (modules, NOT packages). See AGENTS.md "CI Configuration" when adding a module
after_n_builds: 18

comment:
layout: "diff, files, header, footer"
Expand Down
Loading
Loading