Skip to content

Commit d62a045

Browse files
authored
Chore(lazer) deploy polynomial (#2888)
* chore(lazer) Deploy Polynomial * update
1 parent 8518f90 commit d62a045

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

contract_manager/scripts/update_all_pricefeeds.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ async function main() {
7575
),
7676
),
7777
);
78+
// Wait for 2 seconds to avoid rate limiting and nonce collision
79+
await new Promise((resolve) => setTimeout(resolve, 2000));
7880
}
7981
}
8082

contract_manager/store/chains/EvmChains.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@
749749
{
750750
"id": "polynomial_testnet",
751751
"mainnet": false,
752-
"rpcUrl": "https://rpc-polynomial-network-testnet-x0tryg8u1c.t.conduit.xyz",
752+
"rpcUrl": "https://rpc.sepolia.polynomial.fi",
753753
"networkId": 80008,
754754
"type": "EvmChain"
755755
},

contract_manager/store/contracts/EvmExecutorContracts.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,15 @@
198198
"chain": "ethereal_testnet",
199199
"address": "0xD458261E832415CFd3BAE5E416FdF3230ce6F134",
200200
"type": "EvmExecutorContract"
201+
},
202+
{
203+
"chain": "polynomial_testnet",
204+
"address": "0xf0a1b566B55e0A0CB5BeF52Eb2a57142617Bee67",
205+
"type": "EvmExecutorContract"
206+
},
207+
{
208+
"chain": "polynomial",
209+
"address": "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509",
210+
"type": "EvmExecutorContract"
201211
}
202-
]
212+
]
Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,65 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity ^0.8.13;
33

4+
// --- Script Purpose ---
5+
// This script transfers ownership of the deployed PythLazer contract (proxy) to a new owner contract (typically the governance executor contract).
6+
// Usage: Run this script after deploying the new executor contract on the target chain. Ensure the executor address is correct and deployed.
7+
// Preconditions:
8+
// - The LAZER_PROXY_ADDRESS must point to the deployed PythLazer proxy contract. Currently set to 0xACeA761c27A909d4D3895128EBe6370FDE2dF481, which was made using createX.
9+
// - The NEW_OWNER must be the deployed executor contract address on this chain.
10+
// - The script must be run by the current owner (OLD_OWNER) of the PythLazer contract.
11+
// - The DEPLOYER_PRIVATE_KEY environment variable must be set to the current owner's private key.
12+
//
13+
// Steps:
14+
// 1. Log current and new owner addresses, and the proxy address.
15+
// 2. Check the current owner matches the expected OLD_OWNER.
16+
// 3. Transfer ownership to the NEW_OWNER (executor contract).
17+
// 4. Log the new owner for verification.
18+
//
19+
// Note: This script is intended for use with Foundry (forge-std) tooling.
20+
421
import {Script, console} from "forge-std/Script.sol";
522
import {PythLazer} from "../src/PythLazer.sol";
623
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
724
import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
825

26+
// Main script contract for ownership transfer
927
contract PythLazerChangeOwnership is Script {
28+
// Address of the deployed PythLazer proxy contract
1029
address public constant LAZER_PROXY_ADDRESS =
1130
address(0xACeA761c27A909d4D3895128EBe6370FDE2dF481);
1231

32+
// Private key of the current owner, loaded from environment variable
1333
uint256 public OLD_OWNER_PRIVATE_KEY = vm.envUint("DEPLOYER_PRIVATE_KEY");
34+
// Current owner address, derived from private key
1435
address public OLD_OWNER = vm.addr(OLD_OWNER_PRIVATE_KEY);
15-
// EVM Executor Contract
36+
// Address of the new owner (should be the deployed executor contract)
1637
address public NEW_OWNER = vm.envAddress("NEW_OWNER");
1738

39+
// Entry point for the script
1840
function run() public {
41+
// Log relevant addresses for traceability
1942
console.log("Old owner: %s", OLD_OWNER);
2043
console.log("New owner: %s", NEW_OWNER);
2144
console.log("Lazer proxy address: %s", LAZER_PROXY_ADDRESS);
2245
console.log("Lazer owner: %s", PythLazer(LAZER_PROXY_ADDRESS).owner());
2346
console.log("Moving ownership from %s to %s", OLD_OWNER, NEW_OWNER);
2447

48+
// Get the PythLazer contract instance at the proxy address
2549
PythLazer lazer = PythLazer(LAZER_PROXY_ADDRESS);
50+
// Start broadcasting transactions as the old owner
2651
vm.startBroadcast(OLD_OWNER_PRIVATE_KEY);
52+
// Ensure the current owner matches the expected old owner
2753
require(lazer.owner() == OLD_OWNER, "Old owner mismatch");
54+
// Transfer ownership to the new owner (executor contract)
2855
lazer.transferOwnership(NEW_OWNER);
2956
console.log("Ownership transferred");
57+
// Log the new owner for verification
3058
console.log(
3159
"New Lazer owner: %s",
3260
PythLazer(LAZER_PROXY_ADDRESS).owner()
3361
);
62+
// Stop broadcasting
3463
vm.stopBroadcast();
3564
}
3665
}

0 commit comments

Comments
 (0)