gamechanger.wallet

Cardano Example Dapps

100 built-in examples on IDE:

1: 🚀 Pay me 1 ADA

This is a payment request of 1 ADA

2: Minimal Coin Sending Demo

Instead of using key-value maps for list of block code, here we use arrays and number indexes, making code less self explanatory but much smaller. The ‘outputs’ property of the ‘buildTx’ API function allows you to define multi-asset transaction outputs. In Cardano assets are defined by a policyId and an assetName, for ADA we use ‘ada’ in both cases. Receiver, asset and quantity are exposed as flat arguments so an auto-generated dapp can drive them

3: NFT Minting Demo

It creates a native script and use it as policy to mint an NFT. Raise ‘mint-quantity’ and you will be minting Semi-fungible tokens (SFT). Image has been previously uploaded and pinned on IPFS. NFTs contains references to the actual images. Asset name, quantities, policy lifetime, receiver and every CIP-25 metadata field are exposed as flat arguments so an auto-generated dapp can drive the whole mint, and they are checked with assert() before the wallet builds anything

4: Deploy Plutus Script

Demo that sends a transaction that includes an inlined Plutus Script and also a datum on outputs. Future transactions can reference this outputs without having to include on-chain the entire data again. A GameChanger Wallet Dapp Demo. https://gamechanger.finance/

5: Run Deployed Plutus Script

Demo that locks and redeem some coin from a previously deployed smart contract. A GameChanger Wallet Dapp Demo. https://gamechanger.finance/

6: Run Plutus V2 Script

Demo that locks and redeem some coin from an Always-Succeed Plutus V2 smart contract. A GameChanger Wallet Dapp Demo. https://gamechanger.finance/

7: Run Plutus V3 Script

Demo that locks and redeem some coin from an Always-Succeed Plutus V3 smart contract. A GameChanger Wallet Dapp Demo. https://gamechanger.finance/

8: Forty Two (typed)

This contract will lock up some tokens that can only be unlocked providing 42 as typed redeemer and datum.. A GameChanger Wallet Dapp Demo. https://gamechanger.finance/

9: Forty Two (untyped)

This contract will lock up some tokens that can only be unlocked providing 42 as untyped redeemer and datum.. A GameChanger Wallet Dapp Demo. https://gamechanger.finance/

10: UTXO Generator

Generates required amount of UTXOs in your wallet to improve multi-transaction concurrency capabilities, for dapps and GCFS filesystem write events. A GameChanger Wallet Dapp Demo. https://gamechanger.finance/

11: Helios Timelock

Builds an Helios Smart Contract on the fly. First transaction will lock coins setting main staking key as owner, second one will be able to unlock it only after some time and using main spending key. Burner/Gift wallets not recommended. Timelock not exactly tested.

12: Helios One-Shot Mint

Parameterizes and compiles an Helios Smart Contract on the fly on user wallet, a One-Shot Mint validator pattern. The UTXO required for the one-shot mint is produced on a first transaction, but a previously-generated one can be provided to avoid this first step.

13: Plutus Script Parametrization

Parameterizes a Plutus Script with same original parameters and verifies the hashes remains equal. Modify parameters to trigger a hash mismatch error. Remove ‘strictScriptHashHex’ to allow for the new parametrization

14: Query Beacon Tokens

Fetch network queries to retrieve some Beacon Tokens UTXO information

15: Convert Bech32 address into Plutus Data

Convert your current address from Bech32 representation into Plutus Data object (back and forth). Also exports address information, hexadecimal representation and hash

16: Generate 10 Gift Wallets

Generate 10 QR Encrypted Gift Wallets for onboarding students in a class. Files will be downloaded as PNG files for printing or showing on screens

17: Generate 3 Gift Wallets and fund them

Generate 3 QR Encrypted Gift Wallets for onboarding users in an event and fund them with assets on a single transaction to save on fees. Files will be downloaded as PNG files for printing or showing on screens. Password can be customized but here is autogenerated

18: Await conditions

This demo will wait for a timer to reach its timeout and then for the current wallet to receive at least 5.25 coins

19: Using console

Let’s use dapp connector internal console to log or debug some events. Run and go to Advanced - Console to read them.

20: Keep Calm NFT

Keep Calm NFT Demo, dynamically generates the image

21: GC Transaction Features

Script that will try out special GC transaction features

22: Import transactions (CBOR)

Import a list of transactions (CBOR hex) into localstorage for debugging and handling them manually with wallet user interface later

23: Official Workspaces Config Generator

Generates wallet configuration layers to re-create official workspaces

24: Encrypter Demo

Encrypts data and exports a ready to use decrypter script

25: Arithmetic Functions

This demo will test and explore basic arithmetic functions

26: Cryptographic Functions

This demo will test and explore cryptographic functions

