txhash="d4dafc7bf86fca7034f8c7080d868c40580f556e4a51f02a88bbf362dfbcbfa1"
txix="0"
fonds="10000000000"
policyid=$(cat rpolice/policyID)
frais="300000"
txix="0"
fonds="10000000000"
policyid=$(cat rpolice/policyID)
frais="300000"
cardano-cli query protocol-parameters $testnet --out-file protocol.json
echo "{" >> rpolice/policy.script
echo " \"keyHash\": \"$(cardano-cli address key-hash --payment-verification-key-file rpolice/policy.vkey)\"," >> rpolice/policy.script
echo " \"type\": \"sig\"" >> rpolice/policy.script
echo "}" >> rpolice/policy.script
echo " \"keyHash\": \"$(cardano-cli address key-hash --payment-verification-key-file rpolice/policy.vkey)\"," >> rpolice/policy.script
echo " \"type\": \"sig\"" >> rpolice/policy.script
echo "}" >> rpolice/policy.script
cardano-cli transaction policyid --script-file ./rpolice/policy.script > rpolice/policyID
cardano-cli transaction build-raw \
--fee $frais \
--tx-in $txhash#$txix \
--tx-out $address+$envoi+"$quantite $policyid.$tokenname1 + $quantite $policyid.$tokenname2" \
--mint "$quantite $policyid.$monnaie1 + $quantite $policyid.$monnaie2" \
--minting-script-file rpolice/policy.script \
--out-file monnaie.raw
--fee $frais \
--tx-in $txhash#$txix \
--tx-out $address+$envoi+"$quantite $policyid.$tokenname1 + $quantite $policyid.$tokenname2" \
--mint "$quantite $policyid.$monnaie1 + $quantite $policyid.$monnaie2" \
--minting-script-file rpolice/policy.script \
--out-file monnaie.raw
frais=$(cardano-cli transaction calculate-min-fee --tx-body-file monnaie.raw --tx-in-count 1 --tx-out-count 1 --witness-count 2 $testnet --protocol-params-file protocol.json | cut -d " " -f1)
cardano-cli transaction build-raw --fee $frais --tx-in $txhash#$txix --tx-out $address+$envoi+"$quantite $policyid.$tokenname1 + $quantite $policyid.$tokenname2" --mint "$quantite $policyid.$monnaie1 + $quantite $policyid.$monnaie2" --minting-script-file rpolice/policy.script --out-file monnaie.raw
cardano-cli transaction build-raw --fee $frais --tx-in $txhash#$txix --tx-out $address+$envoi+"$quantite $policyid.$tokenname1 + $quantite $policyid.$tokenname2" --mint "$quantite $policyid.$monnaie1 + $quantite $policyid.$monnaie2" --minting-script-file rpolice/policy.script --out-file monnaie1.raw
cardano-cli transaction sign --signing-key-file payment.skey $testnet --tx-body-file monnaie1.raw --out-file monnaie1.signed
cardano-cli transaction submit --tx-file monnaie1.signed $testnet
fee=$(cardano-cli transaction calculate-min-fee --tx-body-file rec_matx.raw --tx-in-count 1 --tx-out-count 2 --witness-count 1 $testnet --protocol-params-file protocol.json | cut -d " " -f1)
frais=$(cardano-cli transaction calculate-min-fee --tx-body-file monnaie.raw --tx-in-count 1 --tx-out-count 1 --witness-count 2 $testnet --protocol-params-file protocol.json | cut -d " " -f1)
cardano-cli transaction build-raw --fee $frais --tx-in $txhash#$txix --tx-out $address+$envoi+"$quantite $policyid.$tokenname1 + $quantite $policyid.$tokenname2" --mint "$quantite $policyid.$monnaie1 + $quantite $policyid.$monnaie2" --minting-script-file rpolice/policy.script --out-file monnaie1.raw
cardano-cli transaction build-raw --fee $frais --tx-in $txhash#$txix --tx-out $address+$envoi+"$quantite $policyid.$monnaie1 + $quantite $policyid.$monnaie2" --mint "$quantite $policyid.$monnaie1 + $quantite $policyid.$monnaie2" --minting-script-file rpolice/policy.script --out-file monnaie1.raw
cardano-cli transaction sign --signing-key-file payment.skey $testnet --signing-key-file rpolice/policy.skey --tx-body-file monnaie1.raw --out-file monnaie1.signed