Skip to main content

Cardano Example Dapp

DAO Demo​

This script will create a workspace to import addresses, scripts, manage funds and signatures from a DAO where you are a powerful member, you have full control when you use 2 of your keys.

Try it online:​

Source code:​

Dapp code was autogenerated by Playground IDE in GameChanger Wallet

GCScript code (dapp connection):​

{
"type": "script",
"title": "DAO Demo",
"description": "This script will create a workspace to import addresses, scripts, manage funds and signatures from a DAO where you are a powerful member, you have full control when you use 2 of your keys.",
"require": {
"not": {
"walletTypeIn": [
"extension"
]
}
},
"exportAs": "DAODemo",
"return": {
"mode": "none"
},
"returnURLPattern": "http://localhost:3000/demo/api/dapp",
"run": {
"otherMemberKeyHashes": {
"type": "data",
"value": {
"IOHK": "3ecb73dee12d39d8787c9b87e71e857c6dd487d4fe7c5173e0bb8c74",
"Emurgo": "1d46f358ba291245db79a6b953703a131e688ab2054e6a85b742d621",
"CardanoFoundation": "ad0a0ecf8ae61aba9b75d337b7348a4ad5d1a92aad9d8aeaf04b28d2"
}
},
"walletSetup": {
"type": "loadConfig",
"updateId": "DAODemo",
"layers": [
{
"type": "Workspace",
"items": [
{
"namePattern": "gcdao",
"titlePattern": "GhostChain DAO",
"descriptionPattern": "Wallet settings generated by a demo script to create a DAO."
}
]
},
{
"type": "Key",
"workspaceIds": [
"gcdao"
],
"items": [
{
"namePattern": "spend-sponsor",
"kind": "spend",
"accountIndex": 0,
"addressIndex": 0
},
{
"namePattern": "stake-sponsor",
"kind": "stake",
"accountIndex": 0,
"addressIndex": 0
},
{
"namePattern": "Casper",
"kind": "spend",
"accountIndex": 0,
"addressIndex": 1
},
{
"namePattern": "Slimer",
"kind": "spend",
"accountIndex": 0,
"addressIndex": 2
},
{
"namePattern": "MoaningMyrtle",
"kind": "spend",
"accountIndex": 0,
"addressIndex": 3
}
]
},
{
"type": "NativeScript",
"workspaceIds": [
"gcdao"
],
"namePattern": "gcdao_script",
"items": [
{
"atLeast": 2,
"ofThese": [
{
"pubKeyHashHex": "{get('cache.otherMemberKeyHashes.IOHK')}"
},
{
"pubKeyHashHex": "{get('cache.otherMemberKeyHashes.Emurgo')}"
},
{
"pubKeyHashHex": "{get('cache.otherMemberKeyHashes.CardanoFoundation')}"
},
{
"pubKeyName": "Casper"
},
{
"pubKeyName": "Slimer"
},
{
"pubKeyName": "MoaningMyrtle"
}
]
}
]
},
{
"type": "Address",
"workspaceIds": [
"gcdao"
],
"items": [
{
"namePattern": "Signer",
"spendPubKeyName": "spend-sponsor",
"stakePubKeyName": "stake-sponsor"
},
{
"namePattern": "SharedTreasury",
"spendNativeScriptName": "gcdao_script",
"stakeNativeScriptName": "gcdao_script"
}
]
}
]
}
}
}

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