@@ -17,6 +17,7 @@ export const isContractDeployed = async (
17
17
address : string | undefined ,
18
18
addressBook : AddressBook ,
19
19
provider : providers . Provider ,
20
+ checkCreationCode = true ,
20
21
) : Promise < boolean > => {
21
22
logger . log ( `Checking for valid ${ name } contract...` )
22
23
if ( ! address || address === '' ) {
@@ -29,12 +30,15 @@ export const isContractDeployed = async (
29
30
// If the contract is behind a proxy we check the Proxy artifact instead
30
31
const artifact = addressEntry . proxy === true ? loadArtifact ( 'GraphProxy' ) : loadArtifact ( name )
31
32
32
- const savedCreationCodeHash = addressEntry . creationCodeHash
33
- const creationCodeHash = hash ( artifact . bytecode )
34
- if ( ! savedCreationCodeHash || savedCreationCodeHash !== creationCodeHash ) {
35
- logger . warn ( `creationCodeHash in our address book doesn't match ${ name } artifacts` )
36
- logger . log ( `${ savedCreationCodeHash } !== ${ creationCodeHash } ` )
37
- return false
33
+ if ( checkCreationCode ) {
34
+ const savedCreationCodeHash = addressEntry . creationCodeHash
35
+ console . log ( artifact . bytecode )
36
+ const creationCodeHash = hash ( artifact . bytecode )
37
+ if ( ! savedCreationCodeHash || savedCreationCodeHash !== creationCodeHash ) {
38
+ logger . warn ( `creationCodeHash in our address book doesn't match ${ name } artifacts` )
39
+ logger . log ( `${ savedCreationCodeHash } !== ${ creationCodeHash } ` )
40
+ return false
41
+ }
38
42
}
39
43
40
44
const savedRuntimeCodeHash = addressEntry . runtimeCodeHash
0 commit comments