Index contracts
IndexFund.sol
IndexFund places launch allocations into index liquidity and handles graduation, harvesting and compounding. Its placement quote has no on-chain bound on economic value.
Reviewed source: src/index/IndexFund.sol at commit 38f14ff.
Findings
| ID | Severity | Finding |
|---|---|---|
| B-04 | Medium | One operator key can sell a launch's index allocation for dust |
[MEDIUM] B-04 · One operator key can sell a launch's index allocation for dust
B-04 · Medium
Index placement prices have no on-chain value bound. A compromised or mistaken graduation operator can place the full 60 million token allocation where it sells for wei.
graduate and compound use an operator-supplied quote to place a token-only position. The quote is checked against the global square-root price limits and the requirement that placement needs no ETH. Neither check constrains its economic value.
The documented design treats quotes as trusted operator attestations. There is no reference price, delay between tiers, or mechanism to move a bad placement afterwards. A single operator can advance a launch through all three tiers using unsuitable quotes.
There is also a conditional unprivileged path. Anyone can move spot for free through the empty region above the index fund's range. An operator that derives its next quote from that spot can then place a tranche at the attacker's price. The repository's operations script accepts a quote as an argument; the review did not establish that production tooling reads spot.
Impact
A compromised or careless operator can expose the launch's full 60 million token index allocation, 6% of supply, to purchase for dust. The same key can repeat this across launches. Graduation also advances each launch's protocol-fee stage.
The unprivileged variant depends on the operator's quote source. An independently sourced quote is fixed calldata that a third party cannot alter. These role and tooling preconditions are part of the Medium rating.
Affected code
Locations refer to the reviewed commit, 38f14ff.
src/index/IndexFund.sol:174–190— The operator graduates successive tiers.src/index/IndexFund.sol:255–287— Placement validates encoding and funding, but not value.
From src/index/IndexFund.sol:255–276:
function _prepare(Position memory prepared, uint160 quote, uint amount) private returns (uint128 liquidity) {
if (quote < TickMath.MIN_SQRT_PRICE || quote >= TickMath.MAX_SQRT_PRICE) {
revert InvalidPlacement();
}
PoolKey memory key = _key(prepared.token);
bytes32 poolId = PoolId.unwrap(key.toId());
if (poolToken[poolId] == address(0)) {
poolToken[poolId] = prepared.token;
emit IndexPoolRegistered(prepared.token, poolId, address(0), prepared.token, 10_000, 60, address(flaunchHook), prepared.indexCurve);
poolManager.initialize(key, quote);
}
(uint160 spot,,,) = poolManager.getSlot0(key.toId());
int24 upper = TickMath.getTickAtSqrtPrice(quote);
int24 remainder = upper % 60;
upper -= remainder;
if (remainder < 0) {
upper -= 60;
}
int24 lower = TickMath.minUsableTick(60);
if (upper <= lower || TickMath.getSqrtPriceAtTick(upper) > spot) {
revert InvalidPlacement();
}
Proof of concept
IndexAudit.t.sol contains three cases:
test_B1_freeSpotFling_thenSpotQuotedTrancheSoldForDustmoves spot through an empty region, then buys a spot-quoted tranche of about 19,999,991 tokens for 156 wei.test_B2_singleOperatorKeyCanSellAll60MForDustgraduates all three tiers with one operator key and buys about 59,999,973 tokens for 10,000 wei.test_B3_spotNudgeRevertsSpotQuotedGraduationshows that a roughly 0.0001 ETH price nudge can instead make a spot-quoted graduation revert.
The control test confirms that third parties cannot initialise the index pool or add liquidity directly. Their influence in the conditional attack is over spot, not the operator's permissions.
The test source is poc/IndexAudit.t.sol in the Solidity evidence bundle. Follow the reproduction setup, then run:
FOUNDRY_GAS_LIMIT=1000000000000 forge test --match-path 'test/audit/IndexAudit.t.sol' -vv
Recommended solution
Bound quotes on chain against a suitable time-weighted reference from the launch's own market or an established placement. Add a delay between tiers and a guarded way to re-range an incorrect placement.
Keep operator rights behind a multisig or delay, and source quotes independently of the index pool's current spot price.
Shared findings
- B-02 · Medium: Graduated ETH revenue is locked for Buy-and-Burn routes without an ETH pair — Constituent liquidity fees introduce ETH revenue for graduated ERC20-only launches.
- B-24 · Low: Single-step ownership and renunciation can permanently freeze payouts — The fund retains single-step ownership transfers and inherited renunciation.