Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not enough arguments in call to bind.NewBoundContract #2

Open
mrbardia72 opened this issue Sep 23, 2020 · 0 comments
Open

not enough arguments in call to bind.NewBoundContract #2

mrbardia72 opened this issue Sep 23, 2020 · 0 comments

Comments

@mrbardia72
Copy link

Executing the following code encountered the following error

---code---

package main
import (
"fmt"
"log"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
)
func main() {
conn, err := ethclient.Dial("https://mainnet.infura.io")
if err != nil {
log.Fatalf("Failed to connect to the Ethereum network: %v", err)
}
contract, err := NewTronToken(common.HexToAddress("0x3459748F010d56203b2379BB2Fe9FB4e9AEFfd23"), conn)
if err != nil {
log.Fatalf("Failed to instantiate contract: %v", err)
}
amt, _ := contract.BalanceOf(&bind.CallOpts{}, common.HexToAddress("0x6Fe99132E282686F9976dD5DA69c26aB69A665a3"))
fmt.Println(amt)
}

---error----

bardia@kzm:/media/bardia/code/goether$ go run main.go token.go

command-line-arguments

./token.go:121:30: not enough arguments in call to bind.NewBoundContract
have (common.Address, abi.ABI, bind.ContractCaller, bind.ContractTransactor)
want (common.Address, abi.ABI, bind.ContractCaller, bind.ContractTransactor, bind.ContractFilterer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant