diff --git a/accounts/abi/abigen/source2.go.tpl b/accounts/abi/abigen/source2.go.tpl index 9285497511..b78583dfb4 100644 --- a/accounts/abi/abigen/source2.go.tpl +++ b/accounts/abi/abigen/source2.go.tpl @@ -73,6 +73,13 @@ var ( return &{{.Type}}{abi: *parsed} } + // ABI returns the parsed ABI of the contract. The returned value shares + // its internal maps (Methods, Events, Errors) with the binding, so callers + // must not mutate it. + func (c *{{.Type}}) ABI() abi.ABI { + return c.abi + } + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *{{.Type}}) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/callbackparam.go.txt b/accounts/abi/abigen/testdata/v2/callbackparam.go.txt index a01b125acf..f0c45498a4 100644 --- a/accounts/abi/abigen/testdata/v2/callbackparam.go.txt +++ b/accounts/abi/abigen/testdata/v2/callbackparam.go.txt @@ -50,6 +50,13 @@ func NewCallbackParam() *CallbackParam { return &CallbackParam{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *CallbackParam) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *CallbackParam) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/crowdsale.go.txt b/accounts/abi/abigen/testdata/v2/crowdsale.go.txt index 66582aa5c6..02b86efacd 100644 --- a/accounts/abi/abigen/testdata/v2/crowdsale.go.txt +++ b/accounts/abi/abigen/testdata/v2/crowdsale.go.txt @@ -50,6 +50,13 @@ func NewCrowdsale() *Crowdsale { return &Crowdsale{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Crowdsale) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Crowdsale) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/dao.go.txt b/accounts/abi/abigen/testdata/v2/dao.go.txt index a810c65bd9..c8aa0eab73 100644 --- a/accounts/abi/abigen/testdata/v2/dao.go.txt +++ b/accounts/abi/abigen/testdata/v2/dao.go.txt @@ -50,6 +50,13 @@ func NewDAO() *DAO { return &DAO{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *DAO) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *DAO) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/deeplynestedarray.go.txt b/accounts/abi/abigen/testdata/v2/deeplynestedarray.go.txt index 559ea83422..a879a03d2f 100644 --- a/accounts/abi/abigen/testdata/v2/deeplynestedarray.go.txt +++ b/accounts/abi/abigen/testdata/v2/deeplynestedarray.go.txt @@ -50,6 +50,13 @@ func NewDeeplyNestedArray() *DeeplyNestedArray { return &DeeplyNestedArray{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *DeeplyNestedArray) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *DeeplyNestedArray) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/empty.go.txt b/accounts/abi/abigen/testdata/v2/empty.go.txt index 7deea15570..53747f13d4 100644 --- a/accounts/abi/abigen/testdata/v2/empty.go.txt +++ b/accounts/abi/abigen/testdata/v2/empty.go.txt @@ -50,6 +50,13 @@ func NewEmpty() *Empty { return &Empty{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Empty) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Empty) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/eventchecker.go.txt b/accounts/abi/abigen/testdata/v2/eventchecker.go.txt index 213ab609f5..8b6d261471 100644 --- a/accounts/abi/abigen/testdata/v2/eventchecker.go.txt +++ b/accounts/abi/abigen/testdata/v2/eventchecker.go.txt @@ -49,6 +49,13 @@ func NewEventChecker() *EventChecker { return &EventChecker{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *EventChecker) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *EventChecker) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/getter.go.txt b/accounts/abi/abigen/testdata/v2/getter.go.txt index 69267767c2..38b2ea000a 100644 --- a/accounts/abi/abigen/testdata/v2/getter.go.txt +++ b/accounts/abi/abigen/testdata/v2/getter.go.txt @@ -50,6 +50,13 @@ func NewGetter() *Getter { return &Getter{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Getter) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Getter) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/identifiercollision.go.txt b/accounts/abi/abigen/testdata/v2/identifiercollision.go.txt index 1d14a7109d..e02633817d 100644 --- a/accounts/abi/abigen/testdata/v2/identifiercollision.go.txt +++ b/accounts/abi/abigen/testdata/v2/identifiercollision.go.txt @@ -50,6 +50,13 @@ func NewIdentifierCollision() *IdentifierCollision { return &IdentifierCollision{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *IdentifierCollision) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *IdentifierCollision) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/inputchecker.go.txt b/accounts/abi/abigen/testdata/v2/inputchecker.go.txt index 4522aea52a..dd4b088ef0 100644 --- a/accounts/abi/abigen/testdata/v2/inputchecker.go.txt +++ b/accounts/abi/abigen/testdata/v2/inputchecker.go.txt @@ -49,6 +49,13 @@ func NewInputChecker() *InputChecker { return &InputChecker{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *InputChecker) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *InputChecker) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/interactor.go.txt b/accounts/abi/abigen/testdata/v2/interactor.go.txt index 3e88b4a521..5d05017667 100644 --- a/accounts/abi/abigen/testdata/v2/interactor.go.txt +++ b/accounts/abi/abigen/testdata/v2/interactor.go.txt @@ -50,6 +50,13 @@ func NewInteractor() *Interactor { return &Interactor{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Interactor) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Interactor) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/nameconflict.go.txt b/accounts/abi/abigen/testdata/v2/nameconflict.go.txt index 13f96527ee..77f33652f4 100644 --- a/accounts/abi/abigen/testdata/v2/nameconflict.go.txt +++ b/accounts/abi/abigen/testdata/v2/nameconflict.go.txt @@ -56,6 +56,13 @@ func NewNameConflict() *NameConflict { return &NameConflict{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *NameConflict) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *NameConflict) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/numericmethodname.go.txt b/accounts/abi/abigen/testdata/v2/numericmethodname.go.txt index 4f5392f19d..e130a43cb1 100644 --- a/accounts/abi/abigen/testdata/v2/numericmethodname.go.txt +++ b/accounts/abi/abigen/testdata/v2/numericmethodname.go.txt @@ -50,6 +50,13 @@ func NewNumericMethodName() *NumericMethodName { return &NumericMethodName{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *NumericMethodName) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *NumericMethodName) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/outputchecker.go.txt b/accounts/abi/abigen/testdata/v2/outputchecker.go.txt index 8d3e475e98..bf6516503a 100644 --- a/accounts/abi/abigen/testdata/v2/outputchecker.go.txt +++ b/accounts/abi/abigen/testdata/v2/outputchecker.go.txt @@ -49,6 +49,13 @@ func NewOutputChecker() *OutputChecker { return &OutputChecker{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *OutputChecker) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *OutputChecker) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/overload.go.txt b/accounts/abi/abigen/testdata/v2/overload.go.txt index 006a2c7c3c..061a63efca 100644 --- a/accounts/abi/abigen/testdata/v2/overload.go.txt +++ b/accounts/abi/abigen/testdata/v2/overload.go.txt @@ -50,6 +50,13 @@ func NewOverload() *Overload { return &Overload{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Overload) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Overload) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/rangekeyword.go.txt b/accounts/abi/abigen/testdata/v2/rangekeyword.go.txt index 76c5d72d29..12869c7e81 100644 --- a/accounts/abi/abigen/testdata/v2/rangekeyword.go.txt +++ b/accounts/abi/abigen/testdata/v2/rangekeyword.go.txt @@ -50,6 +50,13 @@ func NewRangeKeyword() *RangeKeyword { return &RangeKeyword{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *RangeKeyword) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *RangeKeyword) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/slicer.go.txt b/accounts/abi/abigen/testdata/v2/slicer.go.txt index 416a629cb7..6c5dd0d610 100644 --- a/accounts/abi/abigen/testdata/v2/slicer.go.txt +++ b/accounts/abi/abigen/testdata/v2/slicer.go.txt @@ -50,6 +50,13 @@ func NewSlicer() *Slicer { return &Slicer{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Slicer) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Slicer) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/structs.go.txt b/accounts/abi/abigen/testdata/v2/structs.go.txt index ee55ec5620..f018958ddf 100644 --- a/accounts/abi/abigen/testdata/v2/structs.go.txt +++ b/accounts/abi/abigen/testdata/v2/structs.go.txt @@ -55,6 +55,13 @@ func NewStructs() *Structs { return &Structs{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Structs) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Structs) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/token.go.txt b/accounts/abi/abigen/testdata/v2/token.go.txt index 1bd364a918..d1e337cd81 100644 --- a/accounts/abi/abigen/testdata/v2/token.go.txt +++ b/accounts/abi/abigen/testdata/v2/token.go.txt @@ -50,6 +50,13 @@ func NewToken() *Token { return &Token{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Token) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Token) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/tuple.go.txt b/accounts/abi/abigen/testdata/v2/tuple.go.txt index 6aabdeb0fe..cf347da07c 100644 --- a/accounts/abi/abigen/testdata/v2/tuple.go.txt +++ b/accounts/abi/abigen/testdata/v2/tuple.go.txt @@ -75,6 +75,13 @@ func NewTuple() *Tuple { return &Tuple{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Tuple) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Tuple) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/tupler.go.txt b/accounts/abi/abigen/testdata/v2/tupler.go.txt index 5e6eafb07e..c050f08adf 100644 --- a/accounts/abi/abigen/testdata/v2/tupler.go.txt +++ b/accounts/abi/abigen/testdata/v2/tupler.go.txt @@ -50,6 +50,13 @@ func NewTupler() *Tupler { return &Tupler{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Tupler) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Tupler) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/abigen/testdata/v2/underscorer.go.txt b/accounts/abi/abigen/testdata/v2/underscorer.go.txt index abe3bdbacb..9d00ab3499 100644 --- a/accounts/abi/abigen/testdata/v2/underscorer.go.txt +++ b/accounts/abi/abigen/testdata/v2/underscorer.go.txt @@ -50,6 +50,13 @@ func NewUnderscorer() *Underscorer { return &Underscorer{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *Underscorer) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *Underscorer) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/bind/v2/internal/contracts/db/bindings.go b/accounts/abi/bind/v2/internal/contracts/db/bindings.go index b9a7e3164a..1c08551411 100644 --- a/accounts/abi/bind/v2/internal/contracts/db/bindings.go +++ b/accounts/abi/bind/v2/internal/contracts/db/bindings.go @@ -57,6 +57,13 @@ func NewDB() *DB { return &DB{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *DB) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *DB) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/bind/v2/internal/contracts/events/bindings.go b/accounts/abi/bind/v2/internal/contracts/events/bindings.go index 7acd312b65..b130fdd609 100644 --- a/accounts/abi/bind/v2/internal/contracts/events/bindings.go +++ b/accounts/abi/bind/v2/internal/contracts/events/bindings.go @@ -50,6 +50,13 @@ func NewC() *C { return &C{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *C) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *C) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/bind/v2/internal/contracts/nested_libraries/bindings.go b/accounts/abi/bind/v2/internal/contracts/nested_libraries/bindings.go index 406d71192f..f887145067 100644 --- a/accounts/abi/bind/v2/internal/contracts/nested_libraries/bindings.go +++ b/accounts/abi/bind/v2/internal/contracts/nested_libraries/bindings.go @@ -54,6 +54,13 @@ func NewC1() *C1 { return &C1{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *C1) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *C1) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { @@ -137,6 +144,13 @@ func NewC2() *C2 { return &C2{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *C2) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *C2) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { @@ -216,6 +230,13 @@ func NewL1() *L1 { return &L1{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *L1) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *L1) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { @@ -286,6 +307,13 @@ func NewL2() *L2 { return &L2{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *L2) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *L2) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { @@ -356,6 +384,13 @@ func NewL2b() *L2b { return &L2b{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *L2b) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *L2b) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { @@ -423,6 +458,13 @@ func NewL3() *L3 { return &L3{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *L3) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *L3) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { @@ -494,6 +536,13 @@ func NewL4() *L4 { return &L4{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *L4) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *L4) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { @@ -564,6 +613,13 @@ func NewL4b() *L4b { return &L4b{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *L4b) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *L4b) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/bind/v2/internal/contracts/solc_errors/bindings.go b/accounts/abi/bind/v2/internal/contracts/solc_errors/bindings.go index 12d8b7f3e9..ae7d44a3c6 100644 --- a/accounts/abi/bind/v2/internal/contracts/solc_errors/bindings.go +++ b/accounts/abi/bind/v2/internal/contracts/solc_errors/bindings.go @@ -50,6 +50,13 @@ func NewC() *C { return &C{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *C) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *C) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { @@ -192,6 +199,13 @@ func NewC2() *C2 { return &C2{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *C2) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *C2) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract { diff --git a/accounts/abi/bind/v2/internal/contracts/uint256arrayreturn/bindings.go b/accounts/abi/bind/v2/internal/contracts/uint256arrayreturn/bindings.go index f06788633c..978d958b84 100644 --- a/accounts/abi/bind/v2/internal/contracts/uint256arrayreturn/bindings.go +++ b/accounts/abi/bind/v2/internal/contracts/uint256arrayreturn/bindings.go @@ -50,6 +50,13 @@ func NewMyContract() *MyContract { return &MyContract{abi: *parsed} } +// ABI returns the parsed ABI of the contract. The returned value shares +// its internal maps (Methods, Events, Errors) with the binding, so callers +// must not mutate it. +func (c *MyContract) ABI() abi.ABI { + return c.abi +} + // Instance creates a wrapper for a deployed contract instance at the given address. // Use this to create the instance object passed to abigen v2 library functions Call, Transact, etc. func (c *MyContract) Instance(backend bind.ContractBackend, addr common.Address) *bind.BoundContract {