Skip to main content
Share Your Experience: Take the 2024 Developer Survey
3 votes
Accepted

type *types.Transaction has no field or method AsMessage)

UPDATE: The good package is: import "github.com/ethereum/go-ethereum/types" and the supported transaction type is: NewLondonSigner() Overall, the code will be: import "github.com/...
Ahmed Rami Berrahal's user avatar
2 votes
Accepted

Rate limiter not working

you create a new limiter for each try, Should use one limiter for all connect.
ZACK WONG's user avatar
2 votes
Accepted

Decoding tx data from view call in Golang

In Golang, the Go Ethereum library provides the abi package which has methods to unpack the transaction data. However, because the bytes data type in Solidity is dynamic, it needs to be decoded ...
70ny's user avatar
  • 241
2 votes

Despite calculation I get contract creation code storage out of gas

You will need to calculate the sum of the following values: 32000 gas - creating a contract 21000 gas - procedure call Gas per execution of creation code (initialization code + constructor. The ...
Alexey Smirnov's user avatar
2 votes

How to implement the below solidity code in golang? especially the `abi.encode` function?

You can make the similar encoding go-ethereum package. Load the abi file as abi.ABI object: abiObject, err := abi.JSON(strings.NewReader("pathToAbiFile")) if err != nil { ...
Bapi Reddy's user avatar
2 votes

How to correctly pack Log data in Go

OK I think I've figured it out. The Pack/Unpack methods on the Arguments type are asymmetric: Pack will pack all arguments whereas Unpack will filter out indexed arguments first. So the correct way to ...
Ryan Collingham's user avatar
1 vote
Accepted

Abigen from flattened contract files

One approach to achieve this is to concatenate the ABI and BIN files of both contracts before passing them to abigen. You can do this by reading the contents of the separate ABI and BIN files for Cat ...
SYED ASAD KAZMI's user avatar
1 vote

How to implement the below solidity code in golang? especially the `abi.encode` function?

To implement the equivalent of the provided Solidity code in Go, you'll need to use the Ethereum ABI encoding logic. The abi.encode function in Solidity is used for ABI encoding, and in Go, you can ...
Sohail Ghafoor's user avatar
1 vote

Despite calculation I get contract creation code storage out of gas

This is probably not a satisfactory answer, but it addresses some issues in your question. Generally it's impossible to predict the gas limit exactly. Especially without actually dry-running it. But ...
Albert Hendriks's user avatar
1 vote
Accepted

Why Golang was chosen to implement ethereum protocol?

They wanted to have several implementations to minimize the security risks. Initially there were implementation in C++, python, go, rust, etc. There were plans for writing implementations in java, and ...
Ismael's user avatar
  • 30.5k
1 vote

How to analyze a tx data?

Take under note that I'm the author of this package and that it's still not fully completed (not in main, missing tests, etc...) You can see the code of how to unpack logs here: https://github.com/...
Nevio Vesić's user avatar
1 vote

How to analyze a tx data?

types.Transaction does not hold any events, or any post-block-inclusion information. But types.Receipt does. You can get the receipt of a transaction pretty easily from its hash (only if the ...
jj1980's user avatar
  • 151
1 vote
Accepted

Generate r, s, v permit signature variables off chain using Golang

Solved it myself in the end, my main confusion was in the difference between abi.encode & abi.encodePacked (not sure go-ethereum doesn't have a version of these funcs like other ethereum packages ...
PopFendi's user avatar
1 vote
Accepted

How to use contractAbi.Unpack to parse raw log data into a log type struct

You can use the UnpackIntoInterface() method which takes three parameters event := struct { Key [32]byte Value [32]byte }{} _ = contractAbi.UnpackIntoInterface(&event, "ItemSet"...
TylerRen's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible