Commit before cuna

This commit is contained in:
2025-09-04 02:48:34 +02:00
parent 7e55515063
commit 8ef7f0b9f1
32 changed files with 4668 additions and 17 deletions

43
scripts/importBscProxy.js Normal file
View File

@@ -0,0 +1,43 @@
const { ethers, upgrades } = require("hardhat");
const path = require("path");
require('dotenv').config({ path: path.join(__dirname, '..', '.env') });
async function main() {
const privateKey = process.env.PRIVATE_KEY;
const network = await hre.network.name;
let deployer;
if (network === "hardhat" || network === "localhost") {
[deployer] = await ethers.getSigners();
console.log(`Using default hardhat account: ${deployer.address}`);
} else {
const wallet = new ethers.Wallet(privateKey, ethers.provider);
deployer = wallet.connect(ethers.provider);
console.log(`Using private key for account: ${deployer.address}`);
}
// Get BSC proxy address from env
const proxyAddress = process.env.PROXY_ADDRESS_BSC;
if (!proxyAddress) {
console.error("PROXY_ADDRESS_BSC not found in .env file");
process.exit(1);
}
console.log(`Importing BSC proxy at: ${proxyAddress}`);
// Get the current implementation contract factory
const Paca = await ethers.getContractFactory("PacaFinanceWithBoostAndScheduleBsc", deployer);
// Force import the proxy to fix artifacts
console.log("Force importing proxy...");
await upgrades.forceImport(proxyAddress, Paca);
console.log("✅ BSC proxy imported successfully!");
console.log("You can now delete this script and run normal upgrades.");
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});