const { ethers, upgrades } = require("hardhat"); async function main() { console.log("⚠️ CHECKING UPGRADE STATUS ON SONIC MAINNET..."); const proxyAddress = "0xa26F8128Ecb2FF2FC5618498758cC82Cf1FDad5F"; const expectedOldImpl = "0x583E7643601d7FEA7969Ccc20f3138FC8598F8bB"; const possibleNewImpl = "0x7f974b5f7BCE61cD1D3091E1d06Ac5DF60e95917"; console.log("Proxy address:", proxyAddress); console.log("Expected old implementation:", expectedOldImpl); console.log("Possible new implementation:", possibleNewImpl); try { // Check current implementation const currentImpl = await upgrades.erc1967.getImplementationAddress(proxyAddress); console.log("Current implementation:", currentImpl); if (currentImpl.toLowerCase() === expectedOldImpl.toLowerCase()) { console.log("✅ NO UPGRADE OCCURRED - Still on old implementation"); } else if (currentImpl.toLowerCase() === possibleNewImpl.toLowerCase()) { console.log("❌ UPGRADE OCCURRED - Contract was upgraded on mainnet!"); } else { console.log("❓ UNKNOWN STATE - Implementation is neither old nor expected new"); } // Test the contract to see if new function exists const ContractFactory = await ethers.getContractFactory("PacaFinanceWithBoostAndScheduleUSDC"); const contract = ContractFactory.attach(proxyAddress); try { const testResult = await contract.testUpgradeFunction(); console.log("❌ testUpgradeFunction EXISTS - upgrade was deployed! Result:", testResult.toString()); } catch (error) { console.log("✅ testUpgradeFunction doesn't exist - no upgrade deployed"); } } catch (error) { console.error("Error checking status:", error.message); } } main() .then(() => process.exit(0)) .catch((error) => { console.error("Script error:", error); process.exit(1); });