Skip to content

Commit

Permalink
getDeploymentInfo docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BeroBurny committed Feb 5, 2024
1 parent 71ae1f0 commit 30b84b5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions packages/plugin/src/MultichainHardhatRuntimeEnvironmentField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export class MultichainHardhatRuntimeEnvironmentField {
* @returns A Promise resolving to a Transaction object.
*
* @example
* ```
* const networkArgs = {
* sepolia: {
* args: [ 18, "token" ],
Expand All @@ -74,7 +73,6 @@ export class MultichainHardhatRuntimeEnvironmentField {
* };
*
* this.hre.multichain.deployMultichain("HelloContract", networkArgs, options);
* ```
*/
public async deployMultichain<Abi extends ContractAbi = any>(
contractName: string,
Expand All @@ -101,7 +99,6 @@ export class MultichainHardhatRuntimeEnvironmentField {
* @returns A Promise resolving to a Transaction object.
*
* @example
* ```
* const contractBytecode = "0x60a060405234801561001057600080fd5b5060405161052b38038061052b83...";
* const contractAbi = [{ ... }, { ... }];
*
Expand All @@ -115,8 +112,7 @@ export class MultichainHardhatRuntimeEnvironmentField {
* salt: "0xcafe00000000000000000000000000000000000000000000000000000000cafe",
* };
*
* this.hre.multichain.deployMultichain(contractBytecode, contractAbi, networkArgs, options);
* ```
* this.hre.multichain.deployMultichainBytecode(contractBytecode, contractAbi, networkArgs, options);
*/
public async deployMultichainBytecode<Abi extends ContractAbi = any>(
contractBytecode: string,
Expand Down Expand Up @@ -217,6 +213,19 @@ export class MultichainHardhatRuntimeEnvironmentField {
};
}

/**
* Fetches and logs the deployment information for a smart contract deployed across multiple blockchain networks.
* This function retrieves the status of a contract's deployment on each specified network domain using the transaction hash
* obtained from the `deployMultichain` or `deployMultichainBytecode` function.
*
* @param transactionHash The hash of the transaction returned by `deployMultichain` or `deployMultichainBytecode`.
* @param domainIDs An array of bigint values representing the domain IDs on which the contract was deployed. These IDs correspond
* to the blockchain networks registered on Sygma and should match the ones used during the deployment process.
*
* @example
* const { transactionHash, domainIDs } = await this.hre.multichain.deployMultichain("HelloContract", networkArgs);
* await getDeploymentInfo(transactionHash, domainIDs);
*/
public async getDeploymentInfo(transactionHash: string, domainIDs: bigint[]): Promise<void> {
await Promise.all(
domainIDs.map(async (domainId, index): Promise<void> => {
Expand Down

0 comments on commit 30b84b5

Please sign in to comment.