Fix critical custody, LP, lottery, mint, and FFI regressions#35
Draft
cursor[bot] wants to merge 5 commits into
Draft
Fix critical custody, LP, lottery, mint, and FFI regressions#35cursor[bot] wants to merge 5 commits into
cursor[bot] wants to merge 5 commits into
Conversation
Co-authored-by: lzhkai <lzhkai1111@qq.com>
Co-authored-by: lzhkai <lzhkai1111@qq.com>
Co-authored-by: lzhkai <lzhkai1111@qq.com>
Co-authored-by: lzhkai <lzhkai1111@qq.com>
Co-authored-by: lzhkai <lzhkai1111@qq.com>
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.
Issue
daily critical bug-finding automationcursor/critical-bug-investigation-5e56Summary
RUN_FFI_TESTS=trueplus--ffifor host-command-backed tests.Agent Handoffs
Files To Read First
src/25-gravity/Gravity.solsrc/21-uniswap-v3/UniswapV3LiquidityNftExample.solsrc/22-uniswap-v4/UniswapV4PositionManagerExample.solsrc/22-uniswap-v4/UniswapV4PoolManagerExample.solfoundry.toml,.github/workflows/test.yml,scripts/pre-commit-ci.shtest/14-stake-together,test/15-simple-lottery,test/21-uniswap-v3,test/22-uniswap-v4,test/25-gravity, and FFI tests.Issue Conflict Check
Design / Diagram Updated
docs/issues/<issue-number>/architecture.mdValidation Evidence
forge fmt --checkforge test --match-path test/14-stake-together/StakeTogether.t.solforge test --match-path test/15-simple-lottery/SimpleLottery.t.solforge test --match-path test/21-uniswap-v3/UniswapV3LiquidityNftExample.t.solforge test --match-path test/22-uniswap-v4/UniswapV4WrapperUnit.t.solforge test --match-path test/22-uniswap-v4/UniswapV4PositionManagerExample.t.solforge test --match-path test/25-gravity/GravityBridgeExploit.t.soltest/FFI.t.sol,test/DifferentialTest.t.sol,test/Vyper.t.solRUN_FFI_TESTS=true forge test --match-path test/FFI.t.sol --ffi -vvRUN_FFI_TESTS=true forge test --match-path test/DifferentialTest.t.sol --ffi -vvRUN_FFI_TESTS=true forge test --match-path test/Vyper.t.sol --ffi -vvwith~/.local/binon PATH afterpip install -r requirements.txtforge test- 498 passed, 0 failed, 36 skippedFOUNDRY_PROFILE=manticore forge build --build-info --sizesSecurity Findings
CloudCoin.mintwas unrestricted, allowing arbitrary reward-token inflation. Fixed withOwnableandonlyOwner; regression test added.SimpleLottery.purchaseTicketaccepted tickets at the draw block if timestamp had not reached the purchase deadline, changing winner entropy after the draw block was selected. Fixed by closing purchases whenblock.number >= drawBlock; regression test added.settle()but omittedsync(currency), causing incorrect settlement accounting. Fixed by callingsync(currency)before transfer/settle; unit assertions added.submitWithdrawalBatchreleased custody assets for any caller. Fixed by requiring the constructor deployer batch submitter, while preserving the intended denom-poisoning PoC through authorized batch submission; regression test added.foundry.tomlenabled FFI in default/CI profiles, so ordinaryforge testcould execute host commands from tests. Fixed by removing profile-level FFI and gating FFI tests behind explicit env+flag opt-in.User Test Request