diff --git a/src/RelayServer.ts b/src/RelayServer.ts index 127965b..0dceabc 100644 --- a/src/RelayServer.ts +++ b/src/RelayServer.ts @@ -341,7 +341,7 @@ export class RelayServer extends EventEmitter { tokenContract != constants.AddressZero ) { verifierContract = IDeployVerifier__factory.connect(verifier, provider); - } else { + } else if (!isDeployTransaction(envelopingTransaction)) { verifierContract = IRelayVerifier__factory.connect(verifier, provider); } } catch (e) { @@ -361,23 +361,26 @@ export class RelayServer extends EventEmitter { try { let verifyMethod: PopulatedTransaction; - if (isDeployTransaction(envelopingTransaction)) { + if ( + isDeployTransaction(envelopingTransaction) && + tokenContract != constants.AddressZero + ) { verifyMethod = await ( - verifierContract as IDeployVerifier + verifierContract! as IDeployVerifier ).populateTransaction.verifyRelayedCall( envelopingTransaction.relayRequest, envelopingTransaction.metadata.signature, { from: this.workerAddress } ); - } else { + } else if (!isDeployTransaction(envelopingTransaction)) { verifyMethod = await ( - verifierContract as IRelayVerifier + verifierContract! as IRelayVerifier ).populateTransaction.verifyRelayedCall( envelopingTransaction.relayRequest as RelayRequest, envelopingTransaction.metadata.signature ); } - await provider.call(verifyMethod, 'pending'); + await provider.call(verifyMethod!, 'pending'); } catch (e) { const error = e as Error; throw new Error(`Verification by verifier failed: ${error.message}`);