From 077556859ca4972fac27a0d71a560408ff9700fb Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 22 Jan 2025 12:55:24 +0100 Subject: [PATCH] accounts/abi/bind/v2: add ContractInstance constructor --- accounts/abi/bind/v2/lib.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accounts/abi/bind/v2/lib.go b/accounts/abi/bind/v2/lib.go index 632c6fc831..b1857228b8 100644 --- a/accounts/abi/bind/v2/lib.go +++ b/accounts/abi/bind/v2/lib.go @@ -34,6 +34,10 @@ type ContractInstance struct { abi abi.ABI } +func NewContractInstance(addr common.Address, backend ContractBackend, abi abi.ABI) *ContractInstance { + return &ContractInstance{addr, backend, abi} +} + // FilterEvents returns an EventIterator instance for filtering historical events based on the event id and a block range. func FilterEvents[T any](instance *ContractInstance, opts *FilterOpts, eventName string, unpack func(*types.Log) (*T, error), topics ...[]any) (*EventIterator[T], error) { backend := instance.Backend