dxod repo init

This commit is contained in:
tim
2025-09-15 14:21:56 -04:00
commit 5fb2b17b2e
18 changed files with 4996 additions and 0 deletions

49
bin/mock Executable file
View File

@@ -0,0 +1,49 @@
#!/bin/bash
# Function to cleanup processes
cleanup() {
kill $ANVIL_PID 2>/dev/null
}
# Set up trap to handle script exit
trap cleanup EXIT
# Create log directory if it doesn't exist
mkdir -p log
# Run anvil in background and redirect output to log file
anvil | tee log/anvil.txt &
ANVIL_PID=$!
# Function to check if string exists in file
check_string() {
grep -q "$1" "$2"
return $?
}
# Wait for anvil to start (max 30 seconds)
echo "Waiting for anvil to start..."
counter=0
while ! check_string "Listening on" "log/anvil.txt"; do
sleep 1
counter=$((counter + 1))
if [ $counter -ge 5 ]; then
echo "Timeout waiting for anvil to start"
exit 1
fi
done
# Extract bytecode using jq
BYTECODE=$(jq -r '.bytecode.object' out/PartyPool.sol/PartyPool.json)
if [ $? -ne 0 ] || [ -z "$BYTECODE" ]; then
echo "Failed to extract bytecode from PartyPool.json"
exit 1
fi
export BYTECODE
forge script DeployMock --broadcast
echo "Press Ctrl+C to exit..."
while true; do
sleep 1
done