27: String Manipulation Functions

This demo will test and explore basic string conversion and manipulation functions

28: Array Manipulation Functions

This demo will test and explore basic array conversion and manipulation functions

29: Boolean Predicate Functions

This demo will test and explore logical operators, equality predicates, type predicates and empty string checks

30: GCFS Multisig Transaction Discovery Demo

Demo that replicates the GCFS search query to retrieve all broadcasted transactions to be signed. The hash (rayId) used is calculated upon sorted transaction hashes (txHash)

31: GCFS Multisig Witness Discovery Demo

Demo that replicates the GCFS search query to retrieve all shared signatures of a particular transaction. The hash (txHash) used is calculated upon transaction cbor hex

32: Internal Multi Signing Demo

Demo that tries to sign 3 transactions with internal spending and staking private keys with any desired multisig provider. Partially sign them over and over again combining providers to try it out.

33: Kobayashi Maru Multi Signing Demo

Demo that tries to sign 3 transactions with unobtainable foreign keys and internal spending and staking private keys

34: Transaction Time to Live Demo

Script that will try the different time validity interval parameters of transaction builder

35: Password Provider Demo

Script that will use password providers to encrypt and decrypt data using by default password a CIP8 signature with current wallet address

36: Subroutines Demo

Script that will test and explore subroutines, similar to functions in structured programming.

37: Script Return Modes Demo

Script that will test and explore the different types of script return modes, allowing batch only operations, data formatting and even data privacy by choosing only what to return from block code context

38: Dynamic Code Attempt Demo

Illegal Script that will execute dynamic code using inline macros

39: Scopes Demo

Script that will test and explore code scopes and inline macro scripting access reach

40: Load Wallet Config Demo

Loads a wallet configuration with five workspaces: default, multi-delegation, hierarchical deterministic, anonymous, and anonymous multi-delegation. Child keys are derived and the addresses each workspace needs are built, then the loaded profile is exported. Workspaces are virtual groups of keys and addresses that give users a specialized wallet experience. See ‘Save Wallet Config Demo’ to persist one

41: Save Wallet Config Demo

Script that will save wallet artifacts on default wallet settings GCFS DiskNFT. Settings can be derived child keys, built child addresses and even setup address books, all these inside different wallet workspaces. Workspaces are virtual groups of artifacts that allow users to have a specialized wallet experience like multi-delegation, import a Yoroi or Daedalus wallet, work with enhanced anonymity, or whatever config a dapp requires.

42: Import Wallet Config Demo

Script that will import and run your saved wallet configuration script. Run SAVE_WALLET_CONFIG_DEMO first and update policyId on GCFS URI

43: CIP-8 Data Signing and Encrypting Demo

Demo that signs data with main and current addresses and their associated reward ones, verifies the signatures and encrypt and decrypt the data using the signatures. Run ‘Wallet Setup Demo’ or create some Workspaces first and switch current addresses to test it out

44: Simple Wallet derivation script

Will derive key pairs and build custom addresses

45: Metadatum Label Edge Cases

Script that will allow checking the full circuit, from building a tx with edge metadatum label cases, to query it then with the APIs on UI to check if there are any encoding issues, overflows or manipulations

46: Search Demo

Script that will search for files across all onchain GCFS file systems

47: Import Demo

Script that will import data and scripts from different kind of allowed sources. (example data is from preproduction testnet)

48: GCFS Disk

Script that will create a GCFS Disk in more than one transaction using API ‘buildFsTxs’ endpoint. Also the script will generate some of the files to be written on chain, one of them is an encrypted GC script

49: Delegate Current Address to PEACE (MAINNET)

About to delegate your ADA to ‘PEACEpool Cardano ecosystem developers’ stake pool. The stake key is registered and delegated in a single transaction, and an already registered stake key is handled, so the same script also works when re-delegating.

50: Child Keys Multisign

Derives three stake keys at arbitrary account and address indexes of the current wallet, and requires all three of them as signers of a single transaction. Shows how child keys outside the usual account 0 / address 0 path can co-sign, without setting up a workspace first

51: Multi Stake Delegation

Funds 3 addresses of a ‘demos’ workspace and delegates their stake keys to 3 pools in one transaction. Run it before ‘Multi Stake Withdrawal

52: Multi Stake Withdrawal

Script that requests 3 child wallet’s reward addresses from an specific workspace, to later withdraw some staking rewards from each of them on a single transaction. You need to have staking rewards on each child wallet and run ‘Multi Stake Delegation’ demo first or load its wallet configuration on this device

53: Stake Delegation

Registers the derived stake key and delegates it to a stake pool in a single transaction, then returns the delegated address so it can be funded. The target stake pool is exposed as a flat argument, so an auto-generated dapp can delegate to any pool without touching the code, and it is checked with assert() before the wallet builds anything

