'How to generate wrapper code for existing contract with web3j?
I have a contract which I have compiled into the .bin and .abi files. However, generating the wrapper code for the contract like so:
web3j solidity generate -b ./Creation.bin -a ./Creation.abi -o ../../../java/ -p com.humboi.smart.contract
I get the following:
Unknown options: '-b', './Creation.bin', '-a', './Creation.abi', '-o', '../../../java/', '-p', 'com.humboi.smart.contract'
How to fix this?
Solution 1:[1]
You have to switch generate and solidity. Then, there are three required arguments --abiFile, --outputDir and --package.
This gives:
web3j generate solidity --abiFile abi.json --outputDir foo --package foo.bar
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Martin Monperrus |
