mirror of openzeppelin-contracts
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.
 
 
 
 
 
openzeppelin-contracts/test/helpers/deploy.js

14 lines
482 B

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,
};