Skip to content

Commit feabcb9

Browse files
committed
Update 2025-05 - cli10.9.0.0 and guardrails-script integration
- a lot of changes to be compatible with cli 10.9.0.0 - added offline calculation for guardrails plutus script execution costs - enabling of the governance action submit for `treasury withdrawal` and `parameter change` actions. which both require the precalculation of the execution costs - introduction of collateral utxo handling for script `25b_regAction.sh` - renaming of CIP105 drep ids from `regular` to `legacy` - min. cli version is now 10.9.0.0 - min. node version is now 10.3.1
1 parent c0225dc commit feabcb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+499
-397
lines changed

cardano/mainnet/00_common.sh

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ cardanometa="./token-metadata-creator" #Path to your token-metadata-creator bina
7171
koiosApiToken=""
7272

7373

74+
#--------- Only needed if you wanna change the default path to the guardrail-script.plutus file
75+
#guardrailsScriptFile="./guardrails-script.plutus" (Default)
76+
77+
7478
#--------- Only needed if you wanna change the BlockChain from the Mainnet to a Testnet Chain Setup, uncomment the network you wanna use by removing the leading #
7579
# Using a preconfigured network name automatically loads and sets the magicparam, addrformat and byronToShelleyEpochs parameters, also API-URLs, etc.
7680

@@ -190,8 +194,6 @@ case "${network,,}" in
190194
_adahandleAPI="https://api.handle.me" #Adahandle-API URLs -> autoresolve into ${adahandleAPI}
191195
_catalystAPI="https://api.projectcatalyst.io/api/v1" #Catalyst-API URLs -> autoresolve into ${catalystAPI}
192196
_lightModeParametersURL="https://uptime.live/data/cardano/parms/mainnet-parameters.json" #Parameters-JSON-File with current informations about cardano-cli version, tip, era, protocol-parameters
193-
_guardrailScriptUTXO="dc06746a898fd230f164f47a3d749348b65655b8fb388ff275f54d62891653e2#0"
194-
_guardrailScriptSize=2132
195197
_ccMemberColdHashNames='{
196198
"scriptHash-349e55f83e9af24813e6cb368df6a80d38951b2a334dfcdf26815558": "CAC",
197199
"scriptHash-84aebcfd3e00d0f87af918fc4b5e00135f407e379893df7e7d392c6a": "ECC",
@@ -240,8 +242,6 @@ case "${network,,}" in
240242
_adahandleAPI="https://preview.api.handle.me" #Adahandle-API URLs -> autoresolve into ${adahandleAPI}
241243
_catalystAPI= #Catalyst-API URLs -> autoresolve into ${catalystAPI}
242244
_lightModeParametersURL="https://uptime.live/data/cardano/parms/preview-parameters.json" #Parameters-JSON-File with current informations about cardano-cli version, tip, era, protocol-parameters
243-
_guardrailScriptUTXO="f3f61635034140e6cec495a1c69ce85b22690e65ab9553ef408d524f58183649#0"
244-
_guardrailScriptSize=2132
245245
_ccMemberColdHashNames='{}'
246246
;;
247247

@@ -274,8 +274,6 @@ case "${network,,}" in
274274
_adahandleAPI=
275275
_catalystAPI= #Catalyst-API URLs -> autoresolve into ${catalystAPI}
276276
_lightModeParametersURL="https://uptime.live/data/cardano/parms/sanchonet-parameters.json" #Parameters-JSON-File with current informations about cardano-cli version, tip, era, protocol-parameters
277-
# _guardrailScriptUTXO="8b9163fa38914b45470a5426c27939cfb77628f0c54d08b0b61b9905c2cbfc2b#0"
278-
_guardrailScriptSize=2132
279277
_ccMemberColdHashNames='{}'
280278
;;
281279

