Linked Questions

2 votes
1 answer
4k views

What does "Topics" mean in "Event log"? [duplicate]

When we invoke an event as follows : event MyEvent(uint256 indexed _id, bytes32 _action, bytes32 _player, bytes32 _actionState, address _owner); emit MyEvent(uint256(_public_id), bytes32(_action), ...
user avatar
  • 2,508
31 votes
8 answers
74k views

How to get transactions by account using web3 js?

I'm sure this question was asked before, but I did not find any result that helped my problem. How can I get the transactions (in and out) for a given account? I use nodejs and web3? With this line ...
user avatar
53 votes
3 answers
37k views

What is an Event?

What is an Event? Are they only used in Solidity? How are events defined? How are events initiated? Is there a standard term for an event's invocation (do you say an event "happened", "was called",...
user avatar
  • 7,924
3 votes
1 answer
4k views

myContract.events.MyEvent() vs web3.eth.subscribe('logs', ...);

I'm confused about the difference between myContract.events.MyEvent() and web3.eth.subscribe('logs', ...); Both are subscriptions to events, correct?
user avatar
2 votes
2 answers
4k views

Can I get the return value of a .call from a contract from the Blockchain?

I know that if I use call from a contract, that I cannot get the return value. I get a true or a false. Is it possible for me to inspect the blockchain afterwords to get the return value? For ...
user avatar
3 votes
2 answers
2k views

What is in return when listening to an event?

In Hellos.sol, there is event initContract after constructor is called. Here is the solidity code: pragma solidity 0.7.0; contract Hello { address owner; uint256 value; event ...
user avatar
1 vote
1 answer
1k views

About getPastLogs usage

"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" ...
user avatar
  • 435
1 vote
1 answer
698 views

How to get the output of a function transaction using web3.py

I have a smart contract that deploys another smart contract and returns the address of the deployed smart contract. The code for the smart contract looks like this- contract ContractCreator { ...
user avatar
2 votes
1 answer
440 views

Using Event API of Ropsten

I wanted to get the details of the following transaction hash : https://ropsten.etherscan.io/tx/0x8b43cf5e2c9d4eabb1121036de3d60354f64e9ccc6004caccba0e478c50ed2e6. And Ropsten has got an API to get ...
user avatar
1 vote
2 answers
296 views

Is it possible to subscribe to the same event, but in multiple contracts at the same time?

Let's say we have 1000 contracts with the same type of event 'Event'. I can subscribe to each one of them individually using contract.listen('Event'), but I cannot use this if I want to create a ...
user avatar
  • 379
1 vote
0 answers
343 views

How to fix TypeError: 'xxx' is not a function

I have a project is to listen event of one deployed contract. Now I' m using BNB for testing. Here is my code: var Web3 = require("web3"); var fs = require("fs"); web3 = new Web3(new Web3.providers....
user avatar
0 votes
1 answer
159 views

Who is "from" in case of inheritance in solidity?

I have the following code: // Test.sol pragma solidity ^0.5.2; import "./TestBase.sol"; contract Test is TestBase{ string[] name ; constructor() public payable { name.push("sheep"); ...
user avatar
  • 133
0 votes
1 answer
97 views

How do I check the tx/blocks associated with a smart contract?

I'm trying to get the txs associated with a smart contract to read tx by tx. I only found one way to do it so far: (web3.py) first_block = 13123500 block = 13401564 # all the blocks of the contract ...
user avatar
1 vote
1 answer
33 views

Can a pruned node do contract.getPastEvents("Transfer", { fromBlock: startBlock})

Is it possible for a pruned Ethereum node to return data when calling the getPastEvents() function on a contract?
user avatar