Cardano Example Dapp
Governance - Vote Delegation - Abstain
About to sign a transaction with a vote to Always Abstain. If current stake key is already registered, 'autoClean' will remove 'myRegistration' certificate automatically. Works with personal and multisig wallets the same
Try it online:
- Visit HTML+JS Dapp
- Visit HTML+React Dapp
- Visit Native HTML dapp
- Run Run in Wallet…Open in IDE…
Source code:
- dapp connection code: GCScript DSL
- frontend (using @gamechanger-finance/gc): HTML+JS dapp
- frontend (using @gamechanger-finance/gc): HTML+React dapp
- frontend (without official library): Native HTML dapp
Dapp code was autogenerated by Playground IDE in GameChanger Wallet
GCScript code (dapp connection):
{
"type": "script",
"title": "Governance - Vote Delegation - Abstain",
"description": "About to sign a transaction with a vote to Always Abstain. If current stake key is already registered, 'autoClean' will remove 'myRegistration' certificate automatically. Works with personal and multisig wallets the same",
"require": {
"not": {
"walletTypeIn": [
"burner",
"gift"
]
}
},
"args": {
"kind": "Abstain"
},
"return": {
"mode": "last"
},
"exportAs": "myVoteDelegation",
"run": {
"address": {
"type": "getCurrentAddress"
},
"addressInfo": {
"type": "macro",
"run": "{getAddressInfo(get('cache.address'))}"
},
"_registration": {
"type": "macro",
"run": {
"kind": "StakeRegistration",
"pubKeyHashHex": "{get('cache.addressInfo.stakingKeyHash')}",
"scriptHashHex": "{get('cache.addressInfo.stakingScriptHash')}"
}
},
"registration": {
"type": "certificate",
"cert": "{get('cache._registration')}"
},
"_vote": {
"type": "macro",
"run": {
"kind": "VoteDelegation",
"pubKeyHashHex": "{get('cache.addressInfo.stakingKeyHash')}",
"scriptHashHex": "{get('cache.addressInfo.stakingScriptHash')}",
"vote": "{get('args')}"
}
},
"vote": {
"type": "certificate",
"cert": "{get('cache._vote')}"
},
"build": {
"type": "buildTx",
"title": "✅ Voted Abstain",
"tx": {
"certificates": {
"myRegistration": {
"certHex": "{get('cache.registration')}"
},
"myVote": {
"certHex": "{get('cache.vote')}"
}
},
"options": {
"autoProvision": {
"workspaceNativeScript": true
},
"autoOptionalSigners": {
"nativeScript": true
},
"autoClean": {
"certReRegistrations": true
}
}
}
},
"sign": {
"detailedPermissions": false,
"type": "signTxs",
"txs": [
"{get('cache.build.txHex')}"
]
},
"submit": {
"type": "submitTxs",
"txs": "{get('cache.sign')}"
},
"stage4_export_results": {
"type": "macro",
"run": {
"txHash": "{get('cache.build.txHash')}",
"pubKeyHashHex": "{get('cache.addressInfo.stakingKeyHash')}",
"scriptHashHex": "{get('cache.addressInfo.stakingScriptHash')}",
"registrationCert": "{get('cache.registration')}",
"voteCert": "{get('cache.vote')}"
}
}
}
}
Run standalone QR dapp connection:
You can use Playground IDE in GameChanger Wallet in QR URL Transport mode to capture results
Resources
- How to connect?
- Docs and examples on Github
- GCScript documentation
- Playground IDE in GameChanger Wallet
- Tutorials on Youtube
- Support on Discord
- News on Twitter
- Website
License
MIT
