fix: address AI review findings for #706 recenterAccess removal
- DeployBase.sol: remove broken inline second recenter() (would always revert with 'recenter cooldown' in same Forge broadcast); replace with operator instructions to run the new BootstrapVWAPPhase2.s.sol script at least 60 s after deployment - BootstrapVWAPPhase2.s.sol: new script for the second VWAP bootstrap recenter on Base mainnet deployments - StrategyExecutor.sol: update stale docstring that still described the removed recenterAccess bypass; reflect permissionless model with vm.warp - TestBase.sol: remove vestigial recenterCaller parameter from all four setupEnvironment* functions (parameter was silently ignored after setRecenterAccess was removed); update all callers across six test files - bootstrap-common.sh: fix misleading retry recenter in seed_application_state() — add evm_increaseTime 61 before evm_mine so the recenter cooldown actually clears and the retry can succeed All 210 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9b53f409b7
commit
0d3aee15b4
11 changed files with 71 additions and 42 deletions
|
|
@ -137,12 +137,9 @@ contract DeployBase is Script {
|
|||
console.log("Seed buy executed -> fee generated in anchor position");
|
||||
|
||||
// Step 4: Second recenter records VWAP (bootstrap path + ethFee > 0).
|
||||
// NOTE: Must be called >= 60s after the first recenter (cooldown) AND
|
||||
// >= 300s after pool init so TWAP has settled at post-buy price.
|
||||
// On Base mainnet, mine/wait ~5 min between Step 2 and Step 4.
|
||||
liquidityManager.recenter();
|
||||
require(liquidityManager.cumulativeVolume() > 0, "VWAP bootstrap failed: cumulativeVolume is 0");
|
||||
console.log("VWAP bootstrapped -> cumulativeVolume:", liquidityManager.cumulativeVolume());
|
||||
// Cannot be called in the same Forge broadcast as Step 2 — recenter() enforces a
|
||||
// 60-second cooldown and there is no time-warp mechanism in a live broadcast.
|
||||
// Run BootstrapVWAPPhase2.s.sol at least 60 seconds after this script completes.
|
||||
|
||||
console.log("\n=== Deployment Complete ===");
|
||||
console.log("Kraiken:", address(kraiken));
|
||||
|
|
@ -151,8 +148,11 @@ contract DeployBase is Script {
|
|||
console.log("LiquidityManager:", address(liquidityManager));
|
||||
console.log("Optimizer:", optimizerAddress);
|
||||
console.log("\nPost-deploy steps:");
|
||||
console.log(" 1. Fund LiquidityManager with operational ETH (VWAP already bootstrapped)");
|
||||
console.log(" 2. recenter() is now permissionless - any address (e.g. txnBot) can call it.");
|
||||
console.log(" 1. Wait >= 60 s after this script finishes.");
|
||||
console.log(" 2. Run: forge script script/BootstrapVWAPPhase2.s.sol --tc BootstrapVWAPPhase2 --fork-url <RPC> --broadcast");
|
||||
console.log(" This performs the second recenter that records cumulativeVolume > 0.");
|
||||
console.log(" 3. Fund LiquidityManager with operational ETH.");
|
||||
console.log(" 4. recenter() is permissionless - any address (e.g. txnBot) can call it.");
|
||||
|
||||
vm.stopBroadcast();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue