
# Cardano Example Dapp

## **Arithmetic Functions**

This demo will test and explore basic arithmetic functions


## Try it online: 

-  Visit [HTML+JS Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Arithmetic%20Functions.html)
-  Visit [HTML+React Dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Arithmetic%20Functions_react.html)
-  Visit [Native HTML dapp](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Arithmetic%20Functions_nolib.html)
-  Run [Standalone URL dapp connection](https://wallet.gamechanger.finance/api/2/run/1-H4sIAAAAAAAAA6WSQWuEMBCF_0rIxS0IJvbmbUvpqZRS2vOS1XQNRBOSkbaI_71J1bhaYVdWcJIhed-T57QYBEiOM7w3AsqKg8jRU1PnIFRtcYwLbnMjtG_dpfdSWFTwSqEvISUCbgGxukD8W0tlODoy6_RsQn2eoeBHe6Oe53onUgb2dmb-6ODuzHBoTP3x9vzKALjx3iWAzpJEqpzJUlnI7gkhif-YhGmRFExrL2zc3RazongQp5em8s3SeLhDD8yczs4rlhs1HuM2IHYRje463MU43aCII0oGWb1V5stQxyWs02aGP3i2vdaEksHCk4JBj53jO2dQNfLWMANiF6XXhTlTxEF1Ict_qrV3Q2xzXhov6piQbY63JhQQ7gf1z3U5rejiBeFCZusEQlanbjaVYVq3RLpmN7hNZnRq_5reiPZ5d90vX5tQF7cEAAA)

## Source code:

- dapp connection code: [GCScript DSL](Arithmetic%20Functions.gcscript)
- frontend (using @gamechanger-finance/gc): [HTML+JS dapp](Arithmetic%20Functions.html)
- frontend (using @gamechanger-finance/gc): [HTML+React dapp](Arithmetic%20Functions_react.html)
- frontend (without official library): [Native HTML dapp](Arithmetic%20Functions_nolib.html)

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

## GCScript code (dapp connection):
```json
{
  "title": "Arithmetic Functions",
  "description": "This demo will test and explore basic arithmetic functions",
  "type": "script",
  "exportAs": "ArithmeticDemo",
  "returnURLPattern": "http://localhost:3000/demo/api/dapp",
  "run": {
    "addBigNum": {
      "type": "script",
      "run": {
        "1_arg": {
          "type": "macro",
          "run": "{addBigNum('1')}"
        },
        "2_arg": {
          "type": "macro",
          "run": "{addBigNum('1','10')}"
        },
        "n_arg": {
          "type": "macro",
          "run": "{addBigNum('1','10','100','1000','10000','100000','1000000')}"
        },
        "n_arg_types": {
          "type": "macro",
          "run": "{addBigNum('1',10,'100',1000,'10000',100000,'1000000')}"
        }
      }
    },
    "mulBigNum": {
      "type": "script",
      "run": {
        "1_arg": {
          "type": "macro",
          "run": "{mulBigNum('2')}"
        },
        "2_arg": {
          "type": "macro",
          "run": "{mulBigNum('2','2')}"
        },
        "n_arg": {
          "type": "macro",
          "run": "{mulBigNum('2','2','2','2','2','2','2')}"
        },
        "n_arg_types": {
          "type": "macro",
          "run": "{mulBigNum('2',2,'2',2,'2',2,'2')}"
        }
      }
    },
    "subBigNum": {
      "type": "script",
      "run": {
        "1_arg": {
          "type": "macro",
          "run": "{subBigNum('1111111')}"
        },
        "2_arg": {
          "type": "macro",
          "run": "{subBigNum('1111111','1111111')}"
        },
        "n_arg": {
          "type": "macro",
          "run": "{subBigNum('1111111','1000000','100000','10000','1000','100','10','1')}"
        },
        "n_arg_types": {
          "type": "macro",
          "run": "{subBigNum('1111111',1000000,'100000',10000,'1000',100,'10',1)}"
        }
      }
    }
  }
}
```

## 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](Arithmetic%20Functions.png)](https://gamechangerfinance.github.io/gamechanger.wallet/examples/Arithmetic%20Functions.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 
    
