lotus/itests/contracts/compile.sh
snissn 9060c474da
test: fevm: add in tests for deploying, destroying contracts, recursive calls, sending value (#10082)
adds the following tests to itests/fevm_test.go:
 - recursive tests
 - delegate call tests
 - delegate call recursive tests
 - revert tests
 - destruct tests
 - contract deploy address tests
 - send value to contracts
 - gas limit on value transfer tests
 - sending value to destroyed contracts
adds the test to itests/fevm_address_test.go:
 - deploy contract and confirm address is different second deploy
2023-01-31 19:13:13 -10:00

20 lines
745 B
Bash
Executable File

set -eu
set -o pipefail
#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
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