Skip to content

Chore(lazer) deploy polynomial #2888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions contract_manager/scripts/update_all_pricefeeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
2 changes: 1 addition & 1 deletion contract_manager/store/chains/EvmChains.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
12 changes: 11 additions & 1 deletion contract_manager/store/contracts/EvmExecutorContracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,15 @@
"chain": "ethereal_testnet",
"address": "0xD458261E832415CFd3BAE5E416FdF3230ce6F134",
"type": "EvmExecutorContract"
},
{
"chain": "polynomial_testnet",
"address": "0xf0a1b566B55e0A0CB5BeF52Eb2a57142617Bee67",
"type": "EvmExecutorContract"
},
{
"chain": "polynomial",
"address": "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
"type": "EvmExecutorContract"
}
]
]
31 changes: 30 additions & 1 deletion lazer/contracts/evm/script/PythLazerChangeOwnership.s.sol
Original file line number Diff line number Diff line change
@@ -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();
}
}
Loading