54: Stake Withdrawal

Withdraws staking rewards from the reward account of the current address. Cardano requires a withdrawal to move the entire reward balance, so the quantity must match the rewards available at build time. It is exposed as a flat argument, so an auto-generated dapp can drive it without touching the code, and it is checked with assert() before the wallet builds anything

55: Lock and Redeem Smart Contract

Coin locking transaction ( 5 eUTXOs) and later an unlocking one of previously locked coin, in 2 secuential transactions. Using deployed smart contract.

56: Native asset minter and burner

Creates a native script and uses it as policy to mint two fungible tokens under it, then burns one of them in a second transaction while the other survives. Asset names and quantities are checked with assert() before the wallet builds anything, remove them to explore different outcomes and balance states.

57: Build Certificates

Builds stake registration, deregistration and delegation certificates for the three kinds of stake credential: a key derived from the current wallet, a native script and a Plutus script. Nothing is submitted: the certificates are exported so they can be inspected or reused in a transaction. The target pool of each delegation is exposed as a flat argument, and checked with assert() before anything is built

58: Wallet derivation script

Derives six spending and six staking keys of the current wallet and builds every kind of address they allow: a reward address, hierarchical deterministic, delegation portfolio and anonymous addresses, native script multisig treasuries and Plutus smart contract addresses. Nothing is submitted on-chain and every address is exported back to dapp for inspection

59: Complex Native Scripts

Nested, tagged, complex native script building

60: Transaction Pipeline

Transaction pipeline without UTXO consumption conflicts using deterministic coin selection and UTXO locking

61: Advanced DAPP connection

Connection that requires some wallet data and then signs it with private keys

62: Simple Script No Export

Simple script that has no exported data

63: Simple Script No Export No Return URL

Simple script that has no exported data and no return URL

64: Simple Export

Exports the wallet name, the current address, the spending and staking public keys and three data constants under a single export named ‘wallet’. Shows how exportAs returns the results of a script to the dapp

65: Enable Terminal Mode

Script that will adapt the application to work on public terminal devices. WARNING: this cannot be undone!, to revert this you will have to clear browser data

66: 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.

67: Macro Edge Cases

This demo will test some edge cases around macro solver and syntax

68: Code Validation Tests

Script that will fail to test local and imported code validation

69: Address Identity Tester

This demo will test addresses default native scripts or ‘Identities’, and explore differences between ways to obtain them

70: Key derivation formats

Explore the different ways to derive/obtain keys and obtain all results under the same format

71: List addresses in workspace

List and sort all addresses in current workspace

72: List keys in workspace

List and sort all keys in current workspace

73: 2FA

Create a workspace with a Shared Treasury address based on 2 addresses. A second address on the workspace is your main address as Signer

74: Share your public key information

This dapp connection will ask your spending and staking public key hashes

75: Shared Treasury - 3 of 4 signers

Creates a workspace named ‘DAO’ with a ‘Shared Treasury’ address where at least 3 of 4 signer wallets are required for spending and staking operations. A second address on the workspace is caller main address as ‘Signer’. To manage the treasury set ‘Shared Treasury’ address as current. To sign as a member, set ‘Signer’ address instead. Please customize this code with real public key hashes, you can use ‘Share your public key information’ example on each member to obtain them. Please use ‘saveConfig’ function to save this setup on GCFS to avoid losing funds and data

76: Shared Treasury - 3 of 4 signers - using addresses

Creates a workspace named ‘DAO’ with a ‘Shared Treasury’ address where at least 3 of 4 signer wallets are required for spending and staking operations. A second address on the workspace is caller main address as ‘Signer’. To manage the treasury set ‘Shared Treasury’ address as current. To sign as a member, set ‘Signer’ address instead. Please customize this code with real addresses. Please use ‘saveConfig’ function to save this setup on GCFS to avoid losing funds and data

77: Shared Treasury - 3 of 4 signers - funded - Gift Wallets

Creates a workspace named ‘DAO’ with a ‘Shared Treasury’ address where at least 3 of 4 signer Gift wallets are required for spending and staking operations. A second address on the workspace is caller main address as ‘Signer’. To manage the treasury set ‘Shared Treasury’ address as current. To sign as a member, set ‘Signer’ address instead. Customize Gift Wallet generation with proper password settings and distribute them to the signers. This example is not secure as wallet creator has total control over the generated wallets. Please use ‘saveConfig’ function to save this setup on GCFS to avoid losing funds and data

78: Multisig using Unimatrix and Roundtable

Builds 3 multisig transactions and tries to sign them only with local private keys and with remote signers using Unimatrix Sync and Roundtable. Customize required keys to real ones or experience a Kobayashi Maru scenario

79: Simple Kobayashi Maru Multi Signing Demo

