(artifactsFolderPath: string, args: any[] = [], chain = SameOrCrossChain.same)
| 96 | * @returns The deployed contract |
| 97 | */ |
| 98 | export const deployContract = async (artifactsFolderPath: string, args: any[] = [], chain = SameOrCrossChain.same) => { |
| 99 | const artifact = getArtifact(artifactsFolderPath); |
| 100 | |
| 101 | // Deploy the contract |
| 102 | const contractFactory = new ethers.ContractFactory(artifact.abi, artifact.bytecode, await getUserWallet(chain)); |
| 103 | const contract = await contractFactory.deploy(...args); |
| 104 | await contract.deployed(); |
| 105 | |
| 106 | writeAddressToDeploymentsFile(artifactsFolderPath, contract.address, chain); |
| 107 | |
| 108 | return contract; |
| 109 | }; |
| 110 | |
| 111 | /** |
| 112 | * Connect to the already deployed contract specified by the path to the compiled contract artifact. |
no test coverage detected