Cardano Contracts Library
Reference contracts from across Cardano, indexed by use case.
40 contracts
Basics
3 contractsFirst contracts to read: lock and unlock, a transfer, a wallet.
Hello World
Lock and unlock assets, a hands-on intro to validation and transaction building.
- MeshJS, Hello WorldOn-chainAikenOff-chainMeshJS
Simple transfer
Deposit assets at a script and name a receiver who can later withdraw them.
- Cardano Foundation, Simple transferOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardano
Simple wallet
An on-chain ADA wallet where the owner creates payment intents, executes them to pay recipients, and can withdraw the full balance.
- Cardano Foundation, Simple walletOn-chainAikenOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Payments
7 contractsHold, split, schedule and release funds between parties.
Atomic transaction
Spend from a script and mint a token in one transaction to show how Cardano transactions succeed or fail as a single unit.
- Cardano Foundation, Atomic transactionOn-chainAikenOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Escrow
Hold assets from two parties until both sign off, then complete or cancel the exchange.
- Cardano Foundation, EscrowOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
HTLC
Lock funds behind a secret and an expiry so anyone can claim them by guessing the secret before the deadline, after which the owner reclaims them.
- Cardano Foundation, HTLCOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Payment splitter
Distribute locked funds equally among a fixed list of known payees.
- Cardano Foundation, Payment splitterOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardano
Payment subscription
Automated recurring payments between subscribers and merchants.
- Anastasia Labs, Payment subscriptionOn-chainAikenOff-chainEvolution
Token transfer
Lock a specific native asset that only a designated receiver can withdraw by signing the spending transaction.
- Cardano Foundation, Token transferOn-chainAikenOff-chainCCL JavaEvolutionMeshJSPyCardano
Vesting
Lock funds for a period and let the beneficiary withdraw them once the lockup elapses.
- Cardano Foundation, VestingOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Tokens & NFTs
8 contractsMint, sell and manage native tokens and NFTs.
Editable NFT
Mint an NFT whose owner can update its data, transfer it, and permanently seal it against further edits.
- Cardano Foundation, Editable NFTOn-chainScalusOff-chainScalus
Giftcard
Lock assets into a card that anyone can redeem.
- MeshJS, GiftcardOn-chainAikenOff-chainMeshJS
Marketplace
Buy and sell native assets such as NFTs.
- MeshJS, MarketplaceOn-chainAikenOff-chainMeshJS
NFT minting machine
Mint NFTs with an automatically incremented index.
- MeshJS, NFT minting machineOn-chainAikenOff-chainMeshJS
Royalties
Enforce creator royalty payments on NFT sales using the CIP-102 royalty datum standard.
- MeshJS, RoyaltiesOn-chainAikenOff-chainMeshJS
Jpg Store
dAppAn NFT marketplace.
- jpg-store, Jpg Storevia awesome-aikenOn-chainAikenOff-chainNone listed
Nebula
dAppAn NFT marketplace contract with a chain indexer and event listener for individual projects.
- spacebudz, Nebulavia awesome-aikenOn-chainAikenOff-chainNone listed
Projected NFT Whirlpool
dAppA protocol that lets NFTs from other ecosystems be used in games while keeping custody.
- PaimaStudios, Projected NFT Whirlpoolvia awesome-aikenOn-chainAikenOff-chainNone listed
DeFi
11 contractsSwaps, pools, auctions, bets and crowdfunding.
Auction
Run an on-chain English auction where bids are locked in the contract, outbid bidders reclaim their funds, and the highest bid settles when the deadline passes.
- Cardano Foundation, AuctionOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Bet
Let two players stake an equal amount and have a restricted oracle announce the winner, who then claims the whole pot.
- Cardano Foundation, BetOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Constant product AMM
Run an automated market maker that prices swaps with the constant product formula and lets anyone provide liquidity.
- Cardano Foundation, Constant product AMMOn-chainScalusOff-chainScalus
Crowdfund
Collect donations toward a funding goal where the beneficiary withdraws only if the goal is met by the deadline, and contributors otherwise reclaim their funds.
- Cardano Foundation, CrowdfundOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Lottery
Run a fair two-player lottery using a commit-reveal-punish protocol that needs no external randomness or oracle.
- Cardano Foundation, LotteryOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Price bet
Let two players bet on whether an oracle exchange rate reaches a target before a deadline, with the pot going to the winning side.
- Cardano Foundation, Price betOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Swap
Exchange assets between two parties.
- MeshJS, SwapOn-chainAikenOff-chainMeshJS
Minswap Stableswap
dAppA stableswap exchange for price-pegged assets.
- minswap, Minswap Stableswapvia awesome-aikenOn-chainAikenOff-chainNone listed
Minswap V2
dAppAn automated market maker decentralized exchange.
- minswap, Minswap V2via awesome-aikenOn-chainAikenOff-chainNone listed
SundaeSwap V3
dAppAn automated market maker decentralized exchange.
- SundaeSwap-finance, SundaeSwap V3via awesome-aikenOn-chainAikenOff-chainNone listed
SundaeSwap Yield Farming v2
dAppYield farming reward-distribution contracts.
- SundaeSwap-finance, SundaeSwap Yield Farming v2via awesome-aikenOn-chainAikenOff-chainNone listed
Identity
2 contractsTie an on-chain action to an identity or an existing login.
Decentralized identity
Manage self-sovereign identities where an address controls ownership through signatures and can authorize time-limited delegates.
- Cardano Foundation, Decentralized identityOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
zkLogin
Authenticate with an existing OpenID account and control funds through zero-knowledge proofs verified on-chain, without seed phrases.
- eryxcoop, zkLoginOn-chainAikenOff-chainNone listed
Privacy
2 contractsPrivate payments on a public ledger.
ENCOINS
dAppAn NFT-based private transactions protocol.
- encryptedcoins, ENCOINSvia awesome-aikenOn-chainAikenOff-chainNone listed
Seedelf
dAppA stealth wallet that hides the recipient of a payment.
- logical-mechanism, Seedelfvia awesome-aikenOn-chainAikenOff-chainNone listed
Data
3 contractsCommit data on-chain and prove who owns it or that it is unchanged.
Anonymous data
Commit data on-chain under an identifier derived from a wallet and a secret nonce, then prove ownership later by revealing the nonce.
- Cardano Foundation, Anonymous dataOn-chainAikenOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Content ownership
A registry where users create and own content.
- MeshJS, Content ownershipOn-chainAikenOff-chainMeshJS
Storage
Anchor SHA-256 commitments of off-chain data on-chain so anyone can re-hash the data and verify its integrity and existence.
- Cardano Foundation, StorageOn-chainAikenScalusOff-chainBlazeCCL JavaEvolutionMeshJSPyCardanoScalus
Access & upgrades
4 contractsControl who can spend, and create or replace contracts.
Factory
Deterministically create and track many product contracts from a single factory instance using a marker NFT and on-chain registry.
- Cardano Foundation, FactoryOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardano
Upgradable multisig
Collective fund management requiring multiple approvals.
- Anastasia Labs, Upgradable multisigOn-chainAikenOff-chainEvolution
Upgradable proxy
Point a stable proxy address at a logic script hash stored in its datum, so the logic version can be swapped by updating the datum.
- Cardano Foundation, Upgradable proxyOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Vault
Protect funds with time-delayed withdrawals and a separate recovery key that can cancel a pending withdrawal during the wait period.
- Cardano Foundation, VaultOn-chainAikenScalusOff-chainCCL JavaEvolutionMeshJSPyCardanoScalus
Sources
Where the contracts on this page come from. Every link goes to the contract's own repository, and the portal hosts none of the code.
- Cardano Foundation21 contracts from Cardano FoundationCommon use cases, each in Aiken, Scalus or both, most with off-chain code in several SDKs.
- MeshJS7 contracts from MeshJSThe contract library of the Mesh SDK. Each contract comes with its Mesh off-chain code.
- Anastasia Labs2 contracts from Anastasia LabsAiken contracts for an upgradable multisig and for subscription payments, with Evolution off-chain code.
- awesome-aiken9 contracts from awesome-aikenA list of Aiken projects. The entries here are dApps on that list, each linked to its own repository.
- Other1 contract from OtherContracts listed on their own, credited to the repository owner.
Know a contract or a collection that belongs here?
Add a contract, or propose a collection for the page to index.