Linked Questions

2
votes
1answer
2k 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), ...
50
votes
3answers
34k 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",...
16
votes
8answers
37k 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
2answers
2k 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 ...
1
vote
1answer
513 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
226 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 ...
0
votes
1answer
174 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
0answers
187 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....
2
votes
2answers
70 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 ...
0
votes
1answer
78 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"); ...