open-bounty/contracts/build.sh

24 lines
588 B
Bash
Raw Normal View History

#!/bin/bash -eu
2018-05-02 00:26:45 +00:00
function print_dependency_message
{
echo "error: " $1 "must already be installed!"
}
SOLC=$(which solc) || print_dependency_message "solc"
WEB3J=$(which web3j) || print_dependency_message "web3"
2017-11-10 10:22:58 +00:00
rm -f resources/contracts/*.{abi,bin}
# compile contracts
2018-05-02 00:26:45 +00:00
for f in {TokenReg,MultiSigTokenWallet*}.sol; do
$SOLC $f --overwrite --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.eth.contracts
done