Skip to main content

Cardano Example Dapp

Governance - Vote Delegation - No Confidence​

About to sign a transaction with a vote of Always No Confidence. If current stake key is already registered, 'autoClean' will remove 'myRegistration' certificate automatically. Works with personal and multisig wallets the same

Try it online:​

Source code:​

Dapp code was autogenerated by Playground IDE in GameChanger Wallet

GCScript code (dapp connection):​

{
"type": "script",
"title": "Governance - Vote Delegation - No Confidence",
"description": "About to sign a transaction with a vote of Always No Confidence. 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": "NoConfidence"
},
"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 No Confidence",
"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

This GCScript/URL is too large! make it shorter uploading parts to GCFS. Unable to generate QR code

Resources​

License​

MIT