go-ethereum
go-ethereum copied to clipboard
abigen: create output type for structured contract functions
Enhance abigen to Generate Output Types for Contract Functions
Description
Issue #29689
Current limitations:
- It does not create separate output types for contract functions
- This makes it challenging to use the generated bindings in a generic way across different projects
Proposed enhancements:
- Generate dedicated structs for each function's return type
- Export these structs in the generated package
Example before:
func SomeFunction() (struct{ Field1 int, Field2 string }, error)
Example after:
type SomeFunctionOutput struct {
Field1 int
Field2 string
}
func SomeFunction() (SomeFunctionOutput, error)