2023-02-01 05:13:13 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2023-01-16 17:06:25 +00:00
|
|
|
#use the solc compiler https://docs.soliditylang.org/en/v0.8.17/installing-solidity.html
|
|
|
|
# to compile all of the .sol files to their corresponding evm binary files stored as .hex
|
|
|
|
# solc outputs to stdout a format that we just want to grab the last line of and then remove the trailing newline on that line
|
2023-01-12 04:29:56 +00:00
|
|
|
|
2023-02-01 05:13:13 +00:00
|
|
|
find . -name \*.sol -print0 |
|
|
|
|
xargs -0 -I{} bash -euc -o pipefail 'solc --bin {} |tail -n1 | tr -d "\n" > $(echo {} | sed -e s/.sol$/.hex/)'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#for these contracts we have 2 contracts in the same solidity file
|
|
|
|
#this command grabs the correct bytecode for us
|
|
|
|
for filename in Constructor TestApp ValueSender ; do
|
|
|
|
echo $filename
|
|
|
|
solc --bin $filename.sol | tail -n5|head -n1 | tr -d "\n" > $filename.hex
|
|
|
|
done
|
|
|
|
|