Skip to content

Commit 0775568

Browse files
committed
accounts/abi/bind/v2: add ContractInstance constructor
1 parent 0e856b5 commit 0775568

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

accounts/abi/bind/v2/lib.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ type ContractInstance struct {
3434
abi abi.ABI
3535
}
3636

37+
func NewContractInstance(addr common.Address, backend ContractBackend, abi abi.ABI) *ContractInstance {
38+
return &ContractInstance{addr, backend, abi}
39+
}
40+
3741
// FilterEvents returns an EventIterator instance for filtering historical events based on the event id and a block range.
3842
func FilterEvents[T any](instance *ContractInstance, opts *FilterOpts, eventName string, unpack func(*types.Log) (*T, error), topics ...[]any) (*EventIterator[T], error) {
3943
backend := instance.Backend

0 commit comments

Comments
 (0)