Build script for solidity contracts

* added simple script that compiles .sol contracts and generates java
  code for them
This commit is contained in:
Teemu Patja 2017-08-19 14:11:46 +03:00
parent 4d6d925772
commit 7c39d6940e
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C

15
build_contracts.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash -eu
SOLC=$(which solc)
WEB3J=$(which web3j)
# compile contracts
for f in contracts/*.sol; do
$SOLC $f --bin --abi --optimize -o resources/contracts
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