You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(pavilion): v2 — claim windows and regret; the boundary second belongs to the heir
- depositGift(tokenId, heir, claimBy): strictly-future deadlines, heirless
gifts rejected (v1 trap: heir=address(0) collided with the empty-slot
sentinel and stranded the card in custody forever)
- gapless, overlap-free windows: heir claims while now <= claimBy (boundary
inclusive), giver reclaims only after — no early yank-back, the deadline
is a promise; expired gifts wait in custody with no reclaim deadline
- Gift{giver,heir,claimBy} struct mapping replaces the parallel mappings
- tests 111 → 120, coverage stays 100/100/100/100: boundary-second matrix
via evm_setNextBlockTimestamp (claim at claimBy succeeds, reclaim at
claimBy still blocked, +1s flips both), double-claim/reclaim, re-gift
after reclaim, 365-days-later reclaim
- READMEs / architecture / SECURITY / CONTRIBUTING synced
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Three Kingdoms general cards: four factions (WEI / SHU / WU / QUN), five raritie
18
18
-**Deliberately spiky Solidity.** File-level types and free functions, a `global` using-for, aliased named imports, a same-file-two-paths import trap, a public-state-var overriding an interface function, `unchecked` blocks, an assembly guard, reverting `receive`/`fallback` — each one placed on purpose to stress compilers, flatteners, UML generators, linters and analyzers, and annotated with *why*. See [docs/architecture.md](docs/architecture.md).
19
19
-**Signature-driven lazy minting (虎符 TigerTally).** A tally contract takes the suzerainty — the two-step handover exists precisely so a *contract* can hold the throne safely — and redeems EIP-712 `MintOrder`s: nested-struct hashing (the order wraps a full `Card`), bearer and bound-with-relayer voucher modes, voidable nonces, malleability-guarded `ecrecover`, and a marshal-gated passthrough for every suzerain power including the escape hatch back. The on-chain digest is differentially anchored to ethers' `TypedDataEncoder` in tests.
20
20
-**Real value handled the boring way (市集 CardBazaar).** A fixed-price, TRX-settled stall market with escrowed listings and **pull-payment proceeds** — paying sellers inline would let any seller with a reverting `receive()` brick their own listing's purchase. `withdraw()` is checks-effects-interactions, proven by a hostile seller that attempts a reentrant drain mid-payout and finds an already-zeroed ledger. No owner, no fees, no sweep: the bazaar's admin column in the trust model reads *nobody*.
21
-
-**111 tests, 100% coverage, gated in CI.** Statements, branches, functions and lines all at 100% (mocks excluded); the CI fails if any of it regresses. Includes differential tests of the on-chain Base64/decimal/JSON-escape/XML-escape helpers against reference implementations, XML well-formedness checks on every rendered SVG, a receiver-behavior matrix, and a seeded random transfer storm checked against a model.
21
+
-**120 tests, 100% coverage, gated in CI.** Statements, branches, functions and lines all at 100% (mocks excluded); the CI fails if any of it regresses. Includes differential tests of the on-chain Base64/decimal/JSON-escape/XML-escape helpers against reference implementations, XML well-formedness checks on every rendered SVG, a receiver-behavior matrix, and a seeded random transfer storm checked against a model.
22
22
-**A real dogfooding campaign, honestly kept.** The entire project — scaffold, edit, lint, compile, VM deploy, debug, record/replay, TronBox export, git push, TronLink mainnet-style deploys, flatten & verification — was executed **inside TronIDE**, driving 23 IDE features and filing 13 findings, of which 6 were fixed upstream with regression gates and **3 were retracted after strict re-verification** (the ledger counts our own misreads too). See [docs/case-study.md](docs/case-study.md).
23
23
24
24
> **Audit status:** engineered to audit-grade practice, **not yet externally audited**. Read [SECURITY.md](SECURITY.md) before depositing value you care about.
Copy file name to clipboardExpand all lines: docs/architecture.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ stress fixture for Solidity toolchains (see [the spiky inventory](#the-spiky-con
45
45
|`libs/CardCodec.sol`|`Card → data:application/json;base64`| escapes user strings; aliased import `Str as S`|
46
46
|`libs/Base64.sol`| assembly Base64 encoder | was a byte loop until P10: the 4.07M-gas double-encoded tokenURI hit public nodes' constant-call CPU cap (`OutOfTimeException`); now 1.46M. Differential-tested vs Node across the swap |
|`PeachPavilion.sol`|gift escrow with claim windows (v2): heir claims while `now <= claimBy`, giver reclaims after — gapless, overlap-free boundary | rejects naked deliveries; rejects heirless gifts (the v1 stuck-card trap)|
49
49
|`TigerTally.sol`| 虎符 — EIP-712 signed mint orders (lazy minting); holds the suzerainty while in service | zero-dep nested-struct 712, low-s `ecrecover`, marshal passthroughs for the full suzerain surface |
50
50
|`CardBazaar.sol`| 市集 — fixed-price stalls, TRX-settled, escrowed listings | pull-payment proceeds (CEI, reentrancy-tested), `call{value:}` over `.transfer`, zero governance surface |
0 commit comments