Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
43 views

go -ethereum abi: cannot marshal in to go type: length insufficient 640 require 8225"

Im trying to decode a struct which basically is a tuple where i have this byte of data and passing the byte of data it will be able to be decoded into a struct in Go. My goal here is trying to create ...
0xbyterider's user avatar
1 vote
1 answer
286 views

How to do simulation of all/most pending transactions?

everybody. I have a task to search in mempool for transactions like "swap tokens for eth" or any other type where a wallet sells tokens and its transaction can affect token reserves. There ...
solo11's user avatar
  • 11
1 vote
1 answer
80 views

Abigen from flattened contract files

I have a file that is composed of 5 imports, too much code to drop here so I will illustrate my question with a very simplified example. My Test.sol file: // SPDX-License-Identifier: MIT pragma ...
pigfox's user avatar
  • 167
1 vote
0 answers
96 views

abi: attempting to unmarshal an empty string while arguments are expected

After updating go-etherum from github.com/ethereum/go-ethereum v1.10.22 to v1.13.15 My contracts started printing out error abi: attempting to unmarshal an empty string while arguments are expected ...
Mikheil Janiashvili's user avatar
0 votes
0 answers
41 views

public key recovery failed intermittently with go-ethereum

I am trying to recover public key from signature and digest. below is my code. It's failing sometimes with error recovery failed package main import ( "crypto/ecdsa" "crypto/...
Pankaj Kumar's user avatar
3 votes
1 answer
84 views

for loop containing types.Sender sometimes does not leave and consumes 100% CPU

