0

Here's the contract events I want to pull from the ropsten network.

Here's how I constructed the event request

event_request =  ("https://api.etherscan.io/api?module=logs&action=getLogs"+
                 f"&fromBlock={from_block}"+
                 f"&toBlock={to_block}" +
                 f"&address{contract_address}"+
                 "&topic0=0xf63780e752c6a54a94fc52715dbc5518a3b4c3c2833d301a204226548a2a8545" +
                 f"&apikey={api}")
result = json.loads(http.request(event_request)[1].decode("utf-8"))

Which gives me valid results, but I don't see any of the transaction in the specified link. I think I'm spposed to change the topic0 value but not sure what to.

1

Running this (using web3.js v1.x):

const Web3 = require("web3");
console.log(Web3.utils.keccak256("Transfer(address,address,uint256)"));

Gives this:

0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
2
  • So are you saying that's the value topic0 should be assigned to? Mar 27 '20 at 5:52
  • 1
    @financial_physician: I wrote that very explicitly as far as I can tell. Mar 27 '20 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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