@@ -233,7 +233,7 @@ if ${onlineMode}; then
233233 errorMsg=$( jq -r .errorMsg <<< ${signerJSON} 2> /dev/null)
234234 echo -e " \e[0m Anchor-Data: ${iconYes} \e[32m JSONLD structure is ok\e[0m" ;
235235 if [[ " ${errorMsg} " != " " ]]; then echo -e " \e[0m Notice: ${iconNo} ${errorMsg} \e[0m" ; fi
236- authors=$( jq -r --arg iconYes " ${iconYes} " --arg iconNo " ${iconNo} " ' .authors[] | "\\e[0m Signature: \(if .valid then $iconYes else $iconNo end) \(.name)\\e[0m"' <<< ${signerJSON} 2> /dev/null)
236+ authors=$( jq -r --arg iconYes " ${iconYes} " --arg iconNo " ${iconNo} " ' .authors[] | "\\e[0m Signature: \(if .valid then $iconYes else $iconNo end) \(.name) (PubKey \(.publicKey)) \\e[0m"' <<< ${signerJSON} 2> /dev/null)
237237 if [[ " ${authors} " != " " ]]; then echo -e " ${authors} \e[0m" ; fi
238238 fi
239239 echo
@@ -290,7 +290,7 @@ case ${workMode} in
290290 if [[ ${govActionUTXO} != " " && ${govActionIdx} != " " ]]; then
291291 actionStateJSON=$( jq -r " . | select(.actionId.txId == \" ${govActionUTXO} \" and .actionId.govActionIx == ${govActionIdx} )" 2> /dev/null <<< " ${actionStateJSON}" )
292292 if [[ " ${actionStateJSON} " = " " ]]; then # action-id not on chain
293- echo -e " \e[0mThe provided Action-ID is\e[33m NOT present on the chain\e[0m!\e[0m\n" ;
293+ echo -e " \e[0mThe provided Action-ID is\e[33m NOT present (wrong ID or expired) on the chain \e[0m!\e[0m\n" ;
294294 exit 1;
295295 fi
296296 fi
627627 else
628628 errorMsg=$( jq -r .errorMsg <<< ${signerJSON} 2> /dev/null)
629629 echo -e " \e[0m Anchor-Data: ${iconYes} \e[32m JSONLD structure is ok\e[0m" ;
630- govActionTitle= $( jq -r " .body.title // \"\" " ${tmpAnchorContent} 2> /dev/null)
630+ { read govActionTitle; read proofDepositReturnAddr ; read proofWithdrawalAddr ; } <<< $( jq -r ' .body.title // "-", .body.onChain.depositReturnAddress // "-", .body.onChain.withdrawals[0].withdrawalAddress // "-" ' ${tmpAnchorContent} 2> /dev/null)
631631 if [[ " ${errorMsg} " != " " ]]; then echo -e " \e[0m Notice: ${iconNo} ${errorMsg} \e[0m" ; fi
632- authors=$( jq -r --arg iconYes " ${iconYes} " --arg iconNo " ${iconNo} " ' .authors[] | "\\e[0m Signature: \(if .valid then $iconYes else $iconNo end) \(.name)\\e[0m"' <<< ${signerJSON} 2> /dev/null)
632+ authors=$( jq -r --arg iconYes " ${iconYes} " --arg iconNo " ${iconNo} " ' .authors[] | "\\e[0m Signature: \(if .valid then $iconYes else $iconNo end) \(.name) (PubKey \(.publicKey)) \\e[0m"' <<< ${signerJSON} 2> /dev/null)
633633 if [[ " ${authors} " != " " ]]; then echo -e " ${authors} \e[0m" ; fi
634634 fi
635635 fi
679679 ;;
680680 esac
681681
682+ # Show an alert if there is a special proof for the deposit return address and it does not match up with the one in the action
683+ if [[ " ${proofDepositReturnAddr} " != " -" ]]; then
684+ if [[ " ${proofDepositReturnAddr} " == " ${actionDepositAddr} " ]]; then
685+ echo -e " \e[0m${iconYes} The Deposit Return-StakeAddr in the govAction is the same as in the metadata proof!\e[0m\n" ;
686+ else
687+ echo -e " \e[0m${iconNo} The Deposit Return-StakeAddr in the govAction is not the same as in the metadata proof!\e[0m\n" ;
688+ fi
689+ fi
690+
682691 # Show governance action title if available
683- if [[ " ${govActionTitle} " != " " ]]; then
692+ if [[ " ${govActionTitle} " != " - " ]]; then
684693 echo -e " \e[0mAction-Title: \e[36m${govActionTitle} \e[0m\n"
685694 fi
686695
946955 # ],
947956 # null
948957 # ]
949- { read withdrawalsAmount; read withdrawalsKeyType; read withdrawalsHash; read withdrawalsNetwork; } <<< $( jq -r ' .[0][0][1] // "0", (.[0][0][0].credential|keys[0]) // "-", (.[0][0][0].credential|flatten[0]) // "-", .[0][0][0].network // "-"' 2> /dev/null <<< ${actionContents} )
950- echo -e " \e[0mAction-Content:\e[36m Withdrawal funds from the treasury\n\e[0m"
951-
952- case " ${withdrawalsNetwork,,}${withdrawalsKeyType,,} " in
953-
954- * " scripthash" ) echo -e " \e[0mWithdrawal to\e[32m ScriptHash \e[0m► \e[94m${withdrawalsHash} \e[0m"
955- ;;
956958
957- " mainnet" * ) withdrawalsAddr=$( ${bech32_bin} " stake" <<< " e1${withdrawalsHash}" 2> /dev/null) ;
958- if [[ $? -ne 0 ]]; then echo -e " \n\e[35mERROR - Could not get Withdrawals Stake-Address from KeyHash '${withdrawalsHash} ' !\n\e[0m" ; exit 1; fi
959- echo -e " \e[0mWithdrawal to\e[32m StakeAddr \e[0m► \e[94m${withdrawalsAddr} \e[0m"
960- ;;
961-
962- " testnet" * ) withdrawalsAddr=$( ${bech32_bin} " stake_test" <<< " e0${withdrawalsHash}" 2> /dev/null) ;
963- if [[ $? -ne 0 ]]; then echo -e " \n\e[35mERROR - Could not get Withdrawals Stake-Address from KeyHash '${withdrawalsHash} ' !\n\e[0m" ; exit 1; fi
964- echo -e " \e[0mWithdrawal to\e[32m StakeAddr \e[0m► \e[94m${withdrawalsAddr} \e[0m"
965- ;;
966-
967- " " ) echo -e " \e[0mWithdrawal \e[32mdirectly\e[0m to the \e[94mDeposit-Return-Address\n\e[0m"
968- ;;
959+ { read withdrawalEntries; read withdrawalCounts; } <<< $( jq -r ' "\(.[0])" // "[]", (.[0]|length) // 0' <<< ${actionContents} 2> /dev/null)
960+ echo -e " \e[0mAction-Content:\e[36m Withdrawal funds from the treasury\n\e[0m"
969961
970- * ) echo -e " \n\e[35mERROR - Unknown network type ${withdrawalsNetwork} for the Withdrawal KeyHash !\n\e[0m" ; exit 1;
971- ;;
972- esac
973- echo -e " \e[0mWithdrawal the\e[32m Amount \e[0m► \e[94m$( convertToADA ${withdrawalsAmount} ) ADA / ${withdrawalsAmount} lovelaces\e[0m"
974- echo -e " \e[0m"
962+ # Show all found entries
963+ for (( tmpCnt3 = 0 ; tmpCnt3 < ${withdrawalCounts} ; tmpCnt3 ++ ))
964+ do
965+ { read withdrawalsAmount; read withdrawalsKeyType; read withdrawalsHash; read withdrawalsNetwork; } <<< $( jq -r " .[${tmpCnt3} ][1] // 0, (.[${tmpCnt3} ][0].credential|keys[0]) // null, (.[${tmpCnt3} ][0].credential|flatten[0]) // null, .[${tmpCnt3} ][0].network // null" 2> /dev/null <<< ${withdrawalEntries} )
966+ case " ${withdrawalsNetwork,,}${withdrawalsKeyType,,} " in
967+
968+ * " scripthash" ) echo -e " \e[0mWithdrawal to\e[32m ScriptHash \e[0m► \e[94m${withdrawalsHash} \e[0m"
969+ ;;
970+
971+ " mainnet" * ) withdrawalsAddr=$( ${bech32_bin} " stake" <<< " e1${withdrawalsHash}" 2> /dev/null) ;
972+ if [[ $? -ne 0 ]]; then echo -e " \n\e[35mERROR - Could not get Withdrawals Stake-Address from KeyHash '${withdrawalsHash} ' !\n\e[0m" ; exit 1; fi
973+ echo -e " \e[0mWithdrawal to\e[32m StakeAddr \e[0m► \e[94m${withdrawalsAddr} \e[0m"
974+ ;;
975+
976+ " testnet" * ) withdrawalsAddr=$( ${bech32_bin} " stake_test" <<< " e0${withdrawalsHash}" 2> /dev/null) ;
977+ if [[ $? -ne 0 ]]; then echo -e " \n\e[35mERROR - Could not get Withdrawals Stake-Address from KeyHash '${withdrawalsHash} ' !\n\e[0m" ; exit 1; fi
978+ echo -e " \e[0mWithdrawal to\e[32m StakeAddr \e[0m► \e[94m${withdrawalsAddr} \e[0m"
979+ ;;
980+
981+ " " ) echo -e " \e[0mWithdrawal \e[32mdirectly\e[0m to the \e[94mDeposit-Return-Address\n\e[0m"
982+ withdrawalsAddr=" ${actionDepositAddr} "
983+ ;;
984+
985+ * ) echo -e " \n\e[35mERROR - Unknown network type ${withdrawalsNetwork} for the Withdrawal KeyHash !\n\e[0m" ; exit 1;
986+ ;;
987+ esac
988+ echo -e " \e[0mWithdrawal the\e[32m Amount \e[0m► \e[94m$( convertToADA ${withdrawalsAmount} ) ADA / ${withdrawalsAmount} lovelaces\e[0m"
989+ echo -e " \e[0m"
990+ done
991+
992+ # Show an alert if there is a special proof for the withdrawal address and it does not match up with the one in the action
993+ if [[ " ${proofWithdrawalAddr} " != " -" ]]; then
994+ if [[ " ${proofWithdrawalAddr} " == " ${withdrawalsAddr} " ]]; then
995+ echo -e " \e[0m${iconYes} The Withdrawal StakeAddr in the govAction is the same as in the metadata proof!\e[0m\n" ;
996+ else
997+ echo -e " \e[0m${iconNo} The Withdrawal StakeAddr in the govAction is not the same as in the metadata proof!\e[0m\n" ;
998+ fi
999+ fi
9751000
9761001 # Calculate acceptance: Get the right threshold, make it a nice percentage number, check if threshold is reached
9771002 { read dRepPowerThreshold; } <<< $( jq -r ' .dRepVotingThresholds.treasuryWithdrawal // 0' <<< " ${protocolParametersJSON}" 2> /dev/null)
0 commit comments