Skip to content

Commit 035cb59

Browse files
committed
feat: flattened contracts
1 parent 27e6a55 commit 035cb59

6 files changed

+31177
-0
lines changed

flatten.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# Define the templates directory
4+
TEMPLATES_DIR="src/templates"
5+
FLATTENED_DIR="flattened"
6+
7+
# Create the flattened directory if it doesn't exist
8+
mkdir -p "$FLATTENED_DIR"
9+
10+
# Find all files ending with 'Template.sol' in the templates directory
11+
FILES=$(find "$TEMPLATES_DIR" -type f -name '*Template.sol')
12+
13+
# Loop through each file and run the flatten command
14+
for FILE in $FILES; do
15+
BASENAME=$(basename "$FILE" .sol)
16+
OUTPUT_FILE="${FLATTENED_DIR}/${BASENAME}.flattened.sol"
17+
forge flatten --output "$OUTPUT_FILE" "$FILE"
18+
done

0 commit comments

Comments
 (0)