> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

# Contract examples

Standalone Compact contracts that each demonstrate a specific language feature. These are not production-ready implementations. Use them to learn a feature in isolation before combining patterns in your own contracts.

Looking for a specific feature? The [Examples overview](https://docs.midnight.network/examples.md) maps every example to what it demonstrates.

[✦](https://docs.midnight.network/examples/contracts/calculator.md)

### [Calculator](https://docs.midnight.network/examples/contracts/calculator.md)

[Witness functions and on-chain verification of off-chain computation with assert statements.](https://docs.midnight.network/examples/contracts/calculator.md)

[View calculator→](https://docs.midnight.network/examples/contracts/calculator.md)

[✦](https://docs.midnight.network/examples/contracts/token-transfers.md)

### [Token transfers](https://docs.midnight.network/examples/contracts/token-transfers.md)

[Mint, send, and receive shielded and unshielded tokens using NIGHT token operations in Compact.](https://docs.midnight.network/examples/contracts/token-transfers.md)

[View token transfers→](https://docs.midnight.network/examples/contracts/token-transfers.md)

[✦](https://docs.midnight.network/examples/contracts/private-guest-list.md)

### [Private guest list](https://docs.midnight.network/examples/contracts/private-guest-list.md)

[Set operations, native NIGHT token handling, and the privacy boundary in Midnight DApps.](https://docs.midnight.network/examples/contracts/private-guest-list.md)

[View guest list→](https://docs.midnight.network/examples/contracts/private-guest-list.md)

[✦](https://docs.midnight.network/examples/contracts/election.md)

### [Election](https://docs.midnight.network/examples/contracts/election.md)

[Commit to private state, use Set and Map operations, and generate DApp-specific public keys.](https://docs.midnight.network/examples/contracts/election.md)

[View election→](https://docs.midnight.network/examples/contracts/election.md)

[✦](https://docs.midnight.network/examples/contracts/private-reserve-auction.md)

### [Private reserve auction](https://docs.midnight.network/examples/contracts/private-reserve-auction.md)

[Hide reserve prices on the public ledger and reduce user trackability with DApp-specific keys.](https://docs.midnight.network/examples/contracts/private-reserve-auction.md)

[View auction→](https://docs.midnight.network/examples/contracts/private-reserve-auction.md)

[✦](https://docs.midnight.network/examples/contracts/battleship-simple.md)

### [Battleship](https://docs.midnight.network/examples/contracts/battleship-simple.md)

[Explicit state management, private state verification, access control, List operations, and intermediate witnesses.](https://docs.midnight.network/examples/contracts/battleship-simple.md)

[View Battleship→](https://docs.midnight.network/examples/contracts/battleship-simple.md)
