Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
132 views

How to correctly pack Log data in Go

Using go-ethereum, I want to convert a struct containing my log fields into a types.Log{} object containing the data bytes and topics. Essentially, I want to do the opposite of the Parse<EventName&...
Ryan Collingham's user avatar
1 vote
0 answers
196 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/...
Daniel Sarosi's user avatar
0 votes
1 answer
868 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, _ :=...
P A S H's user avatar
  • 138
8 votes
4 answers
10k views

How to decode Log.Data in Go

I'm fetching the logs using client.SubscribeFilterLogs. The event parameters are encoded in types.Log.Data. How can I decode it in go?
Robert Zaremba's user avatar
3 votes
1 answer
1k views

How to access non-indexed event arguments from Go types.Log?

The Go bindings have a type called Log that has the following fields type Log struct { // Consensus fields: // address of the contract that generated the event Address common.Address `...
Steven Roose's user avatar
2 votes
2 answers
3k views

How to access the event log by knowing the contract address (golang)?

At the moment I develope dapps that use smart contract as storage for specific data. I use abigen to generate specific go binding to my contract. If someone try change state of the contract I use ...
Юра Коломиец's user avatar