# Launched tokens are vulnerable to flashloan attacks forcing premature graduation, allowing reward manipulation

Bonding.sol lets a founder flashloan-buy a memecoin to force graduation, then atomically unwrap to agentTokens and capture reward emissions.

- Payout: Contest reward
- Severity: medium
- Program: Virtuals Protocol
- Credited: oakcobalt
- Disclosed: 2025-08-04
- Write-up quality: 7/10
- Original: https://code4rena.com/reports/2025-04-virtuals-protocol#m-04
- Library page: https://bugbountylibrary.com/r/c4%3A2025-04-virtuals-protocol%3AM-04
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:chained vuln:business-logic vuln:flash-loan vuln:oracle-manipulation vuln:reward-distribution

**Target:** Bonding.sol bonding/graduation contract and unwrapToken
**Root cause:** unwrapToken has no time restriction, so a flashloan-funded buy can trigger graduation and be unwrapped and swapped back atomically, bypassing community liquidity requirements.
**Steps:**
1. Flashloan VIRTUAL tokens from an existing UniswapV2 pair/pool.
2. Approve router and call `bonding.buy(35000e18, token)` to push past gradThreshold and emit Graduated.
3. Call `bonding.unwrapToken(token, [attacker])` to burn memecoin and receive agentTokens from the pair.
4. Approve agentTokens and call `swapExactTokensForTokensSupportingFeeOnTransferTokens` on Uniswap router to convert back to VIRTUAL.
5. Repay flashloan (only trading fees lost); LP auto-staked in veToken.
6. Delegate veToken to self and call `rewards.distributeRewards` to receive inflated LP-value-based rewards.
**How found:** Reviewer noticed unwrapToken lacked time-based restrictions, enabling an atomic flashloan loop (buy -> graduate -> unwrap -> swap -> repay) that bypasses the intended community-liquidity graduation gate.
**Exploitation:** Attacker (founder or controlled account) flashloans VIRTUAL, buys the freshly launched memecoin to force graduation, atomically unwraps to agentTokens, swaps back to VIRTUAL to repay the loan, then stakes/delegates the auto-staked LP to claim reward emissions that dilute legitimate agentTokens.
**Escalation:** Forced graduation with unbalanced Uniswap reserves inflates getLPValue(), letting the attacker capture a disproportionate share of reward distributions and dilute other agentToken rewards.
**Insight:** When a graduation/threshold gate is meant to require organic liquidity, check whether any post-graduation conversion path (unwrap/redeem) can be executed in the same transaction as the buy; atomicity defeats the gate.
