-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
if [ "$#" -lt 4 ]; then | ||
echo "Usage: $0 network sender verify script_name [sig] [sig_params...]" | ||
exit 1 | ||
fi | ||
|
||
NETWORK=$1 | ||
SENDER=$2 | ||
VERIFY=$3 | ||
SCRIPT=$4 | ||
|
||
# Check if the SIG which is $5 is provided and if it is then include SIG_PARAMS too | ||
if [[ "$5" != "" && "$5" != -* ]]; then | ||
SIG=$5 | ||
shift 5 | ||
SIG_PARAMS=("$@") | ||
fi | ||
|
||
# forge command | ||
COMMAND="forge script \"$SCRIPT\" --broadcast -i 1 -f \"$NETWORK\" --sender \"$SENDER\"" | ||
|
||
if [ "$VERIFY" -eq 1 ]; then | ||
COMMAND="$COMMAND --verify" | ||
fi | ||
|
||
if [ ! -z "$SIG" ]; then | ||
COMMAND="$COMMAND -s \"$SIG\"" | ||
if [ ! -z "${SIG_PARAMS[*]}" ]; then | ||
for PARAM in "${SIG_PARAMS[@]}"; do | ||
COMMAND="$COMMAND \"$PARAM\"" | ||
done | ||
fi | ||
fi | ||
|
||
eval $COMMAND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters