smart-chain-fr / tokenomia

Tokenomia is built for the Cardashift ICO, it aims to simplify the use of Native Tokens and Smart Contracts above the Cardano Platform. Cardashift is a community-driven startup platform that raises funds, builds and accelerates startups that solve social and environmental problems.
Apache License 2.0
77 stars 27 forks source link

Token Minting fails the CLI- Transaction Build #56

Closed Totes5706 closed 2 years ago

Totes5706 commented 2 years ago

It appears that the script is sending the actual token name to the CLI to be minted, which the Cardano-CLI no longer understands. This should be converted into the hexadecimal version of the token name before passing.

 please choose an action (provide the index) : 9
Select the minter wallet : 
    1-Totes

> please choose an action (provide the index) : 1
> Token Name : gold
> Total Supply to Mint : 100
-------------------------
Policy hash will be : 8c7c4214d9fc71623620acda93fe9b82aa613860218dd14589cfceb5
-------------------------
option --tx-out: 
unexpected 'g'
expecting hexadecimal asset name, white space, "+" or end of input

Usage: cardano-cli transaction build 
            [ --byron-era
            | --shelley-era
            | --allegra-era
            | --mary-era
            | --alonzo-era
            ]
            [ --shelley-mode
            | --byron-mode [--epoch-slots NATURAL]
            | --cardano-mode [--epoch-slots NATURAL]
            ]
            (--mainnet | --testnet-magic NATURAL)
            [--script-valid | --script-invalid]
            [--witness-override WORD]
            (--tx-in TX-IN
              [--tx-in-script-file FILE
                [
                  ( --tx-in-datum-cbor-file CBOR FILE
                  | --tx-in-datum-file JSON FILE
                  | --tx-in-datum-value JSON VALUE
                  )
                  ( --tx-in-redeemer-cbor-file CBOR FILE
                  | --tx-in-redeemer-file JSON FILE
                  | --tx-in-redeemer-value JSON VALUE
                  )]])
            [--required-signer FILE | --required-signer-hash HASH]
            [--tx-in-collateral TX-IN]
            [--tx-out ADDRESS VALUE
              [ --tx-out-datum-hash HASH
              | --tx-out-datum-hash-cbor-file CBOR FILE
              | --tx-out-datum-hash-file JSON FILE
              | --tx-out-datum-hash-value JSON VALUE
              | --tx-out-datum-embed-cbor-file CBOR FILE
              | --tx-out-datum-embed-file JSON FILE
              | --tx-out-datum-embed-value JSON VALUE
              ]]
            --change-address ADDRESS
            [--mint VALUE
              (--mint-script-file FILE
                [ --mint-redeemer-cbor-file CBOR FILE
                | --mint-redeemer-file JSON FILE
                | --mint-redeemer-value JSON VALUE
                ])]
            [--invalid-before SLOT]
            [--invalid-hereafter SLOT]
            [--certificate-file CERTIFICATEFILE
              [--certificate-script-file FILE
                [ --certificate-redeemer-cbor-file CBOR FILE
                | --certificate-redeemer-file JSON FILE
                | --certificate-redeemer-value JSON VALUE
                ]]]
            [--withdrawal WITHDRAWAL
              [--withdrawal-script-file FILE
                [ --withdrawal-redeemer-cbor-file CBOR FILE
                | --withdrawal-redeemer-file JSON FILE
                | --withdrawal-redeemer-value JSON VALUE
                ]]]
            [--json-metadata-no-schema | --json-metadata-detailed-schema]
            [--auxiliary-script-file FILE]
            [--metadata-json-file FILE | --metadata-cbor-file FILE]
            [--genesis FILE | --protocol-params-file FILE]
            [--update-proposal-file FILE]
            [--cddl-format | --cli-format]
            (--out-file FILE | --calculate-plutus-script-cost FILE)

  Build a balanced transaction (automatically calculates fees)

  Please note the order of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.
tokenomia-cli: Command `cardano-cli "transaction" "build" "--alonzo-era" "--tx-in" "f681c945628a19a3748a4e1bc5de99b3709f84fdaa00931a6d2d8d30ddcdb2e9#0" "--tx-out" "addr_test1qzkdqzm5j9hcgjrlrwkuva9hadw5yh9pkcmhueswpewwcs3dkwyvymw3skfm60rcqvxe7kj7ue55d8ktjg7pn4k56c5s28yjna  1379280 lovelace + 100 8c7c4214d9fc71623620acda93fe9b82aa613860218dd14589cfceb5.gold " "--mint" "100 8c7c4214d9fc71623620acda93fe9b82aa613860218dd14589cfceb5.gold " "--mint-script-file" "/home/totinj/.tokenomia-cli/testnet/monetary-policies/8c7c4214d9fc71623620acda93fe9b82aa613860218dd14589cfceb5.plutus" "--mint-redeemer-value" "[]" "--tx-in-collateral" "f681c945628a19a3748a4e1bc5de99b3709f84fdaa00931a6d2d8d30ddcdb2e9#1" "--tx-in" "f681c945628a19a3748a4e1bc5de99b3709f84fdaa00931a6d2d8d30ddcdb2e9#0" "--change-address" "addr_test1qzkdqzm5j9hcgjrlrwkuva9hadw5yh9pkcmhueswpewwcs3dkwyvymw3skfm60rcqvxe7kj7ue55d8ktjg7pn4k56c5s28yjna" "--testnet-magic" "1097911063" "--required-signer" "/home/totinj/.tokenomia-cli/testnet/wallets/Totes/child-addresses/0/extended-private-key.json" "--required-signer" "/home/totinj/.tokenomia-cli/testnet/wallets/Totes/child-addresses/0/extended-private-key.json" "--required-signer" "/home/totinj/.tokenomia-cli/testnet/wallets/Totes/child-addresses/0/extended-private-key.json" "--protocol-params-file" "/home/totinj/.tokenomia-cli/testnet/parameters/parameters-testnet.json" "--out-file" "/home/totinj/.tokenomia-cli/testnet/transactions/tx_7379433184012181271.raw"` failed [exit 1] at CallStack (from HasCallStack):
  cardano_cli, called at src/Tokenomia/Common/Transacting.hs:176:24 in tokenomia-0.1.0.0-inplace:Tokenomia.Common.Transacting
devfull commented 2 years ago

Thank you for noticing this compatibility issue. It was fixed by https://github.com/devfull/tokenomia/commit/eed6f39ccd3b1e6414dad6316d16408f0915f649.