dsa-connectors/scripts/deployment/deployConnector.ts
2021-12-26 18:38:47 +05:30

22 lines
611 B
TypeScript

import hre, { ethers } from "hardhat";
export const deployConnector = async (connectorName: string) => {
const Connector = await ethers.getContractFactory(connectorName);
const connector = await Connector.deploy();
await connector.deployed();
console.log(`${connectorName} Deployed: ${connector.address}`);
try {
await hre.run("verify:verify", {
address: connector.address,
constructorArguments: [],
});
} catch (error) {
console.log(`Failed to verify: ${connectorName}@${connector.address}`);
console.log(error);
console.log();
}
return connector.address;
};