0

"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~~

0

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?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.