@openzeppelin/hardhat-upgrades
Version:
[](https://docs.openzeppelin.com/upgrades-plugins/hardhat-upgrades) [](https://www.npmjs.org/package/@openzeppelin/h
18 lines • 911 B
JavaScript
import { deployUpgradeableImpl } from './engine/deploy-impl.js';
import { enableDefender } from './defender/utils.js';
import { makeEthersBinding, contractInfo, txResponseOf } from './ethers-binding.js';
export function makeDeployImplementation(hre, defenderModule, connection) {
return async function deployImplementation(ImplFactory, opts = {}) {
opts = enableDefender(hre, defenderModule, opts);
const binding = makeEthersBinding(hre, connection, ImplFactory.runner, opts);
const deployedImpl = await deployUpgradeableImpl(binding, contractInfo(ImplFactory), opts, undefined);
if (opts.getTxResponse) {
const txResponse = await txResponseOf(deployedImpl.deployment, connection);
if (txResponse) {
return txResponse;
}
}
return deployedImpl.impl;
};
}
//# sourceMappingURL=deploy-implementation.js.map