Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [logs]

Questions dealing with the contracts or clients logs. The tag "events" may be more appropriate, see https://ethereum.stackexchange.com/questions/tagged/events

0
votes
0answers
9 views

Ethereum Logs Geth Cyclic Logs [closed]

I'm trying to create cyclic logs with GETH. For some reason, after I'm removing/emptying the file, the geth client node does not write the logs back into it. e.g.: geth --datadir $path --syncmode '...
0
votes
0answers
10 views

How to decode transfer log data Node

I am trying to decode transfer log to get the addresses to and from, and potentially the value but most important address from and to. const subscribe = () => { subscription = web3.eth....
0
votes
1answer
23 views

Logs and events: How are arguments of “watch” defined?

In order to watch an event we can use: var temp; eventx.watch (function(error, result){ temp = result.args.val.toNumber();}); Question 1: What is the role of: function(error, result){ temp = result....
1
vote
1answer
51 views

Emit event while require statement fails

I would like to be able to log a result of a condition: if(time > 5) { emit Result("time is larger than 5"); } else { emit Result("time is less than 5"); } This will work just fine, but ...
1
vote
1answer
61 views

Truffle test, logs do not include an emitted event

I am calling a contract function which emits an event in a transaction. This transaction should include the event and is typically visible via: const receipt = await contractInstance.someFunction() ...
1
vote
0answers
16 views

Read args object from particular block transaction in truffle console.

Hi I have question on how to read args from specific block transaction that are passed when event was called. I have triggered an event, my block is created and i got transaction tx. In the ' Logs: ' ...
1
vote
2answers
34 views

How to setup 'topics' for function getPastLogs ()?

Sir, I want to read the past event log by using getPastLogs(),but I got the whole log.I hope I can filter some log. I find I can setup the 'topics' in getPastLogs(),but it always fails. How ...
0
votes
1answer
30 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
0answers
46 views

Bloom Filters - is the blockchain filtered block by block?

I understand that bloom filters are used to quickly scan for log topics and corresponding contract addresses. I also understand that an 2048-bit bloom filter is stored in the block header. Question: ...
0
votes
1answer
19 views

Should I route forwarding contracts through a second forwarding contract?

This is more of a question of filter events, I guess. If I have 500k deposit addresses and they are all forwarding to one account and emitting event logs with address(this) and msg.value, would it be ...
2
votes
2answers
60 views

How to maintain history of changes in mapping?

I have a mapping variable in my solidity code which maps address to name. I want to maintain the history/log of every change that happens in this mapping. What is the best possible solution to it?
1
vote
2answers
379 views

How do I decode the transaction's log with Web3.py?

I can filter my events (please see), but instead of that if I know only the transaction hash and if its already deployed, is it possible to obtain and parse the transaction's log data using Web3.py? ...
0
votes
2answers
174 views

How to decode data parameter under logs in transaction receipt?

I went through many questions but I couldn't get my answer. web3 version -- 0.20.6 According to documentation event's parameters which are not indexed store in data parameter under logs. I want to ...
0
votes
0answers
30 views

How to read ALL logs of a certain event

When I read event logs like this: myContract.getPastEvents('myEventLogName', { fromBlock: 0, toBlock: 'latest' }) .then(function(events){ console.log(events) // same results as the ...
2
votes
1answer
26 views

Can ethereum logs be present while transaction is being mined, then disappear later?

Question about the ethereum blockchain: If I walk the blockchain like so: for block in blockchain: for transaction in block: receipt = getTransactionReceipt(transaction) for log ...
1
vote
0answers
34 views

Why do are the 'type' & 'removed' fields in receipt logs different between Ganache and Geth?

When I run a particular transaction and log the receipt, I am getting different results depending on if my EVM is Geth or Ganache. Specifically, Ganache returns receipt.logs[0].type: 'mined' while in ...
1
vote
1answer
32 views

What does the logger's address mean in Ethereum yellow paper?

In the Ethereum yellow paper Page 5 says that the log entry O consists of (O_a,(O_{t0}, O_{t1},...),O_d). And O_a means the logger's address. What's the meaning of logger's address? Does it mean the ...
0
votes
1answer
99 views

Solidity: msg.data vs bytes

This is a simple contract that has a function input_data(bytes data) and a simple fallback function that passes msg.data to function input_data. contract test_input_data{ address owner; event ...
1
vote
1answer
128 views

How to unsubscribe logs / events?

There are two ways to subscribe/watch to logs/events: Subscribe: var subscription = web3.eth.subscribe('logs', { address: '0x123456..', topics: ['0x12345...'] }, function(error, result){ ...
1
vote
1answer
100 views

Decoding Contract Log's “Data” field With eth-abi Throws Error: “Padding bytes were not empty: b'0x0000000000'”

I used this guide to create the code below. I suspect the error is somewhat related to the encoding processes I do to the strings, as that is the only place where I deviate from the guide. Here is my ...
4
votes
1answer
56 views

Different outputs on event log subscription

These are the two ways I found to track events on the Ethereum blockchain. One of them doesn't contain the data I need. Why not? Way 1 does NOT contain the data I need Result: subscription = web3wss....
7
votes
1answer
64 views

What is the capacity of the logsBloom?

The logs bloom filter in the block header has a size of 2048 bits. How many messages will it accommodate before the false positive rate is too high for it to be useful anymore? If a formula could be ...
0
votes
1answer
192 views

Proper way of using allEvents()

I'm trying to get all events for a contract: let events = token.allEvents({fromBlock: creationBlock, toBlock: 'latest'}, (err, res) => { try { let result = events.get(); ...
1
vote
0answers
74 views

Filtering blocks on basis of transaction logs in web3j

I want to filter blocks on the basis of a log present inside transactions. How can I do that? I don't have any contract address and want to filter all the blocks generated by all the contracts. ...
0
votes
1answer
21 views

Incorrect values being passed

I am trying to copy stored values using the following internal value. pragma solidity ^0.4.21; contract test{ event LogTest( bytes32[5] a ); bytes32[5] attr; function ...
0
votes
1answer
84 views

copying bytes32 values from map to array

I am trying to copy stored values from a map to an array. I have the following code: pragma solidity ^0.4.21; contract test { event LogTest( bytes32[5] a ); bytes32[5] arr; mapping (uint=...
0
votes
0answers
43 views

Events firing but bool variable not changing in value

Given a contract with an event as follows contract test { event LogEvent( address a, bool result ); function testInputs(some parameters) public (){ .... ...
4
votes
2answers
516 views

how to interpret event data ethereum

I was able to use the EtherScan api to get an array with event logs. Now I need to read from the data stored inside. The event data exists out of: uint256, uint256, uint256, address, address, string. ...
2
votes
1answer
406 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), ...
0
votes
0answers
30 views

Are Event Logs mandatory and specified in ERC-20 or how to get transactions?

How do I get the transactions on ERC-20 contracts? What kind of information do I get and which is not included in event logs? Can I use same logic for reading logs of all erc-20 contracts or do I need ...
0
votes
0answers
121 views

How to watch erc20 transactions for many accounts and multiple tokens

I need do track customer deposits on a multitude of addresses with various tokens I want do to this with Logs web3.eth.subscribe('logs'.. or web3.eth.getPastLogs - which one is better? how do I ...
1
vote
1answer
144 views

Web3.js getPastLogs() fromBlock error

I am trying to get some logs from ropsten and here is my code: web3.eth.getPastLogs( { address: '0x3b873a919aa0512d5a0f09e6dcceaa4a6727fafe', fromBlock: 3292448, toBlock: 3292448, }, )...
0
votes
1answer
102 views

Why Event log is NOT shown in HTML page?

I want to see Event logs in UI. And for this, I use following code in JavaScript : var EnergyEvent = Coursetro.setEnergyEvent({}, {fromBlock: 0, toBlock: 'latest'}); EnergyEvent.watch(...
0
votes
1answer
152 views

Why myContract.events.MyEvent([options][, callback]) does not return “data” and “logs”?

We have an event as follows : event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner); This event is called in following function : ...
0
votes
1answer
36 views

A common error at time of using web3 options

When i use some web3 options as follows, I receive a common error i.e. TypeError: web3.[option] is not a function For example : TypeError: web3.toAscii is not a function web3.toAscii(...
1
vote
3answers
180 views

How to get “event logs” similar to “remix”?

I have an event as follows : event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner); And this event is used in following function :...
1
vote
1answer
47 views

Only one topics args for event logs visible in the transaction receipt, instead of three expected

I have a Smart Contrat where there is some events like bellow : MyContract { event CustomerDataSendingToSeller(address _seller, string _hasheCustomerData, uint256 _orderSeq); function ...
0
votes
2answers
1k views

How to listen to events generated by an existing contract in web3 1.x.x?

Currently I'm unable to find a working solution. Let's say I have the following smartcontract: contract Manufacturer { event LogNewOrder(string order); string[] public orders; function ...
0
votes
0answers
110 views

Transaction receipt logs has logs from another transaction

I'm trying to analyze contract call transactions from blockchain by looking at the each transaction's logs to see whether some events were emitted (can't use plain filters/watches). I wanted to go ...
0
votes
2answers
45 views

How to see Logs of exceptions?

I'm using solidity compiler ^0.4.23, I added logs to the function at exception points like this: function firstSaleDelivery(address _beneficiary, uint256 rate) public onlyOwner{ require(!...
0
votes
0answers
391 views

Truffle Test Sell Event Assertion Error

When I test my selling event in truffle.So, the following error comes:- The solidity code is :- event Sell(address _buyer, uint256 _amount); // Buy token function buyTokens(uint256 _numberOfTokens) ...
1
vote
3answers
170 views

Emit event in view function or

Is it possible to emit event in view function (via event or logi)? Or is it possible to return value to javascript without(before) mining in a transaction function? My aim is to avoid wait due to ...
0
votes
1answer
219 views

Can't find a way to log when revert()'ing in remix

This is my first time working with Solidity and I soon ran into an issue. When an address doesn't have enough balance or doesn't have the authority to add coins I want to log an error, when these ...
2
votes
0answers
152 views

How to use logx in Solidity?

Aim: To log data from a smart contract. Following function is written in accordance with low level interface to Logs in ethereum. However, due to lack of documentation, and being new in Solidity, I ...
1
vote
1answer
174 views

eth_getLogs only returns logs for last transaction

The following command only returns logs for the last transaction (or block). I'm currently running ganach-cli for the local testnet. There were previous transactions with events but when a new ...
1
vote
0answers
195 views

Can you explain some fields in geth logs “Imported new state entries”?

Here is a part of logs during geth syncing: INFO [04-13|05:01:20] Imported new state entries count=1152 elapsed=6.026ms processed=21622419 pending=7126 retry=0 duplicate=28494 ...
0
votes
1answer
44 views

Does getPastLogs require arvhived parity node?

Talking about parity here: --pruning=[METHOD] Configure pruning of the state/storage trie. METHOD may be one of auto, archive, fast: archive - keep all state trie data. No pruning. fast - ...
0
votes
1answer
31 views

What information is available if you set up a node?

I'm doing a project on blockchain technology where we are supposed to do some kind of measurement and evaluate the result. I've heard that you can set up a Ethereum node and get some kind of ...
1
vote
1answer
83 views

Event unique identifier

The web3.js (1.0) docs helpfully list the return values from a contract event subscription. I've noticed that there is an additional return value id that isn't listed there but is returned with the ...
3
votes
0answers
70 views

How to parse through the logsBloom of a block or transaction using solidity

Currently trying to figure out how to parse through the logsBloom portion of block and transaction headers using solidity. I've researched the topic so far and have come to the understanding that RLP ...