forked from chris-moreton/plutus-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmint.sh
executable file
·40 lines (31 loc) · 1.12 KB
/
mint.sh
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
37
38
39
### ./mint.sh minter Chess 1000 wallet2
source functions.sh
POLICY_NAME=$1
COIN_NAME=$2
let TOKEN_COUNT=$3*1000000
echo $TOKEN_COUNT
MINT_WALLET_NAME=$4
if [ ! -f "./policies/$POLICY_NAME.script" ]; then
./createPolicy.sh $POLICY_NAME
fi
POLICY_ID=$($CARDANO_CLI transaction policyid --script-file ./policies/$POLICY_NAME.script)
getInputTx $MINT_WALLET_NAME
FROM_UTXO=${SELECTED_UTXO}
FROM_WALLET_NAME=${SELECTED_WALLET_NAME}
FROM_WALLET_ADDRESS=${SELECTED_WALLET_ADDR}
$CARDANO_CLI transaction build \
--tx-in ${FROM_UTXO} \
--tx-out ${FROM_WALLET_ADDRESS}+$TOKEN_COUNT+"$TOKEN_COUNT ${POLICY_ID}.${COIN_NAME}" \
--change-address=${FROM_WALLET_ADDRESS} \
--mint="$TOKEN_COUNT ${POLICY_ID}.${COIN_NAME}" \
--mint-script-file="./policies/$POLICY_NAME.script" \
--testnet-magic ${TESTNET_MAGIC_NUM} \
--out-file tx.build \
--witness-override 2 \
--alonzo-era
$CARDANO_CLI transaction sign \
--tx-body-file tx.build \
--signing-key-file ./wallets/${FROM_WALLET_NAME}.skey \
--signing-key-file ./wallets/${POLICY_NAME}.skey \
--out-file tx.signed
$CARDANO_CLI transaction submit --tx-file tx.signed --testnet-magic $TESTNET_MAGIC_NUM