From de037f51a606562702106c66da138e3634692bcc Mon Sep 17 00:00:00 2001 From: Aditya Arora Date: Wed, 23 Jul 2025 13:51:05 -0400 Subject: [PATCH 1/2] chore(lazer) Deploy Polynomial --- .../scripts/update_all_pricefeeds.ts | 2 ++ contract_manager/store/chains/EvmChains.json | 2 +- .../store/contracts/EvmExecutorContracts.json | 10 ++++++ .../evm/script/PythLazerChangeOwnership.s.sol | 31 ++++++++++++++++++- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/contract_manager/scripts/update_all_pricefeeds.ts b/contract_manager/scripts/update_all_pricefeeds.ts index fcfe4e7b22..f28b88a208 100644 --- a/contract_manager/scripts/update_all_pricefeeds.ts +++ b/contract_manager/scripts/update_all_pricefeeds.ts @@ -75,6 +75,8 @@ async function main() { ), ), ); + // Wait for 2 seconds to avoid rate limiting and nonce collision + await new Promise((resolve) => setTimeout(resolve, 2000)); } } diff --git a/contract_manager/store/chains/EvmChains.json b/contract_manager/store/chains/EvmChains.json index 1d82100973..d79ae960e3 100644 --- a/contract_manager/store/chains/EvmChains.json +++ b/contract_manager/store/chains/EvmChains.json @@ -749,7 +749,7 @@ { "id": "polynomial_testnet", "mainnet": false, - "rpcUrl": "https://rpc-polynomial-network-testnet-x0tryg8u1c.t.conduit.xyz", + "rpcUrl": "https://rpc.sepolia.polynomial.fi", "networkId": 80008, "type": "EvmChain" }, diff --git a/contract_manager/store/contracts/EvmExecutorContracts.json b/contract_manager/store/contracts/EvmExecutorContracts.json index 57023ef3d8..48dcf467d6 100644 --- a/contract_manager/store/contracts/EvmExecutorContracts.json +++ b/contract_manager/store/contracts/EvmExecutorContracts.json @@ -198,5 +198,15 @@ "chain": "ethereal_testnet", "address": "0xD458261E832415CFd3BAE5E416FdF3230ce6F134", "type": "EvmExecutorContract" + }, + { + "chain": "polynomial_testnet", + "address": "0xf0a1b566B55e0A0CB5BeF52Eb2a57142617Bee67", + "type": "EvmExecutorContract" + }, + { + "chain": "polynomial", + "address": "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509", + "type": "EvmExecutorContract" } ] \ No newline at end of file diff --git a/lazer/contracts/evm/script/PythLazerChangeOwnership.s.sol b/lazer/contracts/evm/script/PythLazerChangeOwnership.s.sol index 62bb1b7410..b9dcbc7773 100644 --- a/lazer/contracts/evm/script/PythLazerChangeOwnership.s.sol +++ b/lazer/contracts/evm/script/PythLazerChangeOwnership.s.sol @@ -1,36 +1,65 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.13; +// --- Script Purpose --- +// This script transfers ownership of the deployed PythLazer contract (proxy) to a new owner contract (typically the governance executor contract). +// Usage: Run this script after deploying the new executor contract on the target chain. Ensure the executor address is correct and deployed. +// Preconditions: +// - The LAZER_PROXY_ADDRESS must point to the deployed PythLazer proxy contract. Currently set to 0xACeA761c27A909d4D3895128EBe6370FDE2dF481, which was made using createX. +// - The NEW_OWNER must be the deployed executor contract address on this chain. +// - The script must be run by the current owner (OLD_OWNER) of the PythLazer contract. +// - The DEPLOYER_PRIVATE_KEY environment variable must be set to the current owner's private key. +// +// Steps: +// 1. Log current and new owner addresses, and the proxy address. +// 2. Check the current owner matches the expected OLD_OWNER. +// 3. Transfer ownership to the NEW_OWNER (executor contract). +// 4. Log the new owner for verification. +// +// Note: This script is intended for use with Foundry (forge-std) tooling. + import {Script, console} from "forge-std/Script.sol"; import {PythLazer} from "../src/PythLazer.sol"; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; +// Main script contract for ownership transfer contract PythLazerChangeOwnership is Script { + // Address of the deployed PythLazer proxy contract address public constant LAZER_PROXY_ADDRESS = address(0xACeA761c27A909d4D3895128EBe6370FDE2dF481); + // Private key of the current owner, loaded from environment variable uint256 public OLD_OWNER_PRIVATE_KEY = vm.envUint("DEPLOYER_PRIVATE_KEY"); + // Current owner address, derived from private key address public OLD_OWNER = vm.addr(OLD_OWNER_PRIVATE_KEY); - // EVM Executor Contract + // Address of the new owner (should be the deployed executor contract) address public NEW_OWNER = vm.envAddress("NEW_OWNER"); + // Entry point for the script function run() public { + // Log relevant addresses for traceability console.log("Old owner: %s", OLD_OWNER); console.log("New owner: %s", NEW_OWNER); console.log("Lazer proxy address: %s", LAZER_PROXY_ADDRESS); console.log("Lazer owner: %s", PythLazer(LAZER_PROXY_ADDRESS).owner()); console.log("Moving ownership from %s to %s", OLD_OWNER, NEW_OWNER); + // Get the PythLazer contract instance at the proxy address PythLazer lazer = PythLazer(LAZER_PROXY_ADDRESS); + // Start broadcasting transactions as the old owner vm.startBroadcast(OLD_OWNER_PRIVATE_KEY); + // Ensure the current owner matches the expected old owner require(lazer.owner() == OLD_OWNER, "Old owner mismatch"); + // Transfer ownership to the new owner (executor contract) lazer.transferOwnership(NEW_OWNER); console.log("Ownership transferred"); + // Log the new owner for verification console.log( "New Lazer owner: %s", PythLazer(LAZER_PROXY_ADDRESS).owner() ); + // Stop broadcasting vm.stopBroadcast(); } } From e1c8542fe61b649b11f634425c0b3d1f195ffb68 Mon Sep 17 00:00:00 2001 From: Aditya Arora Date: Wed, 23 Jul 2025 13:52:49 -0400 Subject: [PATCH 2/2] update --- contract_manager/store/contracts/EvmExecutorContracts.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract_manager/store/contracts/EvmExecutorContracts.json b/contract_manager/store/contracts/EvmExecutorContracts.json index 48dcf467d6..0de09ccf4c 100644 --- a/contract_manager/store/contracts/EvmExecutorContracts.json +++ b/contract_manager/store/contracts/EvmExecutorContracts.json @@ -209,4 +209,4 @@ "address": "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509", "type": "EvmExecutorContract" } -] \ No newline at end of file +]