@openzeppelin/hardhat-upgrades
Version:
[](https://docs.openzeppelin.com/upgrades-plugins/hardhat-upgrades) [](https://www.npmjs.org/package/@openzeppelin/h
33 lines • 1.54 kB
TypeScript
import type { HardhatRuntimeEnvironment } from 'hardhat/types/hre';
import type { NetworkConnection } from 'hardhat/types/network';
import type { HardhatViemUpgrades } from './types.js';
/**
* Factory function to create the viem-based upgrades API for a given HRE.
*
* Requires the @nomicfoundation/hardhat-viem plugin to be registered in the Hardhat config,
* in addition to this plugin.
*
* @example
* ```typescript
* import { upgrades } from '@openzeppelin/hardhat-upgrades/viem';
*
* const connection = await hre.network.create();
* const api = await upgrades(hre, connection);
* const proxy = await api.deployProxy('MyContract', [42]);
* console.log(await proxy.read.myValue());
* ```
*
* @param hre - Hardhat Runtime Environment
* @param connection - Network connection from `await hre.network.create()`. Share one connection across operations; do not create a new one per call.
* @returns API object with all upgrade functions
*/
export declare function upgrades(hre: HardhatRuntimeEnvironment, connection: NetworkConnection): Promise<HardhatViemUpgrades>;
export { default } from '../plugin.js';
export { proxyFilesToBuild } from '../utils/npmFilesToBuild.js';
export type * from './types.js';
export type { ContractAddressOrInstance } from './utils.js';
export type * from './options.js';
export { upgradeableBeaconAbi } from './upgradeable-beacon.js';
export type { UpgradeableBeaconContract } from './upgradeable-beacon.js';
export type * from '@nomicfoundation/hardhat-viem';
//# sourceMappingURL=index.d.ts.map