Build Securely on Midnight with OpenZeppelin
OpenZeppelin brings its trusted libraries to Compact, Midnight’s TypeScript-inspired smart contract language. Built for privacy and compliance, these standards enable developers to create applications that safeguard data across DeFi, NFTs, identity, and Real-World Assets.
pragma language_version >= 0.14;
import CompactStandardLibrary;
import "openzeppelin-compact/token/FungibleToken" prefix FungibleToken_;
export ledger owner: Bytes<32>;
constructor(initialOwner: Bytes<32>) {
owner = initialOwner;
FungibleToken_initialize("MyToken", "MTK", 18);
}
export circuit mint(to: Either<ZswapCoinPublicKey, ContractAddress>, amount: Uint<128>): [] {
FungibleToken__mint(to, amount);
}Open Source Tools
Relayer (Coming soon)
Broadcast Compact contract transactions securely while preserving data confidentiality, ensuring private interactions reach the Midnight network seamlessly.
Monitor (Coming soon)
Track Compact contracts behavior to detect anomalies, monitor execution patterns, and trigger alerts without compromising sensitive data or user privacy.
UI Builder
Generate working interfaces for Compact contracts in seconds to test privacy-enabled functions without building custom front-ends.
Compact Security Detectors SDK
Identify vulnerabilities in Compact contracts before deployment with integrated security analysis to ship secure code across DeFi, identity, and tokenization applications on Midnight.
Starter Apps
LunarSwap
Explore privacy-enabled DeFi on Midnight with LunarSwap, a decentralized exchange reference implementation built with Compact Contracts. Featuring concentrated liquidity mechanics and shielded swap capabilities, it demonstrates how modern AMM design integrates seamlessly with Midnight's privacy-first architecture.
Use LunarSwap as your blueprint for building privacy-ready DeFi applications. Review Compact contract patterns, examine offchain component integration, and understand how to implement liquidity provisioning with selective disclosure. Built with Next.js and robust Compact math modules for production-grade privacy applications.
Enterprise-grade compliance and certifications
- CCPA Compliant
- SOC2 Certified
- GDPR Compliant
Security Services
Smart Contract Security Audit
Secure your Midnight applications with comprehensive smart contract audits covering DeFi, identity, and tokenization protocols with privacy-preserving features.
Blockchain Infrastructure Audit
Strengthen your offchain infrastructure through specialized audits of rollup components, sequencers, bridges, and privacy-preserving systems of your Midnight apps.