-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate-proxy-reference-script.sh
More file actions
executable file
·36 lines (29 loc) · 1 KB
/
create-proxy-reference-script.sh
File metadata and controls
executable file
·36 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# A helper script for showing how to store the scripts on chain as reference scripts.
## Variables
mainDir="../../../ignored/"
walletDir="${mainDir}wallets/"
optionsDir="${mainDir}options-files/"
tmpDir="${mainDir}tmp/"
scriptFile="${optionsDir}proxy.plutus"
## Export the script.
echo "Exporting the proxy script..."
cardano-options scripts \
--proxy-script \
--out-file $scriptFile
## Create and submit the transaction.
cardano-cli transaction build \
--tx-in 78574de69b6305bf9bf4546ab049b471cacea3c8f8888b4bbc94ea16a8347a4e#0 \
--tx-out "$(cat "${walletDir}01.addr") + 4000000 lovelace" \
--tx-out-reference-script-file $scriptFile \
--change-address "$(cat "${walletDir}01.addr")" \
--testnet-magic 1 \
--out-file "${tmpDir}tx.body"
cardano-cli transaction sign \
--tx-body-file "${tmpDir}tx.body" \
--signing-key-file "${walletDir}/01.skey" \
--testnet-magic 1 \
--out-file "${tmpDir}tx.signed"
cardano-cli transaction submit \
--testnet-magic 1 \
--tx-file "${tmpDir}tx.signed"