fix: Use Optimizer (base) in deploy scripts — Push3 lacks initialize/getLiquidityParams
OptimizerV3Push3 is an equivalence-proof contract with only isBullMarket(). It cannot serve as an ERC1967Proxy implementation because it has no initialize() or getLiquidityParams(). The CI bootstrap was failing because the proxy deployment reverted when calling initialize() on the Push3 implementation. Switch deploy scripts to Optimizer.sol (the base UUPS contract) which has the full interface required by ERC1967Proxy and LiquidityManager. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e925538309
commit
99d9c563d6
4 changed files with 23 additions and 20 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
import "../src/OptimizerV3Push3.sol";
|
||||
import "../src/Optimizer.sol";
|
||||
import { UUPSUpgradeable } from "@openzeppelin/proxy/utils/UUPSUpgradeable.sol";
|
||||
import "forge-std/Script.sol";
|
||||
|
||||
|
|
@ -28,19 +28,22 @@ contract UpgradeOptimizer is Script {
|
|||
console.log("Proxy address:", proxyAddress);
|
||||
console.log("Admin (sender):", sender);
|
||||
|
||||
// Deploy new OptimizerV3Push3 implementation
|
||||
OptimizerV3Push3 newImpl = new OptimizerV3Push3();
|
||||
console.log("New OptimizerV3Push3 implementation:", address(newImpl));
|
||||
// Deploy new Optimizer implementation
|
||||
Optimizer newImpl = new Optimizer();
|
||||
console.log("New Optimizer implementation:", address(newImpl));
|
||||
|
||||
// Upgrade proxy to new implementation (no reinitialize needed — storage layout compatible)
|
||||
UUPSUpgradeable(proxyAddress).upgradeTo(address(newImpl));
|
||||
console.log("Proxy upgraded to OptimizerV3Push3");
|
||||
console.log("Proxy upgraded to Optimizer");
|
||||
|
||||
// Verify upgrade by calling isBullMarket through the proxy
|
||||
OptimizerV3Push3 upgraded = OptimizerV3Push3(proxyAddress);
|
||||
bool bull = upgraded.isBullMarket(0, 0);
|
||||
// Verify upgrade by calling getLiquidityParams through the proxy
|
||||
Optimizer upgraded = Optimizer(proxyAddress);
|
||||
(uint256 ci, uint256 as_, uint24 aw, uint256 dd) = upgraded.getLiquidityParams();
|
||||
console.log("\n=== Post-Upgrade Verification ===");
|
||||
console.log("isBullMarket(0,0):", bull);
|
||||
console.log("capitalInefficiency:", ci);
|
||||
console.log("anchorShare:", as_);
|
||||
console.log("anchorWidth:", uint256(aw));
|
||||
console.log("discoveryDepth:", dd);
|
||||
|
||||
vm.stopBroadcast();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue