Carry out several calls with only one RPC call.
go get github.com/omnes-tech/multicall
Instantiate the multicall client:
client, err := multicall.NewClient(multicall.GENERAL, "http://localhost:8545", nil)
if err!= nil {
log.Fatal(err)
}
Now you just need to call any method you need!
Write (transaction) functions:
AggregateCalls
TryAggregateCalls
TryAggregateCalls3
Read (call) functions:
SimulateCall
AggregateStatic
TryAggregateStatic
TryAggregateStatic3
CodeLengths
Balances
AddressesData