11import { getCreate2Address , isAddress } from '@ethersproject/address'
22import { arrayify , hexZeroPad } from '@ethersproject/bytes'
3- import { Contract } from '@ethersproject/contracts'
3+ import { Contract , ContractReceipt } from '@ethersproject/contracts'
44import { keccak256 } from '@ethersproject/keccak256'
55import { defaultAbiCoder } from '@ethersproject/abi'
66import { verifyMessage } from '@ethersproject/wallet'
@@ -218,14 +218,14 @@ export class Contracts {
218218 return trAMB
219219 }
220220
221- async payForSignatureTransport ( tr : { events : any [ ] } , options : { pollingIntervalMs ?: number , retryTimeoutMs ?: number } = { } ) {
221+ async payForSignatureTransport ( tr : ContractReceipt , options : { pollingIntervalMs ?: number , retryTimeoutMs ?: number } = { } ) {
222222 const {
223223 pollingIntervalMs = 1000 ,
224224 retryTimeoutMs = 60000 ,
225225 } = options
226- log ( `Got receipt, filtering UserRequestForSignature from ${ tr . events . length } events...` )
226+ log ( `Got receipt, filtering UserRequestForSignature from ${ tr . events ! . length } events...` )
227227 // event UserRequestForSignature(bytes32 indexed messageId, bytes encodedData);
228- const sigEventArgsArray = tr . events . filter ( ( e : Todo ) => e . event === 'UserRequestForSignature' ) . map ( ( e : Todo ) => e . args )
228+ const sigEventArgsArray = tr . events ! . filter ( ( e : Todo ) => e . event === 'UserRequestForSignature' ) . map ( ( e : Todo ) => e . args )
229229 if ( sigEventArgsArray . length < 1 ) {
230230 throw new Error ( "No UserRequestForSignature events emitted from withdraw transaction, can't transport withdraw to mainnet" )
231231 }
@@ -309,7 +309,7 @@ export class Contracts {
309309 duName ,
310310 ethersOptions
311311 )
312- const tr = await tx . wait ( confirmations )
312+ await tx . wait ( confirmations )
313313
314314 log ( `Data Union "${ duName } " (mainnet: ${ duMainnetAddress } , sidechain: ${ duSidechainAddress } ) deployed to mainnet, waiting for side-chain...` )
315315 await until (
@@ -320,8 +320,6 @@ export class Contracts {
320320
321321 const dataUnion = new Contract ( duMainnetAddress , dataUnionMainnetABI , mainnetWallet )
322322 // @ts -expect-error
323- dataUnion . deployTxReceipt = tr
324- // @ts -expect-error
325323 dataUnion . sidechain = new Contract ( duSidechainAddress , dataUnionSidechainABI , sidechainProvider )
326324 return dataUnion
327325
0 commit comments