I have this simplified code here: signer := types.LatestSignerForChainID(s.ethApiBackend.ChainConfig().ChainID) log.Info("Before msg generation", "txsLen", len(txs)) msgs := make([]...
flo's user avatar
  • 115
1 vote
1 answer
206 views

Using abigen with combined-json option generates nothing

I was trying to generate go binding using following commands: abigen --combined-json UniswapV2PriceOracle.json --pkg abi --type UniswapV2 --out UniswapV2.go It doesn't give any error, but the go file ...
John Smith's user avatar
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
2 votes
3 answers
479 views

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

How to implement the below solidity code in golang? especially the abi.encode function? abi.encode( keccak256("delegate(address sender,string amount, string to)"), sender, amount,...
Daniel Moore's user avatar
0 votes
3 answers
560 views

Despite calculation I get contract creation code storage out of gas

My smart contract is deployed on https://sepolia.etherscan.io/tx/0x1b1742a3ff2ac160d5f245ab91828fcc56a803cb3826b6cbdb9f3cb2f293ba66 Once deployed I get contract creation code storage out of gas error ...
pigfox's user avatar
  • 167
1 vote
1 answer
220 views

Why Golang was chosen to implement ethereum protocol?

I know there are many implementations of the Ethereum protocol, i.e. the first implementation in Python, or other implementations using C++, C#, and Java. As go-ethereum has gained lots of attention ...
Ehsan Khodarahmi's user avatar
1 vote
0 answers
219 views

($10 ETH Bounty) Base Chain - My submitted transaction is always 2 blocks behind the current block

For some reason whenever I submit my transaction it is always included 2 or more blocks behind the current block. There's an address that always has their transaction included in the same block as the ...
shlx's user avatar
  • 31
1 vote
2 answers
148 views

How to analyze a tx data?

Given a transaction of type types.Transaction (golang go-ethereum), how can I analyze the data field and check if it has a swap or a sync event? I know that ...
AnastasiaShishkova's user avatar
0 votes
1 answer
91 views

Rate limiter not working

The following code has an expected duration of 1000ms. package main import ( "context" "fmt" "github.com/ethereum/go-ethereum/ethclient" "golang.org/...
pigfox's user avatar
  • 167
0 votes
1 answer
1k views

Decoding tx data from view call in Golang

I have a view call in my Solidity code that looks like this: function call1 (address[] calldata targets) external view returns(Return[] memory returnData) And the struct from the array which is ...
rihekopo's user avatar
  • 326
0 votes
1 answer
265 views

How to create Solidity bytes[] input argument in Go for Ethereum contract call

I have a simple multicall contract in Solidity which has the following function: function multiCall (address[] calldata targets,bytes[] calldata data) external view returns(Return[] memory returnData) ...
rihekopo's user avatar
  • 326
1 vote
1 answer
213 views

Compiling two smart contracts it the same folder cause duplicates

When I compile two contracts in the same folder I get duplicates. The following contracts, Store.sol pragma solidity ^0.8.0; contract Store { event ItemSet(bytes32 key, bytes32 value); ...
pigfox's user avatar
  • 167
2 votes
2 answers
1k views

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

I am following https://github.com/miguelmota/ethereum-development-with-go-book/tree/master/en/transaction-query Complete code package main import ( "context" "fmt" &...
pigfox's user avatar
  • 167
0 votes
1 answer
282 views

How to properly handler error from contract call with go etheruem

I am writing an application with https://github.com/ethereum/go-ethereum Basically I am trying to check a given smart contract address is erc20 or not. I am calling getBalance, getSymbol... methods. ...
Min Hsiu Hsieh's user avatar
0 votes
1 answer
106 views

SSZ serialization in Ethereum

I am looking at the SSZ serialization for Ethereum and am unable to understand how the "index" alone can be used for encoding/decoding variable length fields. The following is quoted from ...
Sunny's user avatar
  • 103
1 vote
1 answer
65 views

how many transactions we can go in a personal blockchain made with geth ( go-ethereum ) per second or per block?

If I made a personal blockchain using https://geth.ethereum.org/, how many transactions can one block handle?
aakash4dev's user avatar
0 votes
1 answer
353 views

what consensus client is used while making personal blockchain with geth ( go-ethereum)?

Modular EVM based blockchain have multiple layers. mainly consensus layer and execution layer. Execution layer options: Besu Erigon Go Ethereum Nethermind consensus clients options: Lighthouse ...
aakash4dev's user avatar
2 votes
0 answers
487 views

Simulate transaction replacement on go-ethereum SimulatedBackend

i'm writing in go-lang and using go-ethereum package to interact with nodes. For testing purposes go-ethereum provides blockhchain simulation via SimulatedBackend (https://github.com/ethereum/go-...
Andrey Obruchkov's user avatar
2 votes
0 answers
1k views

Getting ALL pending tx from txPool

I'm working on top of geth in golang. My first goal would be to stream all pending transactions from the txPool. The problem is that when I run my script, I can't manage to catch 100% of pending ...
kms kms's user avatar
  • 21
1 vote
0 answers
447 views

Flashbots - Bundle simulation always reverts

I have a series of transactions I'm trying to bundle in golang. several of the transactions are signed transactions from a range of different wallets that are not yet submitted to the mempool. When I ...
user3428734's user avatar
4 votes
1 answer
965 views

Convert pem public key into ethereum address by Go

I have ECC_SECG_P256K1 Public key PEM File generated by AWS KMS. I want to convert pem public key into ethereum address by Go. How can I get it? Sample Pem Data -----BEGIN PUBLIC KEY----- ...
takumi's user avatar
  • 41
0 votes
1 answer
104 views

how connect in rpc file go ethereum

i try much more time to connect rpc my geth, i got it cant run ,,syncmode light,, okay but can i used --syncmode fast? or how i connect in my rpc file , to be read from the geth side, also see the ...
tomas's user avatar
  • 41
2 votes
1 answer
725 views

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

I am following the guide here but I am not able to replicate what is being done in the guide. var transferEvent LogTransfer err := contractAbi.Unpack(&transferEvent, "Transfer", vLog....
SelfLearnedNoob's user avatar
0 votes
1 answer
98 views

Decode Ethereum Gas Price Golang

I needed to get gas data from a transaction, I did it with the code below. The received data has been converted to a string. Now I need to decode the received value. How can I do this? import ( &...
Nikita Shvetsov's user avatar
1 vote
0 answers
104 views

Why is the TransactionByHash function in the go-ethereum client unable to return the sender?

I learned how to get the sender's address from this question. JSON-RPC returns a result with a from field, which we can unmarshal in our struct. But I'm curious why go-ethereum didn't return ...
user109485's user avatar
0 votes
1 answer
273 views

How to read ERC1155's SafeTransferFrom() transactions in golang?

Trying to read ERC1155 SafeTransferFrom events, in golang. Here is what I tried: var ( // erc 1155 logSafeTransferFromSig = []byte("SafeTransferFrom(address,address,uint256,uint256,...
Eric's user avatar
  • 171
1 vote
0 answers
78 views

Point a Go-Ethereum contract instance at a different address

I am running a golang backend that will interact with tens of thousands of deployed contracts that are all the same, just with different addresses (uniswap pools). I am thinking that it would be more ...
skrrrraaaa's user avatar
2 votes
1 answer
2k views

Transaction Effective Gas Price

I am developing in Go and I have a question that I have been looking for the solution for a long time and I am not able to find it. How can I find the effective gas price used in the transaction? Not ...
alopez's user avatar
  • 21
2 votes
0 answers
215 views

Subscribe to smart contract using go-ethereum

I am trying to subscribe to certain smart contract using go-ethereum. Here is the example of my function client, err := ethclient.Dial(config.AppConfig.SmartcontractHost) if err != nil { log.Fatal(...
Yur Gasparyan's user avatar
1 vote
1 answer
115 views

How to filter return value from go-ethereum evm runtime.call

I am writing simple solidity code that's will be running inside evm using golang (go-ethereum). I have successfully run the code, but I can't find the right return value of the function. Test.sol // ...
ade ramdani's user avatar
0 votes
1 answer
255 views

Simple Go-Ethereum Program not compiling

I am following this tutorial: 01-Interact with Ethereum blockchain using Golang When I compile the code, i get the following errors: # github.com/deckarep/golang-set ../github.com/deckarep/golang-set/...
gnome's user avatar
  • 1
3 votes
2 answers
1k views

Verified go signature in solidity (EIP712 TypedData)

I am trying to recover the signer of a TypedData message (eip712). I am able to sign and verify with ethersJS and validate in the contract as well. With Go, I can sign and verify as well but the ...
MadeInDreams's user avatar
  • 1,615
0 votes
1 answer
294 views

How to extend functionality of geth (module, addon)?

Is there a way to extend functionality of geth using some sort of plugins, modules or addons? However, I haven't found any information about the topic. How to do it?
pablo camilo's user avatar
0 votes
1 answer
103 views

How to obtain full token address from uniswap/PCS router transactions (*types.Transaction)

When trying to obtain the token address from router transactions (add liquidity and remove liquidity taxes), the token addresses appear truncated, with 8 leading 0s and the 8 final characters missing. ...
jrn's user avatar
  • 1
0 votes
1 answer
360 views

Can I deploy contract with go-ethereum and sign it via MetaMask?

I want to deploy contracts by using my go backend code with go-ethereum package. Since this part of the system will run as a central element (since it does a lot of other stuffs), I won't (and don't ...
prodx's user avatar
  • 1
0 votes
1 answer
197 views

How to set total supply of native token in genesis file?

I understand you prefund wallet address with a native token in the alloc param, but where do you define the total supply at in the genesis.json file? "genesis": { "nonce":...
cormacncheese's user avatar
0 votes
1 answer
972 views

How to interact with mainnet smart contracts by GOlang?

Please tell me an example of code in GOlang that connects to the contract and checks the balance of the ERC20 token / transfer tokens / gets the name of the token. I looked for examples and did not ...
hey's user avatar
  • 1
1 vote
1 answer
1k views

Calling multicall contract using Go

I'm trying to make a multicall using go. The function "aggregate" takes a tuple of "calls" with address and bytes. "name": "aggregate", "...
Lio's user avatar
  • 11
1 vote
1 answer
1k views

How do I listen for Events starting at a previous block number in Golang?

I'm writing an Event listener for my smart contract using the go-ethereum library. I'm trying to figure out how to listen for all SubmitProof events and have successfully been able to use the builtin ...
hexcowboy's user avatar
2 votes
2 answers
2k views

Await transaction using `go-ethereum/ethclient`

In ethers.js, one can wait for a transaction to be mined with wait(). Is there a way to do this when using ethclient from go-ethereum as a package? I would like to wait for the result before moving on ...
boston's user avatar
  • 33
0 votes
0 answers
30 views

Go Ethereum "invalid signature recovery id" when recovery byte is >= 4 [duplicate]

I have a signed message that was generated by Metamask. It looks like this: ...
hexcowboy's user avatar
2 votes
0 answers
468 views

Reading TxPool using GO

Hello I am trying to learn Go and have not been able to figure out how to get pending transactions. I was reading the following link but I am not sure what I should be importing: https://geth.ethereum....
marrrrrrk's user avatar
0 votes
0 answers
379 views

Decode pending transaction input into map

I'm attempting to decode a transaction input into a map, the input contains uint256 which are translated to bigint but the output value I get is incorrect. I use this function to decode the input data ...
Collins's user avatar
1 vote
1 answer
921 views

Go Ethereum encode types.Transaction as hex

I have a types.Transaction object. How can I encode this to receive the raw transaction hex? Something like this: ...
Ricky Barnett's user avatar
0 votes
1 answer
1k views

Decode Raw Transaction In GoLang to Go-Ethereum types.Transaction

I have the following raw transaction string. ...
Ricky Barnett's user avatar