@@ -309,8 +307,7 @@ adahandlePolicyID=${adahandlePolicyID:-"${_adahandlePolicyID}"}
309307
adahandleAPI=${adahandleAPI:-"${_adahandleAPI}"}
310308
catalystAPI=${catalystAPI:-"${_catalystAPI}"}
311309
lightModeParametersURL=${lightModeParametersURL:-"${_lightModeParametersURL}"}
312-
guardrailScriptUTXO=${guardrailScriptUTXO:-"${_guardrailScriptUTXO}"}
313-
guardrailScriptSize=${guardrailScriptSize:-"${_guardrailScriptSize}"}
310+
guardrailsScriptFile=${guardrailsScriptFile:-"./guardrails-script.plutus"}
314311
ccMemberColdHashNames=${ccMemberColdHashNames:-"${_ccMemberColdHashNames}"}
315312

316313

@@ -325,15 +322,15 @@ if [[ "${adahandleAPI: -1}" == "/" ]]; then adahandleAPI=${adahandleAPI%?}; fi #
325322
if [[ "${magicparam}" == "" || ${addrformat} == "" || ${byronToShelleyEpochs} == "" ]]; then majorError "The 'magicparam', 'addrformat' or 'byronToShelleyEpochs' is not set!\nOr maybe you have set the wrong parameter network=\"${network}\" ?\nList of preconfigured network-names: ${networknames}"; exit 1; fi
326323

327324
#Don't allow to overwrite the needed Versions, so we set it after the overwrite part
328-
minCliVersion="10.4.0" #minimum allowed cli version for this script-collection version
325+
minCliVersion="10.9.0" #minimum allowed cli version for this script-collection version
329326
maxCliVersion="99.99.9" #maximum allowed cli version, 99.99.9 = no limit so far
330-
minNodeVersion="10.1.4" #minimum allowed node version for this script-collection version
327+
minNodeVersion="10.3.1" #minimum allowed node version for this script-collection version
331328
maxNodeVersion="99.99.9" #maximum allowed node version, 99.99.9 = no limit so far
332329
minLedgerCardanoAppVersion=${ENV_MINLEDGERCARDANOAPPVERSION:-"7.1.4"} #minimum version for the cardano-app on the Ledger HW-Wallet
333330
minTrezorCardanoAppVersion="2.7.2" #minimum version for the firmware on the Trezor HW-Wallet
334331
minKeystoneCardanoAppVersion="1.7.7" #minimum version for the firmware on the Keystone HW-Wallet
335-
minHardwareCliVersion="1.17.0" #minimum version for the cardano-hw-cli
336-
minCardanoSignerVersion="1.24.0" #minimum version for the cardano-signer binary
332+
minHardwareCliVersion="1.18.2" #minimum version for the cardano-hw-cli
333+
minCardanoSignerVersion="1.24.3" #minimum version for the cardano-signer binary
337334
minCatalystToolboxVersion="0.5.0" #minimum version for the catalyst-toolbox binary
338335

339336
#Defaults - Variables and Constants
@@ -2126,7 +2123,7 @@ resolveAdahandle() {
21262123
#now lets verify that the adahandle native asset is actually on an utxo of that resolved address
21272124
showProcessAnimation "Verify Adahandle is on resolved address: " &
21282125
case ${workMode} in
2129-
"online") utxo=$(${cardanocli} ${cliEra} query utxo --address ${resolvedAddr} 2> /dev/stdout);
2126+
"online") utxo=$(${cardanocli} ${cliEra} query utxo --output-text --address ${resolvedAddr} 2> /dev/stdout);
21302127
if [ $? -ne 0 ]; then stopProcessAnimation; echo -e "\e[35mERROR - ${utxo}\e[0m\n"; exit 1; else stopProcessAnimation; fi;;
21312128
"light") utxo=$(queryLight_UTXO "${resolvedAddr}");
21322129
if [ $? -ne 0 ]; then stopProcessAnimation; echo -e "\e[35mERROR - ${utxo}\e[0m\n"; exit 1; else stopProcessAnimation; fi;;
@@ -2197,7 +2194,7 @@ resolveAdahandle() {
21972194
#now lets verify that the adahandle native asset is actually on an utxo of that resolved address
21982195
showProcessAnimation "Verify Adahandle is on resolved address: " &
21992196
case ${workMode} in
2200-
"online") utxo=$(${cardanocli} ${cliEra} query utxo --address ${resolvedAddr} 2> /dev/stdout);
2197+
"online") utxo=$(${cardanocli} ${cliEra} query utxo --output-text --address ${resolvedAddr} 2> /dev/stdout);
22012198
if [ $? -ne 0 ]; then stopProcessAnimation; echo -e "\e[35mERROR - ${utxo}\e[0m\n"; exit 1; else stopProcessAnimation; fi;;
22022199
"light") utxo=$(queryLight_UTXO "${resolvedAddr}");
22032200
if [ $? -ne 0 ]; then stopProcessAnimation; echo -e "\e[35mERROR - ${utxo}\e[0m\n"; exit 1; else stopProcessAnimation; fi;;

