Deploy scripts (DeployLocal.sol and DeployBase.sol) now execute a seed buy + double-recenter sequence before handing control to users: 1. Temporarily grant deployer recenterAccess (via self as feeDestination) 2. Fund LM with a small amount and call recenter() -> places thin positions 3. SeedSwapper executes a small buy, generating a non-zero WETH fee 4. Second recenter() hits the cumulativeVolume==0 bootstrap path with ethFee>0 -> _recordVolumeAndPrice fires -> cumulativeVolume>0 5. Revoke recenterAccess and restore the real feeDestination After deployment, cumulativeVolume>0, so the bootstrap path is unreachable by external users and cannot be front-run by an attacker inflating the initial VWAP anchor with a whale buy. Also adds: - tools/deploy-optimizer.sh: verification step checks cumulativeVolume>0 after a fresh local deployment - test_vwapBootstrappedBySeedTrade() in VWAPFloorProtection.t.sol: confirms the deploy sequence (recenter + buy + recenter) leaves cumulativeVolume>0 and getVWAP()>0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| backtesting | ||
| BaseDeploy.sol | ||
| DeployBase.sol | ||
| DeployBaseMainnet.sol | ||
| DeployBaseSepolia.sol | ||
| DeployLocal.sol | ||
| LmTotalEth.s.sol | ||
| UpgradeOptimizer.sol | ||