New answers tagged

0

On ERC20, all these functions emit the exact same event: event Transfer(address indexed _from, address indexed _to, uint256 _value); On ERC721, all these functions emit the exact same event: event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);


0

I solved my problem. Apparently the issue was with the IPC provider. I changed it to HttpProvider(path_to_local_node) and now it is working flawlessly on the ethereum node and returning logs as desired. I am posting the updated code: let web3 = new Web3(new Web3.providers.HttpProvider(nodeURL)); const params = { address: "...


1

You can solve this problem using Divide & Conquer strategy: async function getPastLogs(web3, address, topics, fromBlock, toBlock) { if (fromBlock <= toBlock) { try { return await web3.eth.getPastLogs({address, topics, fromBlock, toBlock}); } catch (error) { const midBlock = (fromBlock + toBlock) >&...


1

Not sure where exactly your problem is, but you can do the whole thing directly with web3 (instead of an HTTP request): const params = { address : "0x683f6e80c378e57fea188d53f4440600e87abc46", topics : ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"], fromBlock: 10394853, toBlock : 10399444 }; ...


0

OK, so the problem wasn't in my solidity code (although I made changes to arrive at a solution) but rather in the call I was making in the truffle console. my payOut function now looks like this: function payOut(uint amount) public { //check if players guess == randomNumber and pay pay out //if it does. if(player[msg.sender].guess != ...


1

From the ABI the event has two parameters that are indexed. The indexed parameters are not included in data field but in the topics array. "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "...


0

An ethereum log entry contains a list of topics. This list contains the contract address, event's signature and indexed parameters. If you want to filter events with your address then it has to be included in an event as an indexed parameter. For example standard ERC-20 tokens have the event event Transfer(address indexed _from, address indexed _to, ...


1

The command eth_getLogs returns transactions that generated a log entry. Ether transfers between regular accounts do not generate a log so they will not be included.


Top 50 recent answers are included