Skip to content

Commit

Permalink
feat: add solidity compile script (#5340)
Browse files Browse the repository at this point in the history
  • Loading branch information
LesnyRumcajs authored Feb 25, 2025
1 parent 765b1d6 commit 6e0dc6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/tool/subcommands/api_cmd/contracts/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# This script compiles all the Solidity files in the current directory and
# generates the corresponding files with the compiled bytecode in hexadecimal
# format.

set -euo pipefail

find . -maxdepth 1 -type f -name "*.sol" -print0 | while IFS= read -r -d '' file; do
base_name="${file%.sol}"
solc --bin "$file" | tail -n 1 | tr -d '\n' > "$base_name.hex"
done
2 changes: 1 addition & 1 deletion src/tool/subcommands/api_cmd/contracts/invoke_cthulhu.hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
60806040525f5f5f6101000a81548160ff0219169083151502179055503480156026575f5ffd5b5061010e806100345f395ff3fe6080604052348015600e575f5ffd5b50600436106030575f3560e01c80635bf737e41460345780636572e3c514603c575b5f5ffd5b603a6056565b005b60426071565b604051604d9190609a565b60405180910390f35b60015f5f6101000a81548160ff021916908315150217905550565b5f5f9054906101000a900460ff1681565b5f8115159050919050565b6094816082565b82525050565b5f60208201905060ab5f830184608d565b9291505056fea264697066735822122005df6924d37f738c31eba559d6df942fcd07bc1d8a2c1300c0e09516b536df6f64736f6c637829302e382e32382d646576656c6f702e323032342e31302e31302b636f6d6d69742e3738393336313461005a
60806040525f5f5f6101000a81548160ff0219169083151502179055503480156026575f5ffd5b5061010e806100345f395ff3fe6080604052348015600e575f5ffd5b50600436106030575f3560e01c80635bf737e41460345780636572e3c514603c575b5f5ffd5b603a6056565b005b60426071565b604051604d9190609a565b60405180910390f35b60015f5f6101000a81548160ff021916908315150217905550565b5f5f9054906101000a900460ff1681565b5f8115159050919050565b6094816082565b82525050565b5f60208201905060ab5f830184608d565b9291505056fea264697066735822122005df6924d37f738c31eba559d6df942fcd07bc1d8a2c1300c0e09516b536df6f64736f6c637829302e382e32382d646576656c6f702e323032342e31302e31302b636f6d6d69742e3738393336313461005a

0 comments on commit 6e0dc6e

Please sign in to comment.