Repository navigation
Test the ordinary residual sweep and fix the remaining scanner findings - #1897
Merged
Merged
Conversation
…idual sweep SecurityPoolServices kept pendingBurnCash, flushBurn and UnusedServiceCashBurned after #1865 removed the only writer, so flushBurn could only ever burn zero. Remove them with their consumers. Test sweeping the one-atto-REP rounding residual an ordinary game leaves when binding capital is not a multiple of the payout denominator, the only path that reaches the residual burn. Stop naming never-assigned returns in three test stubs.
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.
What
Fixes the findings that the new checks of the unreachable Solidity code scanner (#1890) report on
main. This PR is independent of #1890: it only fixes what the scanner found.The scanner also reported
SecurityPoolServices.flushBurnas never executed. Its burn queue had no writer, so it could only ever burn zero. #1895 removed that dead path while this PR was open, so this PR now only fixes the rest.Ordinary residual sweep (
never-executed)No test reached the positive-surplus branch of
settleOrdinaryGame, nor the success path ofsweepResidualRepToQuestionLedgerfor an ordinary game.Ordinary games burn the lowest outcome's stake as it arrives. That leaves custody holding the winner's stake plus the binding capital B. The winner reserve is
floor(3B/5) + floor(2B/5)on top of the winner's stake, so the only surplus possible is a 1 atto-REP rounding residual, when B is not a multiple of 5.A new test in
ordinarySettlementRecovery.test.tssets up exactly that case (B = 200 REP + 1). It checks that:OrdinaryResidualRepBurned(1);Named returns never assigned (
unassigned-return)Three empty test-stub
question(...)functions named theirstateandfinalClaimreturns without assigning them. The names are dropped; behavior is unchanged.Stale descriptions of the removed burn
SecurityPoolServices@devcomment no longer says services burns unrecorded collateral. After Resolve below-Medium findings from the Dec 2 contract review (#1877) #1895 it burns nothing.flushBurn()still withdraws them throughwithdrawCapitalCash(), butmain's wording had narrowed this to payouts only.Validation
bun run tsc.deployment-runtime-hashes.test.ts: the pins are unchanged.bun run check,check:generated-clean,knip,format:checkandgit diff --check.test:browser:smokepassed with the same changes.