cardano/mainnet/01_claimRewards.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -397,14 +397,14 @@ if [[ "${sendFromAddr}" == "${sendToAddr}" ]]; then rxcnt="1"; else rxcnt="2"; e
397397
case "${drepDelegationHASH%%-*}" in
398398
"keyHash") drepID=$(${bech32_bin} "drep" <<< "${drepDelegationHASH##*-}" 2> /dev/null)
399399
echo -e "${iconYes} \e[0mVoting-Power of Staking Address is delegated to the following DRep:\e[0m";
400-
echo -e "\e[0m Regular DRep-ID: \e[32m${drepID}\e[0m"
401400
echo -e "\e[0m CIP129 DRep-ID: \e[33m$(convert_actionBech2CIP129 "${drepID}")\e[0m"
401+
echo -e "\e[0m Legacy DRep-ID: \e[32m${drepID}\e[0m"
402402
echo -e "\e[0m DRep-HASH:\e[94m ${drepDelegationHASH##*-}\e[0m"
403403
;;
404404
"scriptHash") drepID=$(${bech32_bin} "drep_script" <<< "${drepDelegationHASH##*-}" 2> /dev/null)
405405
echo -e "${iconYes} \e[0mVoting-Power of Staking Address is delegated to the following DRep-Script:\e[0m";
406-
echo -e "\e[0m Regular DRep-ID: \e[32m${drepID}\e[0m"
407406
echo -e "\e[0m CIP129 DRep-ID: \e[33m$(convert_actionBech2CIP129 "${drepID}")\e[0m"
407+
echo -e "\e[0m Legacy DRep-ID: \e[32m${drepID}\e[0m"
408408
echo -e "\e[0m DRep-HASH:\e[94m ${drepDelegationHASH##*-}\e[0m"
409409
;;
410410
"null") #not delegated
@@ -458,7 +458,7 @@ echo -e "________________________________________________\n"
458458
#check that the node is fully synced, otherwise the query would mabye return a false state
459459
if [[ $(get_currentSync) != "synced" ]]; then echo -e "\e[35mError - Node not fully synced or not running, please let your node sync to 100% first !\e[0m\n"; exit 1; fi
460460
showProcessAnimation "Query-UTXO: " &
461-
utxo=$(${cardanocli} ${cliEra} query utxo --address ${sendFromAddr} 2> /dev/stdout);
461+
utxo=$(${cardanocli} ${cliEra} query utxo --output-text --address ${sendFromAddr} 2> /dev/stdout);
462462
if [ $? -ne 0 ]; then stopProcessAnimation; echo -e "\e[35mERROR - ${utxo}\e[0m\n"; exit $?; else stopProcessAnimation; fi;
463463
if [[ ${skipUtxoWithAsset} != "" ]]; then utxo=$(echo "${utxo}" | egrep -v "${skipUtxoWithAsset}" ); fi #if its set to keep utxos that contains certain policies, filter them out
464464
if [[ ${onlyUtxoWithAsset} != "" ]]; then utxo=$(echo "${utxo}" | egrep "${onlyUtxoWithAsset}" ); utxo=$(echo -e "Header\n-----\n${utxo}"); fi #only use given utxos. rebuild the two header lines
@@ -639,11 +639,11 @@ if [[ ${rxcnt} == 1 ]]; then
639639
fi
640640

