
# Cardano Example Dapp

## **Spirois-Montiel-SudoScientist Token Minting Test**

Testing the fix for the 'Spirois bug' using Montiel's and SudoScientist's test case assetNames, added some others as well. Use an address of yours for exampleDrop01. Thanks for testing guys!


## Try it online: 

-  Visit [HTML+JS Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Spirois-Montiel-SudoScientist%20Token%20Minting%20Test.html)
-  Visit [HTML+React Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Spirois-Montiel-SudoScientist%20Token%20Minting%20Test_react.html)
-  Visit [Native HTML dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Spirois-Montiel-SudoScientist%20Token%20Minting%20Test_nolib.html)
-  Run [Standalone URL dapp connection](https://wallet.gamechanger.finance/api/2/run/1-H4sIAAAAAAAAA7VWTW_bOBD9K1pf3AKpQVEkJfUW7B5aLLookOxpESwocmgL1jepxE6Q_75DSUnkpPE6RSoBkkjOvPdmSJFzt3D7BhafF1Z1eeMWZwuXu8J3XDR5V-f207e6cjkUny56XV-oHLBlXXBZb6EKvuXYqtbBJVjvqmFEyesKAXynH3QbCEy-C0zdDd_LCTnI-vUy6K23mUiWNpCVDg6osM8hUqCkhUBaC-4vWYI9C6TWoANblxDUiNuhrw1uoChWwd_etPIWHVgb1CbY1z0aeAmwk2VTwB9d3ZBwFVxuZLUdR9wkeN3v7W8YDuyaunPnFmPR0kns6cD1HcZ2tyhr7ZNUSAz8Hgf6oVdDA5WGCrVb336e28ls0jWzWIP7ve86jPh8GkPQyexrZeqZaSlVVz9gLe7Q8_zJ7gM2PyyVVBtYzcWsJqzlx4_3HrocJ-57XeRqPwOvpMuv4eJB7yTcSy4K_8qt7aHzX02f_Qn7L9JuvsBuEnKM2atbNXJfYoyT49JrGa6zRdbnhZ4JGdqXu9fX449XoNsNk4OdmN1_UOUQ4Fd9TOBBLlZjyFNcXiHOg190I97j-huDJoRoCBkRkQiFElxQoeM4CiOCbm0vEdhhehdhiEl_3ZsKHrOY4ZMKgTgGb_YMgRxFmPGjLyBWii31Fgz0SdDnkV_AoIfF0XGU6U8fpuOUqJlArZngeEXspChZjB5acBahwhB1xV4ZA0wYo4RGUfguKPRdUP4nW8dQOMO8Y2YEGJKaVCbPV9EPsYSKQ0qSlJykn0QctCGxUUhOoiRJuQGukkxoFnKTaTBZGPE41KFmRmYkBhURAJqKlIVUnMKRGJ7QWGYIKIzUlHGqSRaGJMU4hdGR4mGkKI9FrEPFEg0ypUIZE1NcxzQ-hUNnKsyYSgkxBhCCxzzjWnIlooQwElJuBNcZMRABZSxlWSyQJhGMxxpfp3BESiT4L-PcMoM3xXjo8JSo3oxjp-Ac2ogXv8-L8av7q7NF3bumd8MhcXBkHRwgw9e__uAK21vWyAo2cReTVl-3bW_3G2Y2zLn9TX-7vd1U3U2xaVjUbsst30atqUBb1VS9LaNCGEfbaNO2uy1x1bVoWpBa0j1RKrGuS7t0fbgVzrZWNHwYm0Iae2ZRUTJcQ-zvtyn_xE78CxQc2QFfWQ7vwv86zy8jufJH9U3uKlx8Y4UzLxjsw9mLiFMJ8VbqkXYsCWy-nooqJ_MC9HfoSqw_sLhEIiMLC2ePBRaaXu7sUAD41XnAOpQSK7ebwK88dJ-VuZtXaEPHDOIAwcMvx8LJ5BWWQvsjxR0SYQKPFmwvlD0UQ_NJO8H_LVP5VPRdPBZ170DwNGH3_wELd0yYSwwAAA)

## Source code:

- dapp connection code: [GCScript DSL](Spirois-Montiel-SudoScientist%20Token%20Minting%20Test.gcscript)
- frontend (using @gamechanger-finance/gc): [HTML+JS dapp](Spirois-Montiel-SudoScientist%20Token%20Minting%20Test.html)
- frontend (using @gamechanger-finance/gc): [HTML+React dapp](Spirois-Montiel-SudoScientist%20Token%20Minting%20Test_react.html)
- frontend (without official library): [Native HTML dapp](Spirois-Montiel-SudoScientist%20Token%20Minting%20Test_nolib.html)

Dapp code was autogenerated by [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground)

## GCScript code (dapp connection):
```json
{
  "type": "script",
  "title": "Spirois-Montiel-SudoScientist Token Minting Test",
  "description": "Testing the fix for the 'Spirois bug' using Montiel's and SudoScientist's test case assetNames, added some others as well. Use an address of yours for exampleDrop01. Thanks for testing guys!",
  "exportAs": "data",
  "return": {
    "mode": "last"
  },
  "run": {
    "dependencies": {
      "type": "script",
      "run": {
        "address": {
          "type": "getCurrentAddress"
        },
        "addressInfo": {
          "type": "macro",
          "run": "{getAddressInfo(get('cache.dependencies.address'))}"
        },
        "mintingPolicy": {
          "type": "nativeScript",
          "script": {
            "all": {
              "issuer": {
                "pubKeyHashHex": "{get('cache.dependencies.addressInfo.paymentKeyHash')}"
              }
            }
          }
        }
      }
    },
    "build": {
      "type": "buildTx",
      "title": "Spirois-Montiel Token Minting Test",
      "tx": {
        "mints": [
          {
            "policyId": "{get('cache.dependencies.mintingPolicy.scriptHashHex')}",
            "assets": [
              {
                "assetNameHex": "000de14063616c65626d773130",
                "quantity": "11"
              },
              {
                "assetNameHex": "000de140626574746572666c6f6f64",
                "quantity": "10"
              },
              {
                "assetNameHex": "000de14063616c65626d6f6e7469656c",
                "quantity": "10"
              },
              {
                "assetNameHex": "000de140746865666c6f6f646e65726473",
                "quantity": "10"
              },
              {
                "assetName": "TestToken",
                "quantity": "11"
              },
              {
                "assetNameHex": "46616b65555344",
                "quantity": "10"
              },
              {
                "assetNameHex": "47616d654368616e6765724e4654202331",
                "quantity": "10"
              },
              {
                "assetNameHex": "47616d654368616e6765724e4654202332",
                "quantity": "10"
              },
              {
                "assetNameHex": "47616d654368616e6765724e4654202333",
                "quantity": "10"
              },
              {
                "assetNameHex": "47616d654368616e676572546f6b656ef09f9a80",
                "quantity": "10"
              },
              {
                "assetNameHex": "6c71208902",
                "quantity": "10"
              },
              {
                "assetNameHex": "035edf07fc543038895fe5c8b6d415fbdefb13571d1d4fab07ec30ee29694126",
                "quantity": "10"
              },
              {
                "assetNameHex": "8f5827ab4156fad2452d0b11096766fd3c513c25767d1c48dea926cff7236127",
                "quantity": "10"
              },
              {
                "assetNameHex": "dbc1b4c900ffe48d575b5da5c638040125f65db0fe3e24494b76ea986457d986",
                "quantity": "10"
              },
              {
                "assetNameHex": "3c68313e464f4f42415242415a3c2f68313e",
                "quantity": "10"
              },
              {
                "assetNameHex": "",
                "quantity": "6"
              },
              {
                "assetName": "",
                "quantity": "6"
              }
            ]
          }
        ],
        "outputs": {
          "exampleDrop01": {
            "address": "addr_test1qz4paneh7r70qdvqqusyh4fh4ttywuzkzhnrwlhp43qkmk5k3qfnedscpnusm3l6ft2q3hqqxk0tnv6pqeada2y0cc8str9r9g",
            "assets": [
              {
                "policyId": "ada",
                "assetName": "ada",
                "quantity": "2000000"
              },
              {
                "policyId": "{get('cache.dependencies.mintingPolicy.scriptHashHex')}",
                "assetNameHex": "000de14063616c65626d773130",
                "quantity": "1"
              },
              {
                "policyId": "{get('cache.dependencies.mintingPolicy.scriptHashHex')}",
                "assetName": "TestToken",
                "quantity": "1"
              },
              {
                "assetNameHex": "",
                "policyId": "{get('cache.dependencies.mintingPolicy.scriptHashHex')}",
                "quantity": "1"
              },
              {
                "assetName": "",
                "policyId": "{get('cache.dependencies.mintingPolicy.scriptHashHex')}",
                "quantity": "1"
              }
            ]
          }
        },
        "witnesses": {
          "nativeScripts": {
            "mintingScript": "{get('cache.dependencies.mintingPolicy.scriptHex')}"
          }
        }
      }
    },
    "sign": {
      "detailedPermissions": false,
      "type": "signTxs",
      "txs": [
        "{get('cache.build.txHex')}"
      ]
    },
    "submit": {
      "type": "submitTxs",
      "txs": "{get('cache.sign')}"
    },
    "finally": {
      "type": "script",
      "run": {
        "txHash": {
          "type": "macro",
          "run": "{get('cache.build.txHash')}"
        },
        "policyId": {
          "type": "macro",
          "run": "{get('cache.dependencies.mintingPolicy.scriptHashHex')}"
        },
        "mintingScript": {
          "type": "macro",
          "run": "{get('cache.dependencies.mintingPolicy.scriptHex')}"
        }
      }
    }
  }
}
```

## Run standalone QR dapp connection: 

You can use [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground) in `QR URL Transport` mode to capture results

[![This GCScript/URL is too large! make it shorter uploading parts to GCFS. Unable to generate QR code](Spirois-Montiel-SudoScientist%20Token%20Minting%20Test.png)](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Spirois-Montiel-SudoScientist%20Token%20Minting%20Test.png)

## Resources
- [How to connect?](https://www.npmjs.com/package/@gamechanger-finance/gc)
- [Docs and examples on Github](https://github.com/GameChangerFinance/gamechanger.wallet/)
- [GCScript documentation](https://wallet.gamechanger.finance/doc/api/v2)
- [Playground IDE in GameChanger Wallet ](https://wallet.gamechanger.finance/playground)
- [Tutorials on Youtube](https://www.youtube.com/@gamechanger.finance)
- [Support on Discord](https://discord.gg/vpbfyRaDKG)
- [News on Twitter](https://twitter.com/GameChangerOk)
- [Website](https://gamechanger.finance)

## License
MIT 
    
