Skip to content

Commit

Permalink
Avoid variable name clash
Browse files Browse the repository at this point in the history
  • Loading branch information
duncancmt committed Dec 19, 2024
1 parent 8f7aab2 commit df014f2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions sh/common_safe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,26 @@ declare -r eip712_message_json_template='{
"nonce": $nonce | tonumber'

eip712_json() {
declare -r calldata="$1"
declare -r _eip712_json_calldata="$1"
shift

declare -i operation
declare -i _eip712_json_operation
if (( $# > 0 )) ; then
operation="$1"
_eip712_json_operation="$1"
shift
else
operation=0
_eip712_json_operation=0
fi
declare -r -i operation
declare -r -i _eip712_json_operation

declare to
declare _eip712_json_to
if (( $# > 0 )) ; then
to="$1"
_eip712_json_to="$1"
shift
else
to="$(target $operation)"
_eip712_json_to="$(target $_eip712_json_operation)"
fi
declare -r to
declare -r _eip712_json_to

jq -Mc \
'
Expand Down Expand Up @@ -181,9 +181,9 @@ eip712_json() {
' \
--arg verifyingContract "$safe_address" \
--arg chainId "$chainid" \
--arg to "$to" \
--arg data "$calldata" \
--arg operation $operation \
--arg to "$_eip712_json_to" \
--arg data "$_eip712_json_calldata" \
--arg operation $_eip712_json_operation \
--arg nonce $(nonce) \
<<<'{}'
}
Expand Down

0 comments on commit df014f2

Please sign in to comment.