641641
#calculate the transaction fee. new parameters since cardano-cli 8.21.0
642-
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 2 --reference-script-size 0 2> /dev/stdout)
642+
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --output-text --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 2 --reference-script-size 0 2> /dev/stdout)
643643
if [ $? -ne 0 ]; then echo -e "\n\e[35m${fee}\e[0m\n"; exit 1; fi
644644
fee=${fee%% *} #only get the first part of 'xxxxxx Lovelaces'
645645

646-
echo -e "\e[0mMimimum transfer Fee for ${txcnt}x TxIn & ${rxcnt}x TxOut & Withdrawal: \e[32m $(convertToADA ${fee}) ADA / ${fee} lovelaces \e[90m"
646+
echo -e "\e[0mMinimum transfer Fee for ${txcnt}x TxIn & ${rxcnt}x TxOut & Withdrawal: \e[32m $(convertToADA ${fee}) ADA / ${fee} lovelaces \e[90m"
647647

648648
#If only one address (paying for the fees and also receiving the rewards)
649649
#If two different addresse (fromAddr is paying for the fees, toAddr is getting the rewards)
@@ -752,7 +752,7 @@ if [ "${ENV_SKIP_PROMPT}" == "YES" ] || ask "\n\e[33mDoes this look good for you
752752
echo -e "\e[32mDONE\n"
753753

754754
#Show the TxID
755-
txID=$(${cardanocli} ${cliEra} transaction txid --tx-file ${txFile}); echo -e "\e[0m TxID is: \e[32m${txID}\e[0m"
755+
txID=$(${cardanocli} ${cliEra} transaction txid --output-text --tx-file ${txFile}); echo -e "\e[0m TxID is: \e[32m${txID}\e[0m"
756756
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi;
757757
if [[ "${transactionExplorer}" != "" ]]; then echo -e "\e[0mTracking: \e[32m${transactionExplorer}/${txID}\n\e[0m"; fi
758758
;;

cardano/mainnet/01_queryAddress.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ if [[ ${typeOfAddr} == ${addrTypePayment} ]]; then #Enterprise and Base UTXO ad
6565
#check that the node is fully synced, otherwise the query would mabye return a false state
6666
if [[ $(get_currentSync) != "synced" ]]; then echo -e "\e[35mError - Node not fully synced or not running, please let your node sync to 100% first !\e[0m\n"; exit 1; fi
6767
showProcessAnimation "Query-UTXO: " &
68-
utxo=$(${cardanocli} ${cliEra} query utxo --address ${checkAddr} 2> /dev/stdout);
68+
utxo=$(${cardanocli} ${cliEra} query utxo --output-text --address ${checkAddr} 2> /dev/stdout);
6969
if [ $? -ne 0 ]; then stopProcessAnimation; echo -e "\e[35mERROR - ${utxo}\e[0m\n"; exit $?; else stopProcessAnimation; fi;
7070
fi
7171
showProcessAnimation "Convert-UTXO: " &
@@ -331,14 +331,14 @@ elif [[ ${typeOfAddr} == ${addrTypeStake} ]]; then #Staking Address
331331
case "${drepDelegationHASH%%-*}" in
332332
"keyHash") drepID=$(${bech32_bin} "drep" <<< "${drepDelegationHASH##*-}" 2> /dev/null)
333333
echo -e "${iconYes} \e[0mVoting-Power of Staking Address is delegated to the following DRep:\e[0m";
334-
echo -e "\e[0m Regular DRep-ID: \e[32m${drepID}\e[0m"
335334
echo -e "\e[0m CIP129 DRep-ID: \e[33m$(convert_actionBech2CIP129 "${drepID}")\e[0m"
335+
echo -e "\e[0m Legacy DRep-ID: \e[32m${drepID}\e[0m"
336336
echo -e "\e[0m DRep-HASH:\e[94m ${drepDelegationHASH##*-}\e[0m"
337337
;;
338338
"scriptHash") drepID=$(${bech32_bin} "drep_script" <<< "${drepDelegationHASH##*-}" 2> /dev/null)
339339
echo -e "${iconYes} \e[0mVoting-Power of Staking Address is delegated to the following DRep-Script:\e[0m";
340-
echo -e "\e[0m Regular DRep-ID: \e[32m${drepID}\e[0m"
341340
echo -e "\e[0m CIP129 DRep-ID: \e[33m$(convert_actionBech2CIP129 "${drepID}")\e[0m"
341+
echo -e "\e[0m Legacy DRep-ID: \e[32m${drepID}\e[0m"
342342
echo -e "\e[0m DRep-HASH:\e[94m ${drepDelegationHASH##*-}\e[0m"
343343
;;
344344
"null") #not delegated

