You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
482 B
15 lines
482 B
8 months ago
|
const { artifacts, ethers } = require('hardhat');
|
||
|
const { setCode } = require('@nomicfoundation/hardhat-network-helpers');
|
||
|
const { generators } = require('./random');
|
||
|
|
||
|
const forceDeployCode = (name, address = generators.address(), runner = ethers.provider) =>
|
||
|
artifacts
|
||
|
.readArtifact(name)
|
||
|
.then(({ abi, deployedBytecode }) =>
|
||
|
setCode(address, deployedBytecode).then(() => new ethers.Contract(address, abi, runner)),
|
||
|
);
|
||
|
|
||
|
module.exports = {
|
||
|
forceDeployCode,
|
||
|
};
|