2017-08-19 11:11:46 +00:00
|
|
|
#!/bin/bash -eu
|
|
|
|
|
|
|
|
SOLC=$(which solc)
|
|
|
|
WEB3J=$(which web3j)
|
|
|
|
|
|
|
|
# compile contracts
|
|
|
|
for f in contracts/*.sol; do
|
2017-08-20 08:45:43 +00:00
|
|
|
$SOLC $f --overwrite --bin --abi --optimize -o resources/contracts
|
2017-08-19 11:11:46 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# generate java classes
|
|
|
|
for f in resources/contracts/*.bin; do
|
|
|
|
abi=$(echo $f|sed s/\.bin/.abi/)
|
|
|
|
$WEB3J solidity generate $f $abi -o src/java -p commiteth.contracts
|
|
|
|
done
|