Conversation
flashstack-stx-pool-v3 and flashstack-sbtc-pool-v3 are the v2 pool sources plus the two-step admin change. v2's deposit checked only amount > 0, so a paused pool still accepted deposits while flash-loan correctly refused loans -- pv3-F3's shape, fixed in flashstack-pool-v3 only. Verified against the deployed mainnet source of both live v2 pools: same gap there (immutable; unchanged by this commit). One functional line per pool: (asserts! (not (var-get paused)) ERR-PAUSED) in deposit, before the zero-amount check, matching pool-v3's ordering. withdraw stays ungated on purpose so LPs can always exit. Both pools already defined ERR-PAUSED (u405 / u705) and the paused flag. The contracts/test/ copies get the identical change, so the canonical-copy drift guard holds. tests/v3-pools-pause-gate.test.ts pins four behaviours per pool, in the directions the failure modes point: deposit works when unpaused (must not over-block), is refused while paused with ERR-PAUSED and mints nothing (the fix), withdraw is NOT blocked by pause (over-gating would strand funds), and unpausing restores deposit. Mutation-checked: with the gate stripped from the compiled copies, exactly the two fix-dependent tests fail per pool (4 of 8), the two over-blocking guards stay green. Verified: clarinet check 211 contracts / 0 errors; suite 229/229 across 21 files (221 + 8); drift guard, mainnet-fidelity and BC1 suites green. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes F-8 for the two undeployed v3 pools.
flashstack-stx-pool-v3andflashstack-sbtc-pool-v3are the v2 pool sources plus the two-step admin change, and v2'sdepositchecks onlyamount > 0: a paused pool still accepts deposits whileflash-loancorrectly refuses loans. That'spv3-F3's shape, which was fixed inflashstack-pool-v3only.I verified this against the deployed mainnet source of both live v2 pools (same gap). Those are immutable and this PR does not change them; only the undeployed v3 pools can still be fixed. F-8 itself is filed in #65.
The change
One functional line per pool, in
deposit, before the zero-amount check (same ordering as pool-v3):withdrawstays ungated on purpose, so LPs can always exit.ERR-PAUSED(u405 / u705) and thepausedflag.contracts/test/copies get the identical change, socanonical-copy-driftholds.Tests:
tests/v3-pools-pause-gate.test.ts(8, four per pool)Pinned in the directions the failure modes point:
ERR-PAUSED, mints nothingMutation-checked. With the gate stripped from the compiled copies, exactly the two fix-dependent tests fail per pool (4 of 8); the two over-blocking guards stay green, as they should.
Verification
clarinet check: 211 contracts, 0 errorscanonical-copy-drift,mainnet-fidelity,bc1-two-step-fixgreenNot in this PR
set-adminvstransfer-adminnaming onflashstack-sbtc-core-v2: separate decision, disclosed in the packet.🤖 Generated with Claude Code