cardano/mainnet/01_sendAssets.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ echo
406406
#check that the node is fully synced, otherwise the query would mabye return a false state
407407
if [[ $(get_currentSync) != "synced" ]]; then echo -e "\e[35mError - Node not fully synced or not running, please let your node sync to 100% first !\e[0m\n"; exit 1; fi
408408
showProcessAnimation "Query-UTXO: " &
409-
utxo=$(${cardanocli} ${cliEra} query utxo --address ${sendFromAddr} 2> /dev/stdout);
409+
utxo=$(${cardanocli} ${cliEra} query utxo --output-text --address ${sendFromAddr} 2> /dev/stdout);
410410
if [ $? -ne 0 ]; then stopProcessAnimation; echo -e "\e[35mERROR - ${utxo}\e[0m\n"; exit $?; else stopProcessAnimation; fi;
411411
if [[ ${skipUtxoWithAsset} != "" ]]; then utxo=$(echo "${utxo}" | egrep -v "${skipUtxoWithAsset}" ); fi #if its set to keep utxos that contains certain policies, filter them out
412412
if [[ ${onlyUtxoWithAsset} != "" ]]; then utxo=$(echo "${utxo}" | egrep "${onlyUtxoWithAsset}" ); utxo=$(echo -e "Header\n-----\n${utxo}"); fi #only use given utxos. rebuild the two header lines
@@ -677,7 +677,7 @@ ${cardanocli} ${cliEra} transaction build-raw ${txInString} --tx-out "${sendToAd
677677
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi
678678

679679
#calculate the transaction fee. new parameters since cardano-cli 8.21.0
680-
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 1 --reference-script-size 0 2> /dev/stdout)
680+
fee=$(${cardanocli} ${cliEra} transaction calculate-min-fee --output-text --tx-body-file ${txBodyFile} --protocol-params-file <(echo ${protocolParametersJSON}) --witness-count 1 --reference-script-size 0 2> /dev/stdout)
681681
if [ $? -ne 0 ]; then echo -e "\n\e[35m${fee}\e[0m\n"; exit 1; fi
682682
fee=${fee%% *} #only get the first part of 'xxxxxx Lovelaces'
683683

@@ -790,7 +790,7 @@ if [ "${ENV_SKIP_PROMPT}" == "YES" ] || ask "\n\e[33mDoes this look good for you
790790
echo -e "\e[32mDONE\n"
791791

792792
#Show the TxID
793-
txID=$(${cardanocli} ${cliEra} transaction txid --tx-file ${txFile}); echo -e "\e[0m TxID is: \e[32m${txID}\e[0m"
793+
txID=$(${cardanocli} ${cliEra} transaction txid --output-text --tx-file ${txFile}); echo -e "\e[0m TxID is: \e[32m${txID}\e[0m"
794794
checkError "$?"; if [ $? -ne 0 ]; then exit $?; fi;
795795
if [[ "${transactionExplorer}" != "" ]]; then echo -e "\e[0mTracking: \e[32m${transactionExplorer}/${txID}\n\e[0m"; fi
796796
;;

0 commit comments

Comments
 (0)