1

"getPastLogs" can get past event log. I check the web3 documentation:

fromBlock - Number|String: The number of the earliest block ("latest" may be given to mean the most recent and "pending" currently mining, block). By default "latest".
toBlock - Number|String: The number of the latest block ("latest" may be given to mean the most recent and "pending" currently mining, block). By default "latest".
address - String|Array: An address or a list of addresses to only get logs from particular account(s).
topics - Array: An array of values which must each appear in the log entries. The order is important, if you want to leave topics out use null, e.g. [null, '0x12...']. You can also pass an array for each topic with options for that topic e.g. [null, ['option1', 'option2']]

Q1:What does 'address' means?Is it the contract's address or default account ?

Q2:What do 'topics' mean? How do I setup the array? Thanks~~

黃智祥
  • 465
  • 6
  • 16

1 Answers1

1

I can only answer one question for you unfortunately but I will link you the answer for question 2 below.

Q1 answer: address means any address on Ethereum (your account or any contract/person address) as mentioned on the documentation page.

Q2 answer: What are event topics?