# 1e10 fixed farming reward in GaugeFactoryCL

GaugeFactoryCL hardcodes 1e10 raw reward units for eternal farming, so low-decimal tokens like USDC or WBTC seed massively oversized incentives, draining protocol funds.

- Payout: Contest reward
- Severity: medium
- Program: Blackhole
- Credited: danzero
- Disclosed: 2025-07-03
- Write-up quality: 6/10
- Original: https://code4rena.com/reports/2025-05-blackhole#m-03
- Library page: https://bugbountylibrary.com/r/c4%3A2025-05-blackhole%3AM-03
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** GaugeFactoryCL.createEternalFarming (Algebra CL gauge factory)
**Root cause:** createEternalFarming hardcodes reward = 1e10 raw units instead of scaling to the reward token's decimals, so rewardRate is wildly inflated for low-decimal tokens.
**Steps:**
1. Call createGauge with _rewardToken = USDC (6 decimals) or WBTC (8 decimals).
2. createEternalFarming sets `uint128 reward = 1e10` and `rewardRate = reward/remainingTimeInCurrentEpoch`.
3. safeApprove and createEternalFarming seed the farm with 10,000 USDC or 100 WBTC worth of incentives instead of dust.
**How found:** Code review of createEternalFarming spotted the hardcoded 1e10 constant and reasoned about how raw-unit value varies across token decimals (18 vs 6 vs 8).
**Exploitation:** Anyone triggering gauge creation with a low-decimal reward token causes the factory to approve and seed an oversized incentive amount, overpaying rewards and draining protocol-held reward tokens.
**Insight:** When auditing factories that seed incentives, check hardcoded raw-unit constants against the decimals of every token the function can be called with; a value that is dust for 18-decimal tokens can be five or six figures for USDC/WBTC.
