We’re rewarding the question askers & reputations are being recalculated! Read more.

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

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

Smart Contract Transfer Event Log Data & transfer _value [Rust]

I'd like to have a better understanding of events and logs data, more specifically when it comes to interacting with ERC20 tokens smart contracts and their Transfer events. I'm looking for a way to ...
0
votes
2answers
33 views

what is the transferfrom event signature?

I am currently writing a code that list all types of transactions in a given contract . my plan is to just check for all logs whether the topics[0] == an event signature of a function. and now i am ...
1
vote
1answer
83 views

Solidity: Raise events via Assembly using log3

I want to raise events from inside a piece of assembly code. I've extended the answer here with the function AssemblyEvent() which currently causes a runtime error. Working example: pragma ...
0
votes
1answer
45 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
29 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
46 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, _ :=...
1
vote
1answer
140 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
16 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
38 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
75 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
103 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
51 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
303 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 ...
3
votes
2answers
899 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
46 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: ' ...
3
votes
3answers
130 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
136 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" ...
3
votes
0answers
139 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
26 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
139 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
1k 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
700 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
40 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
31 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
51 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
43 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
245 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 ...
2
votes
1answer
358 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
199 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
74 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
114 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
523 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
108 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
24 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
143 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
48 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 (){ .... ...
5
votes
2answers
1k 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
736 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), ...
1
vote
1answer
216 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
130 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
295 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
48 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
228 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
61 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
2k 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
2answers
47 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
629 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
321 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
369 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 ...
3
votes
0answers
328 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 ...