Contracts for Compact
OpenZeppelin Contracts for Compact is a library of modules for secure smart contract development on Midnight.
Getting Started
Overview (0.1.x)
Install the library, write a contract from its modules, and compile it.
Extensibility
Compose contracts from modules with the Module/Contract pattern.
ZK Circuits 101
Learn how Compact code compiles to circuits and what drives their cost.
Modules
Ownable
Restrict circuits to a single owner, with a shielded-owner variant.
AccessControl
Grant and enforce permissions with role-based access control.
ShieldedAccessControl
Role-based access control that hides who holds each role.
Security
Initializable and Pausable modules.
FungibleToken
Fungible tokens, an approximation of EIP-20.
NonFungibleToken
Non-fungible tokens, an approximation of EIP-721.
MultiToken
Multiple token types in one contract, an approximation of EIP-1155.
Utils
Account identifiers and common helper circuits.
API Reference
AccessControl API
Circuits, ledger state, and errors of the AccessControl module.
FungibleToken API
Circuits, ledger state, and errors of the FungibleToken module.
MultiToken API
Circuits, ledger state, and errors of the MultiToken module.
NonFungibleToken API
Circuits, ledger state, and errors of the NonFungibleToken module.
Ownable API
Circuits, ledger state, and errors of the Ownable module.
Security API
Circuits and errors of the Initializable and Pausable modules.
ShieldedAccessControl API
Circuits, ledger state, and errors of the ShieldedAccessControl module.
Utils API
Circuits of the Utils module.