hardhat-deploy
Advanced tools
Comparing version 0.12.1 to 0.12.2
@@ -1,6 +0,6 @@ | ||
import { TransactionRequest, TransactionResponse } from '@ethersproject/providers'; | ||
import { TransactionReceipt, TransactionRequest, TransactionResponse } from '@ethersproject/providers'; | ||
import { PayableOverrides, Signer } from 'ethers'; | ||
import { Artifact } from 'hardhat/types'; | ||
import * as zk from 'zksync-ethers'; | ||
import { Address, ExtendedArtifact } from '../types'; | ||
import { Address, DeployOptions, ExtendedArtifact } from '../types'; | ||
export declare class DeploymentFactory { | ||
@@ -20,3 +20,4 @@ private factory; | ||
compareDeploymentTransaction(transaction: TransactionResponse): Promise<boolean>; | ||
getDeployedAddress(receipt: TransactionReceipt, options: DeployOptions, create2Address: string | undefined): string; | ||
} | ||
//# sourceMappingURL=DeploymentFactory.d.ts.map |
@@ -106,4 +106,14 @@ "use strict"; | ||
} | ||
getDeployedAddress(receipt, options, create2Address) { | ||
if (options.deterministicDeployment && create2Address) { | ||
return create2Address; | ||
} | ||
if (this.isZkSync) { | ||
const deployedAddresses = zk.utils.getDeployedContracts(receipt).map((info) => info.deployedAddress); | ||
return deployedAddresses[deployedAddresses.length - 1]; | ||
} | ||
return receipt.contractAddress; | ||
} | ||
} | ||
exports.DeploymentFactory = DeploymentFactory; | ||
//# sourceMappingURL=DeploymentFactory.js.map |
{ | ||
"name": "hardhat-deploy", | ||
"version": "0.12.1", | ||
"version": "0.12.2", | ||
"description": "Hardhat Plugin For Replicable Deployments And Tests", | ||
@@ -5,0 +5,0 @@ "repository": "github:wighawag/hardhat-deploy", |
import { | ||
TransactionReceipt, | ||
TransactionRequest, | ||
TransactionResponse, | ||
} from '@ethersproject/providers'; | ||
import {ContractFactory, PayableOverrides, Signer} from 'ethers'; | ||
import {Artifact} from 'hardhat/types'; | ||
import { ContractFactory, PayableOverrides, Signer, ethers } from 'ethers'; | ||
import { Artifact } from 'hardhat/types'; | ||
import * as zk from 'zksync-ethers'; | ||
import {Address, ExtendedArtifact} from '../types'; | ||
import {getAddress} from '@ethersproject/address'; | ||
import {keccak256 as solidityKeccak256} from '@ethersproject/solidity'; | ||
import {hexConcat} from '@ethersproject/bytes'; | ||
import { Address, DeployOptions, ExtendedArtifact } from '../types'; | ||
import { getAddress } from '@ethersproject/address'; | ||
import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity'; | ||
import { hexConcat } from '@ethersproject/bytes'; | ||
@@ -98,10 +99,10 @@ export class DeploymentFactory { | ||
'0x' + | ||
solidityKeccak256( | ||
['bytes'], | ||
[ | ||
`0xff${create2DeployerAddress.slice(2)}${salt.slice( | ||
2 | ||
)}${solidityKeccak256(['bytes'], [deploymentTx.data]).slice(2)}`, | ||
] | ||
).slice(-40) | ||
solidityKeccak256( | ||
['bytes'], | ||
[ | ||
`0xff${create2DeployerAddress.slice(2)}${salt.slice( | ||
2 | ||
)}${solidityKeccak256(['bytes'], [deploymentTx.data]).slice(2)}`, | ||
] | ||
).slice(-40) | ||
); | ||
@@ -155,2 +156,22 @@ } | ||
} | ||
getDeployedAddress( | ||
receipt: TransactionReceipt, | ||
options: DeployOptions, | ||
create2Address: string | undefined | ||
): string { | ||
if (options.deterministicDeployment && create2Address) { | ||
return create2Address; | ||
} | ||
if (this.isZkSync) { | ||
const deployedAddresses = zk.utils.getDeployedContracts(receipt).map( | ||
(info) => info.deployedAddress, | ||
); | ||
return deployedAddresses[deployedAddresses.length - 1]; | ||
} | ||
return receipt.contractAddress; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11889897
164448
1533