import { HardhatRuntimeEnvironment } from "hardhat/types" ; import { DeployFunction } from "hardhat-deploy/types" ; import { ethers , upgrades } from "hardhat" ; import { BookKeeper__factory } from "../../../../typechain" ; import { ConfigEntity } from "../../../entities" ; const func = async function ( hre ) { const BOOK_KEEPER_ADDR = "" ; const config = ConfigEntity . getConfig ( ) ; console . log ( ">> Upgrading an upgradable BookKeeper contract" ) ; const BookKeeper = ( await ethers . getContractFactory ( "BookKeeper" , ( await ethers . getSigners ( ) ) [ 0 ] ) ) as BookKeeper__factory ; const bookKeeper = await upgrades . upgradeProxy ( BOOK_KEEPER_ADDR , BookKeeper ) ; await bookKeeper . deployed ( ) ; console . log ( `>> Upgrade at ${ bookKeeper . address }` ) ; const tx = await bookKeeper . deployTransaction . wait ( ) ; console . log ( `>> Upgrade block ${ tx . blockNumber }` ) ; } ; export default func ; func . tags = [ "UpgradeBookKeeper" ] ;