eth/backend.go
func (b *backendInstance) EstimateGas(
	ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) {
	ctx2, cancel := b.addTimeout(ctx)
	defer cancel()

	gas, err = b.conn.ethClient().EstimateGas(ctx2, call)
	if err != nil {
		return 0, fmt.Errorf("failed to estimated gas: %s", err)
	}
	return gas, err
}
func (b *backendInstance) EstimateGas(
	ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) {
	ctx2, cancel := b.addTimeout(ctx)
	defer cancel()

	gas, err = b.conn.ethClient().EstimateGas(ctx2, call)
	if err != nil {
		return 0, fmt.Errorf("failed to estimated gas: %s", err)
	}
	return gas, err
}
// EstimateGas tries to estimate the gas needed to execute a specific
// transaction based on the current pending state of the backend blockchain.