You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but the experted file vote.go has not been generated, and the console printed this message:
Fatal: Failed to generate ABI binding: 465:76: expected ), found 'range' (and 10 more errors)
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package contracts
import (
"math/big"
"strings"
"errors"
ethereum "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
)
// Reference imports to suppress errors if they are not otherwise used.
var (
_ = errors.New
_ = big.NewInt
_ = strings.NewReader
_ = ethereum.NotFound
_ = bind.Bind
_ = common.Big1
_ = types.BloomLookup
_ = event.NewSubscription
)
// and more output ......
but it is ok to generate ABI binding in Java with same abi/bin files.
Steps to reproduce the behaviour
extract the attached zip into github.com/go-ethereum/build/bin, and run:
ok, this is a bug indeed: you are using range as a parameter name, and go will recognize it as its range keyword. We have to somehow escape that name. In the mean time, you can just change range to e.g. rnge in your ABI file.
System information
Geth version: v.1.10.20
OS & Version: ubuntu 20.04
Commit hash :
Golang version: 1.17.11
solc version: 0.8.13
solidity version: 0.8.0
Attached zip is my contract source file written in solidiy, and its abi / bin file generated by solc,
then I run this command to generate ABI binding in Golang
./abigen --abi=Vote.abi --bin=Vote.bin --pkg=contracts --type=vote --out=vote.go
but the experted file vote.go has not been generated, and the console printed this message:
but it is ok to generate ABI binding in Java with same abi/bin files.
Steps to reproduce the behaviour
extract the attached zip into github.com/go-ethereum/build/bin, and run:
Vote.zip
The text was updated successfully, but these errors were encountered: