All Questions
11 questions
0
votes
0
answers
42
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 ...
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 ...
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&...
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);
...
2
votes
1
answer
724
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....
1
vote
1
answer
1k
views
How do I receive a revert message using go-ethereum
How do I receive a revert message using go-ethereum?
receipt, err := bind.WaitMined(context.Background(), client, tx)
if err != nil {
fmt.Errorf(err)
}
fmt.Println(receipt.Status)
Now I can only ...
1
vote
1
answer
408
views
go-ethereum: Return data from contract function
I have a smart contract written in solidity. I deployed the contract to my Ganache network and I can interact with it via go-ethereum using stubs generated by abigen. My function returns a uint256, ...
3
votes
1
answer
3k
views
How to convert string to type defined by an abi.Type for payload construction?
I am writing a CLI in Go that should faciliate users to be able to make contract function calls from it. This entails generating contract ABIs and providing input parameters to the function arguments ...
2
votes
1
answer
3k
views
ethereumjs-abi equivalent for Golang?
ethereumjs-abi is great for easily ABI encoding and decoding in javascript. Is there an equivalently simple package for Golang?
Geth's accounts/abipackage does this, but there's a lot of setup and it'...
4
votes
2
answers
8k
views
Unable to generate Go Ethereum Bindings using abigen
Not sure what the heck is going on, but I'm unable to use abigen to generate Go Ethereum bindings any more, I get an error that says EvalSymlinks: too many links
solidity@pop-os:~/Documents/Code/...
1
vote
1
answer
502
views
How to access public contract storage with Go?
I have a mapping defined in a contract:
mapping(bytes32=>string) public name;
How can I access this in Go? abigen provides bindings for functions but not variables. This question shows how to ...