Skip to main content

Cardano Example Dapp

Arithmetic Functions​

This demo will test and explore basic arithmetic functions

Try it online:​

Source code:​

Dapp code was autogenerated by Playground IDE in GameChanger Wallet

GCScript code (dapp connection):​

{
"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 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

Resources​

License​

MIT