LIT-Protocol / Issues-and-Reports

For bug reports, feature requests, and implementation questions related to Lit Protocol and use of the Lit SDK.
0 stars 0 forks source link

[Discord] Cannot read properties of undefined (reading 'topics') #32

Closed spacesailor24 closed 2 weeks ago

spacesailor24 commented 5 months ago

Description of the issue

Using lit v5 and trying on sepolia, manzano

Code looks like this

const authMethod = {
    authMethodType: AuthMethodType.EthWallet,
    accessToken: JSON.stringify(authSig)
  };

const mintInfo = await contractClient.mintWithAuth({
    authMethod: authMethod,
    scopes: [
      AuthMethodScope.SignAnything
    ]
  });

Failed with error "Cannot read properties of undefined (reading 'topics')"

because both logs/events is empty in the txn (and we should check againsts if(events?.length>0) not if(events) https://sepolia.etherscan.io/tx/0xa08e9fb43c3990e339f3df4146971bcf38d1817bb7766cdc4adc411b7c55d703

{
  to: '0x24d646b9510e56af8B15de759331d897C4d66044',
  from: '0xba028B99e84AE2374A8AC57050c4343e8213444b',
  contractAddress: null,
  transactionIndex: 46,
  gasUsed: BigNumber { _hex: '0x5eb8', _isBigNumber: true },
  logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  blockHash: '0x5966a9175efdec1df4c0b57cb0689c1d0aa22f3cfd333cb4ac0dbda586287ab5',
  transactionHash: '0xa08e9fb43c3990e339f3df4146971bcf38d1817bb7766cdc4adc411b7c55d703',
  logs: [],
  blockNumber: 5836658,
  confirmations: 1,
  cumulativeGasUsed: BigNumber { _hex: '0x727c59', _isBigNumber: true },
  effectiveGasPrice: BigNumber { _hex: '0x07a8d0b6c0', _isBigNumber: true },
  status: 1,
  type: 2,
  byzantium: true,
  events: []
}

Additional context

No response

spacesailor24 commented 5 months ago

Are you getting the "Cannot read properties of undefined (reading 'topics')" error when you execute the Lit code, or do you have code that's attempting to parse log topics from your mintInfo?

debuggingfuture commented 5 months ago

no longer hv the stacktrace, while the error is throw from here

https://github.com/LIT-Protocol/js-sdk/blob/master/packages/contracts-sdk/src/lib/contracts-sdk.ts#L1057

joshLong145 commented 5 months ago

@debuggingfuture I was looking into your error and from the looks of your transaction hash you are using some contract deployment on sepolia which we do not use for our contracts. Would you be able to supply some source code that shows how you are using the contracts-sdk from the transaction hash you have supplied which i am adding again below

{
  to: '0x24d646b9510e56af8B15de759331d897C4d66044',
  from: '0xba028B99e84AE2374A8AC57050c4343e8213444b',
  contractAddress: null,
  transactionIndex: 46,
  gasUsed: BigNumber { _hex: '0x5eb8', _isBigNumber: true },
  logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
  blockHash: '0x5966a9175efdec1df4c0b57cb0689c1d0aa22f3cfd333cb4ac0dbda586287ab5',
  transactionHash: '0xa08e9fb43c3990e339f3df4146971bcf38d1817bb7766cdc4adc411b7c55d703',
  logs: [],
  blockNumber: 5836658,
  confirmations: 1,
  cumulativeGasUsed: BigNumber { _hex: '0x727c59', _isBigNumber: true },
  effectiveGasPrice: BigNumber { _hex: '0x07a8d0b6c0', _isBigNumber: true },
  status: 1,
  type: 2,
  byzantium: true,
  events: []
}

this does not look to be using the contracts we have deployed for our networks on chronicle which is our own L2. When attempting to look up your tx hash on our chain there is no record of this transaction. If there are no events within your tx receipt we are unable to move forward with the rest of the functionality implemented in mintWithAuth as we can not look up your pkp information.