[PR #127] [MERGED] SMP 0.16.0: a state Treasury, nobody makes money, the tax code #129

Closed
opened 2026-11-03 04:03:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon-mods/pull/127
Author: @ludovic111
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/smp-treasury


📝 Commits (2)

  • a864f87 SMP 0.16.0: a state Treasury, nobody makes money, the tax code
  • 3f115b7 SMP: the pools other parts use aren't dead code in the game build

📊 Changes

10 files changed (+1240 additions, -168 deletions)

View changed files

📝 native/smp/Cargo.lock (+1 -1)
📝 native/smp/Cargo.toml (+1 -1)
📝 native/smp/README.md (+28 -7)
📝 native/smp/mixins/smp/glue.rs (+47 -13)
📝 native/smp/mixins/smp/horizon-mixin.toml (+7 -1)
📝 native/smp/mixins/smp/smp_claims.rs (+10 -1)
📝 native/smp/mixins/smp/smp_economy.rs (+456 -133)
➕ native/smp/mixins/smp/smp_tax.rs (+659 -0)
📝 native/smp/proof.py (+29 -11)
📝 native/smp/src/lib.rs (+2 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Ludovic's ask (2026-11-01): no money printing by operators, and every tax, fee and house edge goes into a state Treasury.

What changes for players and ops

  • /eco give, /eco set and /eco give * are gone. Typing them says "Nobody can make money, operators included" and points to the Treasury. /eco take <player> <amount> [reason] moves a cheat's gains into the Treasury.
  • /treasury (everyone): balance, income by kind and spending (today and all time), last weekly collection. /treasury log: the last movements, with who, why and by whom.
  • /treasury pay <player> <amount> <reason> (ops level 3): the only way an op gives money. Never more than the Treasury holds, a reason is required, and everyone sees it in chat. Logged as grant.
  • /eco taxes (also /taxes): the tax code and your own bill for Monday. /eco taxes pay pays land tax you owe.

The tax code (config.json → taxes)

  • VAT 5% on player-to-player sales (applied by the auction house, next PR), paid by the seller.
  • Land tax every Monday 00:00 UTC: 5 coins per claimed chunk past the first 4. Unpaid tax is owed and blocks new claims; nothing is ever unclaimed.
  • Wealth tax every Monday: 1% of the part of a balance above 50k, 2% above 250k, 3% above 1M. Nobody pays it today (richest balance: 11,804), so it is a brake for later.
  • The coinflip and lottery fee_percent now go to the Treasury instead of vanishing.

For other parts (casino, market, futures): Economy::{pool, to_pool, from_pool, pool_move, settle_pool}, each one audit line. settle_pool takes a held stake into a pool and pays out at most what the pool holds, so it never mints. A move into or out of treasury is also counted in Accounts.treasury for /treasury and the reports. Accounts.ext lets a part (the tax state now, the auction house next) be written in the same atomic step as the money.

Perf: the weekly collection is one comparison a second, and the work runs once a week (one pass over accounts and claims). Nothing new runs per tick.

Tests: 75 unit tests, including: nobody makes money; pools pay only what they hold and survive a restart; settle_pool caps payouts and award fees reach the Treasury; Monday collects once, money is conserved, arrears block claims, and a restart doesn't collect twice; only ops pay from the Treasury. fmt and clippy are clean.

Not run here: native.py check/proof. The Mac mini is at 24 GB free, below the 25 GB floor, so the game build is left to this PR's CI check. proof.py is updated: it seeds a 5,000-coin Treasury, funds players with /treasury pay, and checks /treasury, the log, /eco taxes and the refusals. It still needs a run before deploy.

Deploy note: the live Treasury starts at 0. It fills from Monday's land tax and game fees. The orchestrator / Ludovic decides whether to seed it; this PR can't mint.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon-mods/pull/127 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/smp-treasury` --- ### 📝 Commits (2) - [`a864f87`](https://github.com/horizon-rust/horizon-mods/commit/a864f877ec52e4e91bebf5a675a0fe049b060644) SMP 0.16.0: a state Treasury, nobody makes money, the tax code - [`3f115b7`](https://github.com/horizon-rust/horizon-mods/commit/3f115b7e06b7cb99c046873162a71a4a21ac0887) SMP: the pools other parts use aren't dead code in the game build ### 📊 Changes **10 files changed** (+1240 additions, -168 deletions) <details> <summary>View changed files</summary> 📝 `native/smp/Cargo.lock` (+1 -1) 📝 `native/smp/Cargo.toml` (+1 -1) 📝 `native/smp/README.md` (+28 -7) 📝 `native/smp/mixins/smp/glue.rs` (+47 -13) 📝 `native/smp/mixins/smp/horizon-mixin.toml` (+7 -1) 📝 `native/smp/mixins/smp/smp_claims.rs` (+10 -1) 📝 `native/smp/mixins/smp/smp_economy.rs` (+456 -133) ➕ `native/smp/mixins/smp/smp_tax.rs` (+659 -0) 📝 `native/smp/proof.py` (+29 -11) 📝 `native/smp/src/lib.rs` (+2 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Ludovic's ask (2026-11-01): no money printing by operators, and every tax, fee and house edge goes into a state Treasury. **What changes for players and ops** - `/eco give`, `/eco set` and `/eco give *` are gone. Typing them says "Nobody can make money, operators included" and points to the Treasury. `/eco take <player> <amount> [reason]` moves a cheat's gains into the Treasury. - `/treasury` (everyone): balance, income by kind and spending (today and all time), last weekly collection. `/treasury log`: the last movements, with who, why and by whom. - `/treasury pay <player> <amount> <reason>` (ops level 3): the only way an op gives money. Never more than the Treasury holds, a reason is required, and everyone sees it in chat. Logged as `grant`. - `/eco taxes` (also `/taxes`): the tax code and your own bill for Monday. `/eco taxes pay` pays land tax you owe. **The tax code** (`config.json` → `taxes`) - VAT 5% on player-to-player sales (applied by the auction house, next PR), paid by the seller. - Land tax every Monday 00:00 UTC: 5 coins per claimed chunk past the first 4. Unpaid tax is owed and blocks new claims; nothing is ever unclaimed. - Wealth tax every Monday: 1% of the part of a balance above 50k, 2% above 250k, 3% above 1M. Nobody pays it today (richest balance: 11,804), so it is a brake for later. - The coinflip and lottery `fee_percent` now go to the Treasury instead of vanishing. **For other parts** (casino, market, futures): `Economy::{pool, to_pool, from_pool, pool_move, settle_pool}`, each one audit line. `settle_pool` takes a held stake into a pool and pays out at most what the pool holds, so it never mints. A move into or out of `treasury` is also counted in `Accounts.treasury` for `/treasury` and the reports. `Accounts.ext` lets a part (the tax state now, the auction house next) be written in the same atomic step as the money. **Perf**: the weekly collection is one comparison a second, and the work runs once a week (one pass over accounts and claims). Nothing new runs per tick. **Tests**: 75 unit tests, including: nobody makes money; pools pay only what they hold and survive a restart; `settle_pool` caps payouts and award fees reach the Treasury; Monday collects once, money is conserved, arrears block claims, and a restart doesn't collect twice; only ops pay from the Treasury. fmt and clippy are clean. **Not run here**: `native.py check`/`proof`. The Mac mini is at 24 GB free, below the 25 GB floor, so the game build is left to this PR's CI `check`. `proof.py` is updated: it seeds a 5,000-coin Treasury, funds players with `/treasury pay`, and checks `/treasury`, the log, `/eco taxes` and the refusals. It still needs a run before deploy. **Deploy note**: the live Treasury starts at 0. It fills from Monday's land tax and game fees. The orchestrator / Ludovic decides whether to seed it; this PR can't mint. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:03:28 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon-mods#129
No description provided.