mirror of
https://github.com/luxfi/liquid.git
synced 2026-10-30 16:21:07 +00:00
Log2NegFrac shifts conditionally and counts unconditionally — the braces were never there — so msb is 126 or 127 whatever x is, the integer part of the logarithm is always 1 or 2, and the fraction is read off a misaligned word. A redemption records a weight increment and every account later scales its share by it, and that round trip is exact to 75% and then collapses: a redemption taking 99% of the locked collateral charged the accounts 50%. The other 49% stayed in the protocol, charged to nobody and owed to everybody. That is the collateral leak, and no amount of rounding work would have found it. The pot was wrong twice more. It filled at the collateralization bar and drained at par, so every redemption stranded the bar's whole margin in the denominator — ninety-nine thousand units still locked against no debt. And _sync restated each account's share at the live price while no price ever reached the total, so after a doubling the protocol gave up twice what it charged. _relock is now the only writer and carries the difference to the total, so the identity holds by construction rather than by arithmetic that happens to agree. killSwitch was declared, assigned, and read nowhere. It sat in one of the seven tests that a block comment opened at line 168 and closed at 277. The suite could not have caught any of it. The commit that says it registers eight submodules is empty — its tree hash equals its parent's — so a fresh clone gets three of eleven libraries and compiles nothing. It stayed green because the runners reuse a workspace where the untracked lib/ survives between runs. Gitlinks are staged now and foundry.lock matches what actually builds. Five invariants fail at HEAD once the dead transmuter handler is filled in, and all five are the protocol rather than the harness. Two are fixed here. Five still fail: a repayment and the claim after it are supposed to cancel and burn 426 wei more synthetic than they retire debt, which leaves one account owing a wei more than the whole book and its position permanently unrepayable. That one is isolated, not fixed. A pot invariant I had added is removed rather than shipped with a bound I could not derive. The identity holds to a wei deterministically; the campaign still drifts through liquidation and strategy loss, and asserting a tolerance nobody can defend is how this suite got here. Co-authored-by: Hanzo Dev <[email protected]>