feat: deployment scripts, E2E tests, and documentation
- DeployBase: shared deployment logic with OptimizerV3 UUPS proxy - DeployBaseMainnet: Base mainnet configuration (feeDest, WETH, factory) - DeployLocal: local Anvil deployment with OptimizerV3 - UpgradeOptimizer: UUPS upgrade script for existing proxy - DEPLOYMENT_RUNBOOK: step-by-step mainnet deployment guide - E2E tests: recenter position verification, optimizer integration - Landing page: updated docs for OptimizerV3 and protocol changes - Remove dead DeployScript2.sol Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
85350caf52
commit
d64b63aff4
6 changed files with 70 additions and 52 deletions
50
onchain/script/UpgradeOptimizer.sol
Normal file
50
onchain/script/UpgradeOptimizer.sol
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
import "../src/OptimizerV3.sol";
|
||||
import { UUPSUpgradeable } from "@openzeppelin/proxy/utils/UUPSUpgradeable.sol";
|
||||
import "forge-std/Script.sol";
|
||||
|
||||
/**
|
||||
* @title UpgradeOptimizer
|
||||
* @notice Upgrades an existing Optimizer UUPS proxy to OptimizerV3 implementation.
|
||||
* @dev Usage:
|
||||
* OPTIMIZER_PROXY=0x... forge script script/UpgradeOptimizer.sol \
|
||||
* --rpc-url <RPC_URL> --broadcast
|
||||
*
|
||||
* The caller must be the proxy admin (the address that called initialize()).
|
||||
*/
|
||||
contract UpgradeOptimizer is Script {
|
||||
function run() public {
|
||||
address proxyAddress = vm.envAddress("OPTIMIZER_PROXY");
|
||||
require(proxyAddress != address(0), "OPTIMIZER_PROXY env var required");
|
||||
|
||||
string memory seedPhrase = vm.readFile(".secret");
|
||||
uint256 privateKey = vm.deriveKey(seedPhrase, 0);
|
||||
vm.startBroadcast(privateKey);
|
||||
address sender = vm.addr(privateKey);
|
||||
|
||||
console.log("\n=== Optimizer UUPS Upgrade ===");
|
||||
console.log("Proxy address:", proxyAddress);
|
||||
console.log("Admin (sender):", sender);
|
||||
|
||||
// Deploy new OptimizerV3 implementation
|
||||
OptimizerV3 newImpl = new OptimizerV3();
|
||||
console.log("New OptimizerV3 implementation:", address(newImpl));
|
||||
|
||||
// Upgrade proxy to new implementation (no reinitialize needed — storage layout compatible)
|
||||
UUPSUpgradeable(proxyAddress).upgradeTo(address(newImpl));
|
||||
console.log("Proxy upgraded to OptimizerV3");
|
||||
|
||||
// Verify upgrade by calling getLiquidityParams through the proxy
|
||||
OptimizerV3 upgraded = OptimizerV3(proxyAddress);
|
||||
(uint256 ci, uint256 as_, uint24 aw, uint256 dd) = upgraded.getLiquidityParams();
|
||||
console.log("\n=== Post-Upgrade Verification ===");
|
||||
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