Linked Questions

2
votes
1answer
3k 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), ...
51
votes
3answers
36k 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",...
20
votes
8answers
53k 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 ...
1
vote
1answer
2k 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?
1
vote
2answers
3k 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 ...
2
votes
2answers
881 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 ...
1
vote
1answer
805 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" ...
2
votes
1answer
314 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 ...
1
vote
0answers
284 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....
0
votes
1answer
116 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"); ...
1
vote
2answers
50 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 ...
1
vote
1answer
55 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 { ...