Skip to content

Add getImplementationName() to generated contract wrappers#2270

Open
Dev10-sys wants to merge 1 commit intoLFDT-web3j:mainfrom
Dev10-sys:feat/contract-inheritance-visibility
Open

Add getImplementationName() to generated contract wrappers#2270
Dev10-sys wants to merge 1 commit intoLFDT-web3j:mainfrom
Dev10-sys:feat/contract-inheritance-visibility

Conversation

@Dev10-sys
Copy link
Copy Markdown
Contributor

@Dev10-sys Dev10-sys commented Apr 18, 2026

What does this PR do?

Adds a getImplementationName() method to generated contract wrapper classes.

This method returns the contract name used during code generation, making it easier to identify which wrapper class is being used.

Where should the reviewer start?

codegen/src/main/java/org/web3j/codegen/SolidityFunctionWrapper.java

Why is it needed?

When loading contracts via interfaces or abstract wrappers, it is not obvious which concrete contract wrapper is being used.

This change improves visibility by exposing the generated contract name directly in the wrapper.

Note: This does not perform runtime implementation detection.

Fixes #2078

This method returns the generated contract name for better runtime visibility.
It addresses issue LFDT-web3j#2078 by providing a non-reflective way to identify the
concrete implementation class even when loaded via interfaces.

Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show inheritance of contracts

1 participant