Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
16 views

Is it possible to get duplicates of the log events on Ethereum when we have a fork of the chain?

Let's suppose we have 2 chains of ethereum blockchain. When I fetching contract's log events from x block to getBlockNumber(). Will i get two or one the same log events from each block? Or ...
0
votes
0answers
11 views

Handling EOF when subscribing to Event Logs

I'm trying to subscribe to events logs to handle Transfer(address,address,uint64) events. I've followed this example. https://github.com/miguelmota/ethereum-development-with-go-book/blob/master/en/...
0
votes
1answer
30 views

Converting Log Topics to int64 correctly in Go

I currently use the code below to extract the ERC721 Token ID from Transfer Event Logs: txHash := newLog.TxHash.Hex() hexString := common.BytesToAddress(newLog.Topics[3].Bytes()).Hex() flowerNum, _ :=...
0
votes
1answer
46 views

How to handle events using drizzle?

strange that after much searching, i havent found even one piece of info out there which clearly elaborates on how the events are manipulated in drizzle. From what i understand, the event names (and ...
1
vote
0answers
12 views

Error deploying the subgraph: Internal error: Could not pick index node

I'm playing with "The Graph" example counter project. If all I do is change the contract address in the mapping.ts to the same Counter contract on Rinkeby, then try to deploy, I get this error: ...
0
votes
1answer
27 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"); ...
0
votes
1answer
23 views

How to interact with events from a smart contract?

can we get access to watch the event and get logged data from them and use it for processing in a smart contract? Like matching an state variable with the data logged by an event .
0
votes
0answers
35 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
38 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
121 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 ...
2
votes
2answers
192 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
28 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
47 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
58 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
79 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
21 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
85 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
587 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
320 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
35 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
27 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
40 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
36 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
132 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
182 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
128 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
58 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
79 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
273 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
85 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
23 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
109 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
44 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
627 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
468 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
38 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
132 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
170 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
112 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
186 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
40 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
192 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
53 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
128 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
463 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
212 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
253 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
182 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 ...