Skip to content

support drain liquidity when dev rugged 60days project#140

Open
koo-virtuals wants to merge 9 commits intomainfrom
feat/vp-1981
Open

support drain liquidity when dev rugged 60days project#140
koo-virtuals wants to merge 9 commits intomainfrom
feat/vp-1981

Conversation

@koo-virtuals
Copy link
Copy Markdown
Contributor

@koo-virtuals koo-virtuals commented Feb 5, 2026

Note

High Risk
Adds privileged functions that can transfer out all liquidity from both private pools and graduated Uniswap V2 pools, which is highly security- and fund-safety-sensitive despite role gating. Also tightens swap slippage checks to revert on zero-output trades, which may affect edge-case trading flows after reserve manipulation/drains.

Overview
Adds privileged liquidity drain support for rugged Project60days tokens. FRouterV2 now stores a BondingV2 reference (setBondingV2) and introduces drainPrivatePool (empties an FPairV2 of both asset + token balances) and drainUniV2Pool (removes all LP via AgentFactoryV6 for the founder’s full veToken balance), emitting new drain events.

Hardens trading around drained/empty pools by making BondingV2/BondingV3/BondingV4 buy/sell revert with SlippageTooHigh when router returns a zero output, preventing zero-output buys from succeeding and accidentally triggering graduation logic.

Updates FPairV2 to support syncAfterDrain (reserve/k recompute + Sync event) and extends IAgentFactoryV6/IAgentVeTokenV2 to support drain flows (adds founder() and a removeLpLiquidity signature), with extensive new tests covering drain behavior, access control, and post-drain trading/graduation protection.

Written by Cursor Bugbot for commit 57ea939. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Storage layout collision in upgradeable proxy contract
    • Moved bondingV2 to be declared after bondingV4, preserving existing proxy storage slots and preventing slot-collision regressions on upgrade.

Create PR

Or push these changes by commenting:

@cursor push 2e352982af
Preview (2e352982af)
diff --git a/contracts/launchpadv2/FRouterV2.sol b/contracts/launchpadv2/FRouterV2.sol
--- a/contracts/launchpadv2/FRouterV2.sol
+++ b/contracts/launchpadv2/FRouterV2.sol
@@ -39,7 +39,6 @@
     address public assetToken;
     address public taxManager; // deprecated
     address public antiSniperTaxManager; // deprecated
-    IBondingV2ForRouter public bondingV2;
 
     event PrivatePoolDrained(
         address indexed token,
@@ -57,6 +56,7 @@
 
     // BondingV4 reference for checking X_LAUNCH tokens
     IBondingV4ForRouter public bondingV4;
+    IBondingV2ForRouter public bondingV2;
 
     /// @custom:oz-upgrades-unsafe-allow constructor
     constructor() {

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

address public assetToken;
address public taxManager; // deprecated
address public antiSniperTaxManager; // deprecated
IBondingV2ForRouter public bondingV2;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storage layout collision in upgradeable proxy contract

High Severity

The new bondingV2 state variable is inserted before the existing bondingV4 state variable in this upgradeable proxy contract, shifting bondingV4 from its original storage slot to the next one. After upgrade, bondingV2 reads the old bondingV4 value (causing isProject60days() calls to revert on a BondingV4 address), and bondingV4 reads zero (disabling all X_LAUNCH anti-sniper tax logic). The bondingV2 declaration needs to be placed after bondingV4 to preserve the storage layout.

Additional Locations (1)
Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants