File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -425,6 +425,21 @@ validate_nonce() {
425425 fi
426426}
427427
428+ # Utility function to warn the user if the transaction includes a delegate call.
429+ warn_if_delegate_call () {
430+ local operation=" $1 "
431+ # Warn the user if `operation` equals `1`, implying a `delegatecall`.
432+ # See: https://github.com/safe-global/safe-smart-account/blob/34359e8305d618b7d74e39ed370a6b59ab14f827/contracts/libraries/Enum.sol.
433+ if [[ " $operation " -eq 1 ]]; then
434+ echo
435+ cat << EOF
436+ ${BOLD}${RED} WARNING: The transaction includes a delegate call!
437+ This may lead to unexpected behaviour or vulnerabilities.
438+ Please review it carefully before you sign!${RESET}
439+ EOF
440+ fi
441+ }
442+
428443# Utility function to validate the message file.
429444validate_message_file () {
430445 local message_file=" $1 "
606621 local nonce=$( echo " $response " | jq -r " .results[$idx ].nonce // \" 0\" " )
607622 local data_decoded=$( echo " $response " | jq -r " .results[$idx ].dataDecoded // \" 0x\" " )
608623
624+ # Warn the user if the transaction includes a delegate call.
625+ warn_if_delegate_call " $operation "
626+
609627 # Calculate and display the hashes.
610628 echo " ==================================="
611629 echo " = Selected Network Configurations ="
You can’t perform that action at this time.
0 commit comments