Builds and signs 2 transactions with unobtainable foreign keys. Triggers the default multisig strategy to obtain remote signatures through Roundtable and Unimatrix

80: Smart Handles - Swap ADA to MIN on Minswap

Interact with a Smart Handles instance for swapping ADA to MIN, with a routing fee of 1 ADA (preprod). Uses the Minswap V2 instance of Anastasia Labs Smart Handles. https://github.com/Anastasia-Labs/smart-handles

81: Arguments and ISL

Script that will test and explore subroutines, argument passing and ISL execution

82: Spirois-Montiel-SudoScientist Token Minting Test

Testing the fix for the ‘Spirois bug’ using Montiel’s and SudoScientist’s test case assetNames, added some others as well. Use an address of yours for exampleDrop01. Thanks for testing guys!

83: Address Impersonator

Create a workspace to impersonate a wallet without having their private keys. Wallet operations will trigger multisig transactions. Use to remotely control a wallet or be able to build transactions in behalf of the owner

84: Governance - Key Derivation Paths

Explore Conway Era key derivation

85: Governance - Workspace

A workspace dedicated for Governance, made of 3 DRep keys, 3 CCCold keys and 3 CCHot keys. Welcome to the Conway Era.

86: 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

87: 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

88: Governance - Vote Delegation - DRep

About to sign a transaction with a vote delegation to a DRep. If current stake key is already registered, ‘autoClean’ will remove ‘myRegistration’ certificate automatically. Works with personal and multisig wallets the same

89: Script Requirements

Using script requirement checks to only allow a certain user wallet context to run this script. Useful for ‘sticky sessions’ on dapps or for wallet type or network specific scripts

90: Get Wallet Type

Getting extra information about your current wallet type, such as brand, default staking, and more.

91: DRep parsing and certificate building

Parses different DRep IDs following legacy and CIP129 formats and builds the corresponding vote delegation certificates in bulk

92: Write registration to join Dandelion Network (GCFS)

Register your Dandelion Node Group on-chain with GCFS. Writes a json file with your Node Group definition on-chain for backend peer discovery on Dandelion, the decentralized API service for Cardano. Set the URL of your node in ‘node-url’.

93: Read your registration on Dandelion Network (GCFS)

Reads a json file with your Node Group definition from an on-chain GCFS resource, used for backend peer discovery on Dandelion, the decentralized API service for Cardano

94: List all registrations on Dandelion Network (GCFS)

Search for all matching json files with Node Group definitions on all GCFS resources on-chain. These files are used for backend peer discovery on Dandelion, the decentralized API service for Cardano

95: Multi-Network support

Example that shows how to make multi-network protocols, meaning scripts that are prepared to run in multiple networks (and DLTs)

96: Submit 3 transactions and report errors

This example will build 3 transactions, sign and submit them without halting on errors, instead it will continue script execution to return any errors reported from the nodes

97: Runtime Assertions

This example demonstrates how custom runtime assertions can be implemented. Modify the arguments to trigger errors. Explore the Console in Live Debugger for extra information

98: Batch Airdrop with Receipt

Airdrops an existing native asset to five recipients in a single transaction and stamps a CIP-20 receipt on-chain: a SHA-256 digest of the canonical recipient manifest. Anyone can later recompute the digest from the published list and prove the drop was not altered, without trusting the sender. Minimum ADA per output is auto-computed by buildTx, and the change optimizer is left enabled to keep the UTXO set healthy.

99: CIP-68 NFT Mint

Mints a CIP-68 token pair under one native script policy: a (100) reference NFT that carries the metadata as an inline datum, and a (222) user NFT that the holder actually owns. Unlike CIP-25, the metadata lives in an eUTXO datum instead of transaction metadata, so it can be updated later by whoever controls the reference token under the script-controlled address that holds it. The datum follows the CIP-68 shape #6.121([metadata, version, extra]) with ‘extra’ set to Unit/Void. Every value a dapp would want to change is exposed as a flat argument, and after submitting, the wallet redirects to a block explorer that renders CIP-68 tokens so the result can be checked. ONE DELIBERATE SIMPLIFICATION, for example purposes: uniqueness of the reference NFT rests on issuer behaviour plus the policy time-lock, not on a one-shot policy that consumes a specific UTXO, so the policy could technically mint another (100) token before it expires. A production issuer should use a one-shot minting policy.

100: Token-Gated Sign-In

Backend-less ‘sign in with Cardano’ for native asset holders only. The wallet blocks on an await/balance condition until the gating token is actually held, then signs a dapp-supplied nonce with CIP-8 and verifies its own signature before returning. The dapp learns the bare-minimum to verify: the realm, the address, the proof and nothing else.

Dapps code was auto-generated by Playground IDE in GameChanger Wallet

Resources

License

MIT