0

I'm trying to generate java wrapper class of solidity smart contract using truffle but not getting wrapperclass.java file enter image description here

Here is an command which i've used to generate abi/Json of that contract

anikett@anikett:~/myproject$ ls -l build/contracts/

total 104 -rw-r--r-- 1 anikett anikett 53703 Oct 16 12:12 Migrations.json -rw-r--r-- 1 anikett anikett 45796 Oct 16 12:12 Wallet.json

after that used this command which im using for geration of java wrapper class

anikett@anikett:~/myproject$ truffle generate ./build/contracts/Wallot.json -o . -p /home/anikett/Documents/workspace-sts-3.9.9.RELEASE/JavaEthereumConnectionExample/src/main/java/com/ethereum/connect.javaethereum.wrapper
1
  • Were you able to resolve this? I am facing same error. Sep 20, 2022 at 11:36

1 Answer 1

1

If you are trying to generate a Java smart contract wrapper you should use the web3j cli. You can still use truffles contract schema.

$ web3j truffle generate [--javaTypes|--solidityTypes] /path/to/<truffle-smart-contract-output>.json -o /path/to/src/main/java -p com.your.organisation.name

https://web3j.readthedocs.io/en/latest/smart_contracts.html

2
  • I tried but getting the same error. Unknown options: '--solidtyTypes', './build/contracts/SimpleStorage.json', '-o', '.', '-p', 'java Sep 20, 2022 at 11:41
  • web3j truffle generate --solidtyTypes ./build/contracts/SimpleStorage.json -o . -p java Sep 20, 2022 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.