-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't generateContractWrappers for solidity 0.8.x due result json change format #83
Comments
longdt
changed the title
Can't generateContractWrappers for solidity 0.8.x due result change format for abi field
Can't generateContractWrappers for solidity 0.8.x due result json change format
Nov 5, 2021
It seen low develop activity in this repo. I fixed by make a fork. Thanks |
I had the same issue and your fork fixed it for me. Thanks. |
I have the same problem under Ubuntu, but not on Windows. Using @longdt fork all is fine. |
It works for me.Thanks very much! @longdt |
here is also a PR part of this fix, it will be merged soon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have simple solidity contract:
when I run:
mvn web3j:generate-sources -e -X
command I got error:class org.json.simple.JSONArray cannot be cast to class java.lang.String (org.json.simple.JSONArray is in unnamed module of loader org.codehaus.plexus.classworlds.realm.ClassRealm @51dbd6e4; java.lang.String is in module java.base of loader 'bootstrap')
Digging more plugin log, I found some change from result json of solidity compiler 0.8.x
Specifically,
abi
field change data type fromstring
(in version <= 0.7.x) to array (in version 0.8.x), so it cause following code in classJavaClassGeneratorMojo
throws casting exceptionList<AbiDefinition> functionDefinitions = loadContractDefinition(results.get(SolidityCompiler.Options.ABI.getName()));
or
String abiJson = contractResult.get(SolidityCompiler.Options.ABI.getName());
The text was updated successfully, but these errors were encountered: