MCPcopy Create free account
hub / github.com/api3dao/airnode / deployContract

Function deployContract

packages/airnode-examples/src/evm.ts:98–109  ·  view source on GitHub ↗
(artifactsFolderPath: string, args: any[] = [], chain = SameOrCrossChain.same)

Source from the content-addressed store, hash-verified

96 * @returns The deployed contract
97 */
98export 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.

Callers 4

mainFunction · 0.90
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

getArtifactFunction · 0.85
getUserWalletFunction · 0.85

Tested by

no test coverage detected