Fix critical recent Solidity regressions#42
Draft
cursor[bot] wants to merge 2 commits into
Draft
Conversation
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
N/A - critical bug-finding automationcursor/critical-bug-investigation-e035origin/main(9572e85) in token minting, lottery draw timing, Uniswap LP wrapper authorization, V4 PoolManager ERC20 settlement, and default FFI test execution.N/ASummary
CloudCoin.mintwas unrestricted, allowing arbitrary supply inflation against StakeTogether accounting; SimpleLottery accepted purchases at/afterdrawBlockwhile timestamp window remained open; Uniswap V3/V4 wrappers let arbitrary callers drain approved or wrapper-custodied LP NFT assets; V4 PoolManager ERC20 settlement skippedsync(currency)beforesettle(); default Foundry config enabled host-command FFI for normal tests.Ownable, reject lottery purchases onceblock.number >= drawBlock, require owner/approved/controller callers for LP NFT decrease/collect/burn flows, sync ERC20 currencies before V4 PoolManager settlement, and make FFI tests skip unlessRUN_FFI_TESTS=truewith CI/pre-commit running explicit FFI steps separately.Agent Handoffs
N/AN/AN/AN/A - automation critical-fix PR, no issue artifact requiredFiles To Read First
src/14-stake-together/CloudCoin.solsrc/15-simple-lottery/SimpleLottery.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, and FFI tests.Issue Conflict Check
IssueAgentfound no material conflict with existing requirements or system behaviorIssueAgentfound conflicts and explicit user confirmation was captured before developmentDesign / Diagram Updated
docs/issues/<issue-number>/architecture.mdValidation Evidence
forge fmt --checkforge test --match-path test/14-stake-together/StakeTogether.t.sol -vvv;forge test --match-path test/15-simple-lottery/SimpleLottery.t.sol -vvv;forge test --match-path test/21-uniswap-v3/UniswapV3LiquidityNftExample.t.sol -vvv;forge test --match-path test/22-uniswap-v4/UniswapV4WrapperUnit.t.sol -vvv;forge test --match-path test/22-uniswap-v4/UniswapV4PositionManagerExample.t.sol -vvv;forge test --match-path test/22-uniswap-v4/UniswapV4PoolManagerExample.t.sol -vvvforge test -vvv— 500 passed, 0 failed, 36 skippedRUN_FFI_TESTS=true forge test --match-path test/FFI.t.sol --ffi -vvv;RUN_FFI_TESTS=true forge test --match-path test/DifferentialTest.t.sol --ffi -vvv;RUN_FFI_TESTS=true forge test --match-path test/Vyper.t.sol --ffi -vvv; independent read-only audit found no remaining critical blocker in the scoped areas.Security Findings
User Test Request